Rastriya Banijya Bank Limited2083 BSQuestion 5 of 16
What is memory management? Explain different types of registers with their usages.
10 marks
Question source
- Exam year
- 2083 BS / 2026 AD
- Level
- Fifth Level
- Paper
- Paper II – Information Technology and Management
- Section
- Section A: Short Answer Questions
Model answer
Memory Management
Memory management is the function of the operating system that controls and coordinates the use of a computer's primary memory (RAM). Its goals are to ensure efficient utilization of memory, prevent processes from interfering with each other, and provide each process with the memory it needs.
Key tasks of memory management:
- Memory allocation — assigning free memory blocks to processes on request
- Memory deallocation — releasing memory when a process terminates
- Virtual memory — using hard disk space as an extension of RAM (paging/swapping) so that programs larger than physical RAM can run
- Memory protection — preventing a process from reading or writing another process's memory space
- Contiguous/non-contiguous allocation — strategies like paging and segmentation for flexible memory use
- Fragmentation management — reducing internal and external fragmentation through compaction or paging
Types of Registers and Their Usages
A register is a small, extremely fast storage location located directly inside the CPU. Registers hold data, instructions, and addresses that the CPU is actively working with. Access time is a few nanoseconds — far faster than RAM.
| Register | Full Name | Usage |
|---|---|---|
| MAR | Memory Address Register | Holds the memory address of the data or instruction to be fetched from or written to RAM. The CPU puts the target address here before initiating a memory read or write. |
| MDR / MBR | Memory Data Register / Memory Buffer Register | Holds the actual data that was just read from memory or is about to be written to memory. It acts as a buffer between the CPU and RAM. |
| PC | Program Counter (Instruction Pointer) | Holds the address of the next instruction to be fetched from memory. It is incremented after each instruction fetch; modified by jump/branch instructions. |
| IR | Instruction Register | Holds the currently executing instruction that was fetched from memory. The control unit decodes the instruction stored here. |
| ACC | Accumulator | Holds intermediate results of arithmetic and logic operations performed by the ALU. In many architectures, one operand comes from the ACC and the result is placed back in it. |
| SP | Stack Pointer | Holds the memory address of the top of the stack. It is automatically decremented on PUSH and incremented on POP, tracking the current stack position for subroutine calls and local variables. |
| BP / FP | Base Pointer / Frame Pointer | Holds the base address of the current stack frame. Used in function calls to access local variables and parameters at fixed offsets from this base address. |
| Flag / Status Register | Condition Code Register (CCR) | Stores individual status bits (flags) set by ALU operations: Zero (Z) — result was zero; Carry (C) — arithmetic carry/borrow; Sign/Negative (N) — result is negative; Overflow (V) — arithmetic overflow occurred. Used by conditional branch instructions. |
| General Purpose Registers | (e.g., AX, BX, CX, DX in x86) | Store data, operands, and intermediate results for arithmetic and logical operations. Faster to access than memory. For example: AX (Accumulator), BX (Base), CX (Counter — used in loops), DX (Data — used in I/O operations and multiplication). |
| Index Registers | SI (Source Index), DI (Destination Index) | Used for array and string operations; hold the index/offset for memory addressing. The CPU uses them in block data move and compare instructions. |
| Segment Registers | CS, DS, SS, ES | Used in segmented memory architectures to hold base addresses of memory segments — Code Segment (CS), Data Segment (DS), Stack Segment (SS), Extra Segment (ES). |