How is data transferred from CPU to memory? Explain in steps
Data is transferred from CPU to memory by using address bus and data bus. The process of transferring data from CPU to memory consists of different steps. These steps are as follows:
1 CPU places the address of main memory on address bus.
2 CPU places the address of the data location on address bus.
3 Main memories see the address on address bus.
What are CPU registers? Briefly describe special-purpose registers.
Register is a small high-speed memory inside CPU. It is used to store data and instructions temporary. Data is stored in registers from main memory for execution. CPU contains a number of registers. Each register has a predefined function.
Register size determines how much information it can store. The size of registers is in bytes. Each byte can store one character of data. A register can be of 1, 2, 4, or 8 bytes. Bigger size of register increases the performance of CPU.
Special Purpose Registers
Special-purpose registers are normally used by CPU. These registers are as follows:
1. Program Counter (PC)
Program counter is used to store the address of the next instruction to be fetched for execution. When the instruction is fetched, the value of program counter is incremented. It now refers to the next instruction.
2. Instruction Register (IR)
Instruction register is used to store the fetched instructions. The instruction is also decoded in this register.
3. Memory Address Register (MAR)
Memory address register is used to store memory address being used by CPU. When CPU wants to read or write data in memory, it stores the address of that memory location in this register.
4. Memory Buffer Register (MBR)
Memory buffer register is used to store the data coming from the memory or going to the memory.
5. Stack Pointer Register
A stack is set of memory locations in which data is stored and retrieved in an order. This order is called Las-in-First-Out (LIFO). The data item stored at the top of stack is retrieved before retrieving the item below it. Stack pointer registers are used to manage stack in computer.
Briefly discuss different general-purpose registers.
General-purpose registers are used in mathematical and logical operations. These registers are part of ALU. Accumulator register is general-purpose register. There are four types of accumulative registers called EAX, EBX, ECX, and EDX.
The size of these registers can be 1 to 4 bytes. The two-byte data registers AX, BX, CC, DX contain two partsof 8-bt size. these parts are separately accessible. The lower-order bytes are AL, BL, CL and DL. The high-order bytes are AH, BH, CH and DH.
1. A stands for Accumulator.
2. B stands for Base.
3. C stands for Data
4. D stands for data
Different general-purpose registers are as follows:
1. Accumulator register (AX): It is used for arithmetic and data movement. It has special addressing capabilities.
2. base register (AX): it is used for arithmetic and data operations.
3. Counter Register (CX): It is used for counting purpose. It acts a counter for repetitions or loops.
4. Data Register (CX): It is used for division and multiplications.