0% found this document useful (0 votes)
106 views2 pages

Overview of Memory Registers in CPUs

Memory registers are high-speed storage locations within the CPU that temporarily hold data, instructions, and addresses for fast access. Key types include the Accumulator, Memory Address Register, Memory Data Register, Program Counter, Current Instruction Register, and Status Register, each serving specific roles in processing and executing instructions. Registers enhance processing speed, ensure efficient execution, and support multitasking in computer operations.

Uploaded by

eiliyah ahmed
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views2 pages

Overview of Memory Registers in CPUs

Memory registers are high-speed storage locations within the CPU that temporarily hold data, instructions, and addresses for fast access. Key types include the Accumulator, Memory Address Register, Memory Data Register, Program Counter, Current Instruction Register, and Status Register, each serving specific roles in processing and executing instructions. Registers enhance processing speed, ensure efficient execution, and support multitasking in computer operations.

Uploaded by

eiliyah ahmed
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Memory Registers in Computer Science (O-Level Notes with Examples)

What are Memory Registers?


Memory registers are small, high-speed storage locations inside the Central Processing Unit
(CPU). They temporarily hold data, instructions, and addresses that the CPU is currently
processing. Registers allow for fast data access, making them faster than RAM and other
storage types.

Types of Memory Registers & Their Working Examples

1. Accumulator (ACC)
Stores intermediate results of arithmetic and logical operations. Works closely with the
Arithmetic Logic Unit (ALU).

Example:
Suppose the CPU performs:
5+3
- The ALU processes the addition.
- The result (8) is stored in the Accumulator (ACC) before being sent to memory or used in
the next operation.

2. Memory Address Register (MAR)


Holds the address of the memory location that the CPU wants to read from or write to.

Example:
If the CPU needs to fetch data from memory address 1050,
- MAR = 1050
- The CPU accesses this memory location to read or write data.

3. Memory Data Register (MDR)


Stores the actual data being transferred to or from memory.

Example:
If the CPU fetches a number from memory address 1050 containing 25:
- MAR = 1050 (address to access)
- MDR = 25 (data retrieved from memory)
Now, the CPU can use this data for further processing.

4. Program Counter (PC)


Holds the address of the next instruction to be executed. Increments automatically after
each instruction, ensuring smooth execution.
Example:
If a program has these instructions:
Address 2001 → LOAD A
Address 2002 → ADD B
Address 2003 → STORE C
1. The PC starts at 2001 and fetches 'LOAD A'.
2. The PC increments to 2002 and fetches 'ADD B'.
3. The PC increments to 2003 and fetches 'STORE C'.

5. Current Instruction Register (CIR)


Stores the instruction currently being executed.

Example:
If the PC fetches an instruction from address 2001 ('LOAD A'),
- CIR = LOAD A (this instruction is now being processed).
After execution, the next instruction is fetched into the CIR.

6. Status Register (SR)


Holds flags that indicate the outcome of operations, such as:
- Zero Flag (Z) – Set if a calculation results in zero.
- Carry Flag (C) – Set if an arithmetic operation produces a carry/overflow.
- Negative Flag (N) – Set if the result is negative.

Example:
If the CPU subtracts:
5-5=0
- The Zero Flag (Z) is set in the Status Register (SR), indicating a result of zero.

If the CPU adds:


255 + 10
- A carry occurs (because 255 is the max 8-bit value).
- The Carry Flag (C) is set in the SR.

Importance of Registers
- Faster processing: Registers provide quick access to frequently used data.
- Efficient execution: Instructions are processed smoothly due to registers like the PC and
CIR.
- Supports multitasking: The status register helps manage multiple operations.

Conclusion
Registers are essential for CPU operations, ensuring fast data handling and efficient
execution of instructions. Understanding their roles helps in grasping how computers
process tasks smoothly.

You might also like