Unit 1 - Components of a CPU Flashcards
Arithmetic and Logic Unit (ALU)
This performs any arithmetic calculations (e.g. adding binary) or any logic comparisons (using AND, OR, NOT)
The ALU is made up of several components
Control Unit
This is where instructions are decoded. The CU also controls the data within the CPU and how it moves around
Program Counter (PC)
This stores the address in memory of the next instruction to be fetched
Accumulator (ACC)
This is where values are stored temporarily, either after they’ve been inputted or loaded, or after being calculated in the ALU
Memory Address Register (MAR)
This is where addresses are stored, either for where data is being sent in memory, or where it is being fetched from
Memory Data Register (MDR)
This is where data/instructions are stored, either before it sent to memory, or after being fetched
Current Instruction Register (CIR)
When an instruction has been fetched from memory it is loaded here before being split into opcode and operand. After this, it will be decoded.
What components does the ALU consist of?
Arithmetic circuit, Logic circuit, Registers, Status flags, Buses
Purpose of Arithmetic Circuit
This carries out any arithmetic (addition, subtraction, multiplication or division)
Purpose of Logic circuit
This carries out operations like AND, OR, NOT, XOR
Purpose of Registers
These are additional registers to those mentioned above and can store data
Purpose of Status flags
This includes overflow flags (if the value is too large for the register) or could include a zero flag (to tell if the answer is 0 easily)
Purpose of Buses
These are used to transport data around the ALU and to other parts of the CPU
Buses within the CPU
Data bus, Address bus, Control bus
Data Bus
Holds data being sent to/from the CPU and RAM (Read/ Write)