P2 T2 L7 The Processor Flashcards
Explain the Central Processing Unit (CPU)
2 points + 5 components
- Controls the other components and executes instructions
- A processor has a number of different components, each with their own role to perform:
- Arithmetic-Logic Unit (ALU)
- Control Unit
- Clock
- General purpose registers
- Dedicated registers
Explain the system clock
3 points
- A series of regular ON/OFF signals used to synchronise the operations of the processor components.
- Actions are usually carried out on the rising edge of the clock
- Actions each take a fixed number of cycles to complete
Explain the control unit
3 points
- Coordinates the activity of all other components
- Separate steps such as fetching the address of data, and fetching the data itself from memory, are identified
- Each step is synchronised with the system clock
Explain the Arithmetic-Logic Unit (ALU)
5 points
- The problem solving part of the processor
- This component performs arithmetic, logical and shift operations on data
- Arithmetic operations include: Add, Subtract, Multiply and Divide
- Logical operations include: AND, OR, NOT, XOR
- Shift operations include: Move bits to the left or right within a register
Explain General purpose registers
4 points
- Temporary data store on the CPU
- Rather than writing working data back to ‘slow’ memory, processors have several locations of super-fast memory called registers that are used to temporarily store results
- The processor is then able to immediately access and re-use these results in subsequent calculations, e.g. Add 2 + 3 + 4
- Some processors have a single general purpose register called an Accumulator
Carrying out sequences of programming instructions requires many different pieces of ________ to be held.
eg:
the current instruction being executed
the address of the data that it needs, and also the data itself
the address of the next instruction to be executed
information
List the 6 dedicated registers in the CPU
- Program counter
- Current instruction register
- Memory address register
- Memory buffer register
- Status register
- Interrupt register
(Dedicated registers)
Explain Program counter / PC
(1 point)
- holds the memory address of the next instruction to be executed
(Dedicated registers)
Explain Current Instruction Register / CIR
(1 point)
- holds the current instruction
(Dedicated registers)
Explain Memory Address Register / MAR
(1 point)
- holds the address in memory where the processor is required to fetch or store data from or to
(Dedicated registers)
Explain Memory Buffer Register / MBR
- temporarily holds data moving between the processor and main memory – sometimes called MDR (Memory data Register)
(Dedicated Registers)
Explain Status register / SR
- holds information about the current state of operations. It is used to set flags (e.g. overflow) or to detect error conditions
(Dedicated registers)
Explain the Interrupt register
(1 point)
- Interrupt register stores the details of any upcoming interrupts
What happens when an interrupt happens?
2 steps
- all the register values are copied to a memory area called the ‘stack‘ and they stay in the stack whilst the CPU starts executing the interrupt service routine (ISR).
- Once the routine is over, the registers are loaded back with their original values from the stack and can continue with what they were doing before the interrupt came along. This is called ‘context switching’.
Give the 6 steps for FE cycle
- MAR ⬅ PC
2a. PC ⬅ PC + 1
2b. MBR ⬅ memory content from address - CIR ⬅ MBR
- Decode CIR (instruction decoder)
- Execute
NOTE: 2a & 2b happen simultaneously
WORDED STEPS
Step 1: Contents of PC copied into MAR
Step 2a: Contents of PC incremented by 1
Step 2b: Contents of Memory location addressed by MAR loaded into MDR
Step 3: Content of MDR copied into CIR
Step 4: Contents of CIR decoded
Step 5: instruction executed