1.1.1 Computer Components Flashcards
CPU
Central Processing Unit
Interprets, executes and processes instructions by manipulating information sent to its registers.
CU
Control Unit
Controls how data moves through the CPU by controlling buses
Controls and monitors the flow of data between the CPU and other components
Fetches, interprets and executes each instruction in turn (FDE)
ALU
Arithmetic Logic Unit
Performs arithmetic operations (addition etc) and logic operations (comparisons etc)
Can be stored anywhere in memory, but typically the accumulator
Buses
A collection of wires that carry data/instructions from one place to another inside a computer
(Collectively known as a system bus)
Data bus
Moves all data between the CPU and main memory (bidirectional)
Address bus
Transmits the memory addresses of data/instructions so that they can be retrieved by the CPU and executed
Control bus
Carries the signal that regulates data flow around a system and is concerned with timing operations like memory writing/reading and I/O operations
Clock
Regulates all instructions that take place by simulating pulses of high voltage, representing each cycle that implements an instruction
Register
Type of memory in the CPU that holds temporary data while the software program runs (faster than cache)
PC
Program Counter
Stores the location in main memory of the next instruction to be executed (either next instruction in sequence or the address to jump to if the current instruction is a branch)
Increments per instruction
MAR
Memory Address Register
Stores the address of the next data/instruction to be fetched from RAM
or which data is to be written
MDR
Memory Data Register
Temporarily stores data being read from/written to RAM or the instruction fetched from RAM
CIR
Current Instruction Register
Stores the instruction currently being executed
Accumulator
Stores the result of the ALU’s calculations
FDE
The CU in the processor manages the execution of instructions
Each instruction is fetched in sequence, decodes and synchronizes it before executing (by sending control signals)
Fetch meaning
Responsible for getting an instruction or data from main memory into the CPU and storing them in its own temp registers
Fetch instruction sequence
- The PC is checked (holds the address of the next instruction)
- Address is copied to the MAR
- Address is sent down the address bus to the RAM, and waits for a signal (via control bus)
- A signal is sent by the CU to RAM
- Contents in memory at that address are sent along the data bus to the MDR
- This data is copied from the MDR to the CIR (successful fetch)
- The PC increments
Decode sequence
- the data in the CIR is decoded by the decode unit
- made up via opcode and operand
- opcode - what to do, operand - what to do to
Execute sequence
(changes for instruction)
- send address x to MAR, to RAM, via address bus
- the CU sends a (e.g. read) signal along control bus to RAM
- contents at memory x are sent to the MDR via data bus
- does whatever (e.g. load to ACC)
- cycle repeats unless it is a stop instruction
LMC add
ADD 1xx
Adds value in register xx to the value in the ACC
(<999)
LMC subtract
SUB 2xx
Subtracts value in register x from the value in the ACC
A negative flag is set if negative so that BRZ and BRP can test
LMC store
STA 3xx
Stores/overwrites value in acc to register xx
ACC doesn’t change
LMC load
LDA 5xx
Loads/overwrites value in register xx to ACC
Register xx doesn’t change
LMC branch always
BRA 6xx
Unconditional branch
PC loads with xx and points to next instruction to be executed