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
Describe what will happen during the decode and execute part of the cycle
(8 steps)
- The instruction is held in the CIR, instruction in CIR is decoded
- The {control unit / instruction decoder} decodes the instruction
- Instruction will be split into opcode and operand
- CPU executes instruction using ALU to perform calculations
- Further {memory fetches / saves} carried out if required
- Result of computation {stored in accumulator / written to main memory}
- Status register updated
- If there is a {jump / branch} instruction, PC is updated
In the FE cycle diagram, why does the second stage contain two steps?
(2 points)
- These two happen at the same time
- This is possible as they are two different devices that do not depend on each other
NOTE: This speeds up the FE cycle
Explain Fetch-Execute cycle
2 points
- Processors operate in defined stages that are used to carry out program instructions
- The process (the fetch execute cycle) is repeated over and over again for each instruction in a program
(NOTE: The process is the fetch-execute cycle)
Explain how the clock affects the performance of a processor
2 points
- The Fetch-Execute cycle is triggered from the clock pulses of the system clock
- The faster the clock speed, the faster a computer can fetch, decode and execute instructions
NOTE: This clock can change state many billions of times per second. A 4GHz processor would tick 4 Billion times per second
Explain the Fetch step in the FE cycle (1 point)
- The next instruction is fetched from the PC (program counter)
Explain the Decode step in the FE cycle (1 point)
- With the instruction now in the CIR (current instruction register), the Control Unit can work out what needs to be done to carry it out
Explain the Execute step in the FE cycle (1 point)
- The registers in the CPU now contain everything that the ALU (arithmetic logic unit) needs to carry out the instruction
State the factors that influence the performance of a processor
(4 factors)
- Number of cores: more processors can be linked together on a single chip allowing more instructions to be executed simultaneously
- Word length: the amount of data that the CPU can process simultaneously
- Address and data bus width
- Clock speed
Define Cache memory (1 point)
Cache memory is larger and slower than a ________, faster and smaller than ____.
Larger amounts of cache memory can improve __________ ________
- Cache is a small amount of superfast memory that stores data that is frequently used by the processor
register
RAM
processing speed