Learning Objectives
By the end of this lesson, you will be able to:
- Understand the role of theCentral Processing Unit (CPU)in a computer
- Understand what is meant by amicroprocessor
- Understand the purpose of the components in a CPU that has aVon Neumann architecture
- Describe the process of theFetch-Decode-Execute cycle, including the role of each component
- Understand the role ofregisters: Program Counter (PC), Memory Address Register (MAR), Memory Data Register (MDR), Current Instruction Register (CIR) and Accumulator (ACC)
- Understand the role ofbuses: address bus, data bus and control bus
- Understand what is meant by acore,cacheandclockin a CPU and explain how they affect performance
- Understand the purpose and use of aninstruction setfor a CPU
- Describe the purpose and characteristics of anembedded systemand identify devices in which they are commonly used
Key Terms
Central Processing Unit (CPU)
The component of a computer that fetches, decodes and executes instructions. It takes input, processes data and produces output.
Microprocessor
A type of integrated circuit contained on a single chip that includes the CPU and sometimes other components.
Von Neumann Architecture
A CPU design where both data and instructions are stored in the same memory, based on the stored program concept.
Arithmetic Logic Unit (ALU)
Performs calculations (arithmetic) and logical decisions on data.
Control Unit (CU)
Sends signals to control how data moves around the CPU and coordinates all computer components.
Register
Tiny, super-fast pieces of onboard memory inside the CPU, each with a very specific purpose.
Program Counter (PC)
Holds the address of the next instruction to be executed. Increments by 1 as the cycle runs.
Memory Address Register (MAR)
Holds the address of the memory location that data or an instruction is to be fetched from or written to.
Memory Data Register (MDR)
Used to temporarily store data that is read from or written to memory.
Current Instruction Register (CIR)
Holds the current instruction being decoded and executed.
Accumulator (ACC)
Stores the results of calculations carried out by the ALU temporarily.
Address Bus
Unidirectional — carries the addresses that data needs to be written to or read from.
Data Bus
Bidirectional — carries actual data or instructions between components.
Control Bus
Bidirectional — carries command and control signals telling components when to read, write, etc.
Fetch-Decode-Execute Cycle
The cycle the CPU runs billions of times per second to fetch, decode and execute instructions.
Clock Speed
Measured in Hertz (Hz). The number of fetch-decode-execute cycles that can take place per second.
Cache
Very fast memory on or close to the CPU used for temporary storage of frequently used instructions and data.
Core
A complete processing unit within a CPU. A quad-core processor has four separate processing units.
Instruction Set
A list of all commands that can be processed by a CPU. The commands are machine code.
Opcode
The part of a machine code instruction that tells the CPU what operation needs to be done.
Operand
The part of a machine code instruction that provides the data or the address of the data to be operated on.
Embedded System
A computer system with a dedicated function within a larger mechanical system.
Stored Program Concept
Both data and instructions are stored in the same memory in binary form.
1. The CPU & Microprocessors
TheCentral Processing Unit (CPU)is the brain of the computer. Its purpose is tofetch, decode and execute instructions. The CPU takes in data and instructions, processes them, and produces output.
The Role of the CPU
- The CPU is central to all devices including laptops, desktops, games consoles and mobile devices.
- Data and commands are input by the user using an input device.
- The CPU processes data by executing instructions.
- Results are output to an output device.
Microprocessors
- Amicroprocessoris a type of integrated circuit contained on a single chip.
- It contains the CPU and sometimes other components such as memory controllers and I/O interfaces.
- It is a hardware chip that houses the CPU.
- The terms CPU and microprocessor essentially mean the same thing in everyday use, but technically the microprocessor is the chip that may include the CPU and other parts.
Real-Life Example: Input, Process, Output
| Step | Example |
|---|---|
| Input | A keyboard is used to input a number |
| Process | If the instruction being executed is ADD, the inputted value is added to an existing value |
| Output | The result of the calculation is outputted to the user via the monitor |
Activity 1: The CPU and Microprocessors
- State the purpose of the CPU. [2]
- What is a microprocessor? [2]
- Explain the difference between a CPU and a microprocessor. [2]
Solution:
- The purpose of the CPU is to fetch, decode and execute instructions [1]. It takes input, processes data and produces output [1].
- A microprocessor is a type of integrated circuit contained on a single chip [1]. It contains the CPU and sometimes other components such as memory controllers and I/O interfaces [1].
- The CPU is a component (the processing unit) [1]. The microprocessor is the chip that may include the CPU and other parts like memory and I/O controllers [1].
Check Your Understanding: The CPU
1. What is the purpose of the CPU? [2 marks]
- [1]To fetch, decode and execute instructions
- [1]To take input, process data and produce output
2. What is a microprocessor? [1 mark]
- [1]A type of integrated circuit contained on a single chip that includes the CPU
3. Name three devices that use a CPU. [3 marks]
- [1]Laptop / desktop
- [1]Games console
- [1]Mobile device / smartphone / tablet
4. Describe the input-process-output sequence. [3 marks]
- [1]Input: data and commands are entered by the user using an input device
- [1]Process: the CPU processes data by executing instructions
- [1]Output: the results are output to an output device
5. Explain why the CPU is described as the "brain" of the computer. [2 marks]
- [1]It is central to all modern computer systems and is responsible for the execution of all instructions
- [1]It processes all data and controls the operation of the computer
6. What other components might a microprocessor contain besides the CPU? [2 marks]
- [1]Memory controllers
- [1]I/O interfaces
2. Von Neumann Architecture
TheVon Neumann Architectureis a design of the CPU proposed by mathematician John Von Neumann in the 1940s. Most general-purpose computers are built upon this design. It outlines how the computer memory, input/output devices and processor all work together.
Key Concepts
- The Von Neumann architecture is based on thestored program concept.
- Bothinstruction data and program dataare stored in thesame memoryin binary form.
- There is no way to know if the pure binary held in memory represents instructions or data simply by looking at it.
- In the early days of computing (1940s), computers were built to carry out a very specific task. If the computer had to do another job, it had to be completelyre-wired by hand.
- Von Neumann's idea was to create a computer that was far easier to change — the task can be changed by simplyloading a different program into memory.
Components of the Von Neumann Architecture
- Control Unit (CU)
- Arithmetic Logic Unit (ALU)
- Main Memory (RAM)
- Registers
- Inputs and Outputs
This design is still used in most computers produced today.
Von Neumann Architecture Diagram
Exam Tip
Cambridge IGCSE 0478 regularly tests your ability to describe the purpose of CPU components and registers in the Von Neumann architecture. Use mark-ready definitions — no waffle, no brand names.
Activity 2: Von Neumann Architecture
- Describe what is meant by the Von Neumann architecture. [3]
- Explain what is meant by the stored program concept. [2]
- Why was the Von Neumann architecture an improvement over earlier computer designs? [2]
Solution:
- The Von Neumann architecture is a CPU design proposed by John Von Neumann in the 1940s [1]. It consists of a control unit, arithmetic logic unit, registers, and main memory [1]. Both data and instructions are stored in the same memory [1].
- Programs/instructions are stored in memory [1]. Data is also stored in memory [1]. Instructions are fetched and executed one after another [1].
- Earlier computers had to be physically re-wired by hand to change the task they performed [1]. Von Neumann architecture allows the task to be changed by loading a different program into memory [1].
Check Your Understanding: Von Neumann Architecture
1. What is the Von Neumann architecture? [2 marks]
- [1]A CPU design proposed by John Von Neumann in the 1940s
- [1]Where both data and instructions are stored in the same memory
2. What is the stored program concept? [2 marks]
- [1]Both data and instructions are stored in the same memory
- [1]Instructions and data are fetched and executed one after another
3. Name the four main components of the Von Neumann architecture. [4 marks]
- [1]Control Unit (CU)
- [1]Arithmetic Logic Unit (ALU)
- [1]Registers
- [1]Main memory (RAM) / Input/Output
4. How can you tell if a binary value in memory is an instruction or data? [2 marks]
- [1]You cannot tell simply by looking at the binary value
- [1]The CPU interprets it based on the context — if it is fetched as an instruction, it is treated as one
5. Explain why Von Neumann architecture is still used in most computers today. [2 marks]
- [1]It allows the computer to be easily reprogrammed by loading different software
- [1]It is flexible and can perform many different tasks
6. What is the relationship between the CPU and main memory in Von Neumann architecture? [2 marks]
- [1]The CPU accesses data and instructions directly from main memory
- [1]Both data and instructions are stored in the same memory
3. CPU Components: ALU, CU, Registers & Buses
The CPU consists of several key components that work together to execute instructions.
Arithmetic Logic Unit (ALU)
- Performscalculationsandlogical decisions.
- Carries out arithmetic operations (e.g. +, −, shifting).
- Carries out logic operations (e.g. AND, OR).
- A computer can have more than one ALU to carry out specific functions.
- Multiplication and division are carried out by a sequence of addition, subtraction and left or right logical shift operations.
Control Unit (CU)
- Sends signals to control how data moves around the CPU.
- Coordinates the operation of memory, processor and I/O devices.
- Decodes instructions fetched from memory.
- Ensures synchronisation of data flow and program instructions throughout the computer.
- The system clock produces timing signals on the control bus to ensure synchronisation.
Registers
Registers are tiny, super-fast pieces of onboard memory inside the CPU, each with a very specific purpose.
| Register | Abbreviation | Function/Purpose |
|---|---|---|
| Program Counter | PC | Holds the address of the next instruction to be executed. Increments by 1 as the fetch-decode-execute cycle runs. |
| Memory Address Register | MAR | Holds the memory address where data or instructions are to be fetched from or written to. |
| Memory Data Register | MDR | Stores the data or instruction which has been fetched from memory. |
| Current Instruction Register | CIR | Stores the current instruction being decoded and executed. |
| Accumulator | ACC | Stores the results of calculations carried out by the ALU temporarily. |
Buses
Components within the CPU and the wider computer system are connected by buses. A bus is a set of parallel wires through which data/signals are transmitted from one component to another.
Example: Read and Write Operations
Activity 3: CPU Components
- Describe the function of the ALU. [2]
- Describe the function of the Control Unit. [2]
- Match each bus to its correct description:
- Address bus — this bus carries signals used to coordinate the computer's activities
- Control bus — this bi-directional bus is used to exchange data between processor, memory and input/output devices
- Data bus — this uni-directional bus carries signals relating to memory addresses between processor and memory
Solution:
- The ALU carries out arithmetic operations [1] and logic operations [1].
- The CU controls the operation of memory, processor and I/O devices [1] and sends signals to coordinate all computer components [1].
- Address bus → this uni-directional bus carries signals relating to memory addresses between processor and memoryControl bus → this bus carries signals used to coordinate the computer's activitiesData bus → this bi-directional bus is used to exchange data between processor, memory and input/output devices
Check Your Understanding: CPU Components
1. What is the function of the ALU? [2 marks]
- [1]Carries out arithmetic operations
- [1]Carries out logical operations/decisions
2. What is the function of the Control Unit? [2 marks]
- [1]Sends control signals that manage the transfer of data and instructions within the CPU
- [1]Decodes instructions using an instruction set
3. What does the Program Counter (PC) hold? [2 marks]
- [1]Holds the address of the next instruction to be executed
- [1]It increments by 1 as the fetch-decode-execute cycle runs
4. What is the difference between the MAR and the MDR? [3 marks]
- [1]MAR holds the memory address of the data or instruction
- [1]MDR holds the data or instruction itself
- [1]The MAR is connected to the address bus; the MDR is connected to the data bus
5. Which bus is unidirectional and what does it carry? [2 marks]
- [1]The address bus is unidirectional
- [1]It carries memory addresses from the processor to memory
6. What is the function of the Accumulator (ACC)? [1 mark]
- [1]Stores the results of calculations carried out by the ALU temporarily
4. Fetch-Decode-Execute Cycle
TheFetch-Decode-Execute Cycleis the cycle that the CPU runs through billions of times per second to make a computer work. The purpose of the CPU is to fetch, decode and execute instructions.
Fetch Stage
- The Program Counter (PC) holds the address of the next instruction to be fetched from memory.
- The address in the PC is copied to the Memory Address Register (MAR) using the address bus.
- The PC is incremented by 1 so it points to the next instruction.
- The control unit sends a memory read request to main memory down the control bus.
- The address is sent down the address bus from the MAR to main memory.
- The contents of main memory are sent down the data bus into the Memory Data Register (MDR).
- The contents of the MDR are copied into the Current Instruction Register (CIR).
Decode Stage
- The instruction in the CIR is inspected and decoded.
- The CPU needs to work out what is required from the instruction.
- The instruction is split into two parts:
- Opcode— what the instruction is
- Operand— what to do it to (data or an address)
- The CPU finds the opcode in the processor's instruction set.
- The control unit sends signals to various components of the computer system.
Execute Stage
- The CPU carries out the instruction that was fetched.
- Some examples of what may take place:
- Going back to main memory and fetching data
- Performing a calculation
- Storing information back in main memory
- Depending on the instruction, data may end up being copied into the ALU and/or the accumulator.
Pipelining
Computer processors usepipelining— a micro-processing technique that handles multiple stages of different computer instructions at once. This allows the processor to begin fetching a second instruction before it has completed the machine cycle for another instruction.
Interactive Fetch-Decode-Execute Cycle
Step through the fetch-decode-execute cycle to see how the registers and buses are used.
Activity 4: Fetch-Decode-Execute Cycle
The following table shows the stages in the fetch-execute cycle. They are not in the correct order. Place the numbers 1 to 6 in the right-hand column to show each stage in its correct order. The first one has been done for you.
| Stage | Order |
|---|---|
| address is copied from PC to MAR; this is done using the address bus | |
| contents at memory location contained in MAR are copied temporarily into MDR | |
| contents of MDR are copied and placed in CIR | |
| instruction is finally decoded and then executed by sending out signals (via the control bus) to various components of the computer system | |
| program counter (PC) contains address of memory location of next instruction to be fetched | 1 |
| value in PC is incremented by 1 so that it now points to the next instruction to be fetched |
Solution:
| Stage | Order |
|---|---|
| address is copied from PC to MAR; this is done using the address bus | 2 |
| contents at memory location contained in MAR are copied temporarily into MDR | 3 |
| contents of MDR are copied and placed in CIR | 4 |
| instruction is finally decoded and then executed by sending out signals (via the control bus) to various components of the computer system | 6 |
| program counter (PC) contains address of memory location of next instruction to be fetched | 1 |
| value in PC is incremented by 1 so that it now points to the next instruction to be fetched | 5 |
Check Your Understanding: Fetch-Decode-Execute Cycle
1. What are the three stages of the fetch-decode-execute cycle? [3 marks]
- [1]Fetch
- [1]Decode
- [1]Execute
2. During the fetch stage, what happens to the Program Counter? [2 marks]
- [1]The address it holds is copied to the MAR
- [1]It is incremented by 1 so it points to the next instruction
3. Which register holds the instruction while it is being decoded? [1 mark]
- [1]The Current Instruction Register (CIR)
4. What is an opcode and what is an operand? [2 marks]
- [1]Opcode — what the instruction is / the operation to be performed
- [1]Operand — what to do it to / the data or address of the data
5. Describe what happens during the execute stage. [3 marks]
- [1]The CPU carries out the instruction that was fetched
- [1]This could involve performing a calculation / going back to memory to fetch data
- [1]Data may end up in the ALU and/or the accumulator
6. Explain what is meant by pipelining. [2 marks]
- [1]A micro-processing technique that handles multiple stages of different computer instructions at once
- [1]Allows the processor to begin fetching a second instruction before completing the machine cycle for another
5. CPU Performance: Clock, Cache & Cores
A CPU's overall performance can be affected by several factors. The three most important areclock speed,cache sizeandnumber of cores.
Clock Speed
- Measured in number of cycles per second or Hertz (Hz).
- Measures the number of fetch-decode-execute cycles that can take place in 1 second.
- A 3.2GHz clock speed = 3.2 billion instructions fetched per second (in theory).
- The faster the clock speed, the more instructions can be executed per second.
Cache Size
- Cache is very small, very fast memory on or close to the CPU.
- Used as temporary storage for frequently used instructions and data.
- Much quicker to read from than main memory (RAM).
- The larger the cache, the more frequently used data can be stored.
- Reduces the need to fetch instructions from RAM, saving time.
Number of Cores
- A core is a complete copy of a CPU — it has its own CU, ALU, registers and accumulator.
- A quad-core processor has four separate processing units.
- Multiple cores can process instructions at the same time.
- Doubling the number of cores won't double processing speed.
- Cores need to communicate with each other, which takes time.
- Many programs are not designed to make use of multiple cores.
Example: Quad-Core CPU Performance
Interactive CPU Performance Comparison
Adjust the sliders to see how clock speed, cache size and number of cores affect CPU performance.
Activity 5: CPU Performance
- Explain how increasing the clock speed affects CPU performance. [2]
- Explain how increasing the cache size affects CPU performance. [2]
- One computer has a single core processor and the other has a dual core processor. Explain why having a dual core processor might improve the performance of the computer. [2]
Solution:
- Increasing the clock speed means more fetch-decode-execute cycles can take place per second [1]. This means more instructions can be executed per second, improving performance [1].
- Increasing the cache size means more frequently used instructions and data can be stored on or close to the CPU [1]. This reduces the need to fetch from RAM, which is slower, improving performance [1].
- The computer with the dual core processor has two cores / double the amount of cores [1]. Parallel processing can take place — each core can execute a separate instruction at the same time [1].
Check Your Understanding: CPU Performance
1. What is clock speed measured in? [1 mark]
- [1]Hertz (Hz) — cycles per second
2. What is cache and where is it located? [2 marks]
- [1]Very small, very fast memory
- [1]On or close to the CPU
3. What is a core? [2 marks]
- [1]A complete copy of a CPU
- [1]It has its own CU, ALU, registers and accumulator
4. Why doesn't doubling the number of cores double the processing speed? [2 marks]
- [1]Cores need to communicate with each other, which takes time
- [1]Many programs are not designed to make use of multiple cores
5. A CPU runs at 2.5GHz. How many instructions can it theoretically process per second? [1 mark]
- [1]2.5 billion instructions per second
6. Why does a larger cache improve CPU performance? [2 marks]
- [1]More frequently used instructions and data can be stored in the cache
- [1]This reduces the number of fetch cycles from RAM, which is slower, speeding up performance
6. CPU Instruction Sets
Processors executemachine code. Every type of processor has its own specific list of commands that it can understand, called aninstruction set.
Key Concepts
- An instruction set is alist of all the commands that can be processed by a CPU.
- The commands aremachine code.
- Machine code produced for one type of computer willnot work on another— it is machine-specific.
- An operation is made up of anopcodeand anoperand.
- These specific machine codes can be represented usingmnemonics— short codes like LDA.
- Mnemonics are easier for humans to understand and form the basis of assembly language.
Example Instruction Set
| Instruction | Mnemonic | Binary Code | Command |
|---|---|---|---|
| Add | ADD | 10100001 | Adds a value to the value currently stored in the accumulator |
| Subtract | SUB | 00100010 | Subtract a value from the value stored in the accumulator |
| Load | LDA | 10111111 | Load the value stored in a memory location into the accumulator |
| Store | STA | 01100000 | Store the value in the accumulator in a specific location in memory |
| Stop | HLT | 00000000 | Stop the program |
Worked Example
Question:Using the instruction set above, what would be the operation if the instruction was 00100010 00000010?
Answer:The operation would be SUB. If the operand was raw data, the complete instruction would be to subtract 2 from the value in the accumulator.
Activity 6: Instruction Sets
- What is an instruction set? [2]
- What is the difference between an opcode and an operand? [2]
- Why is machine code described as machine-specific? [2]
Solution:
- An instruction set is a list of all the commands that can be processed by a CPU [1]. The commands are machine code [1].
- The opcode tells the CPU what operation needs to be done [1]. The operand is the data or the address of the data to be operated on [1].
- Machine code produced for one type of computer will not work on another [1]. This is because each processor has its own specific instruction set [1].
Check Your Understanding: Instruction Sets
1. What is an instruction set? [2 marks]
- [1]A list of all the commands that can be processed by a CPU
- [1]The commands are machine code
2. What is an opcode? [1 mark]
- [1]The part of the instruction that tells the CPU what operation needs to be done
3. What is an operand? [1 mark]
- [1]The data or the address of the data to be operated on
4. What is machine code? [1 mark]
- [1]Binary code that can be directly executed by the CPU
5. Why can't a program written for an Intel processor run on an ARM processor? [2 marks]
- [1]Each processor has its own specific instruction set
- [1]Machine code for one processor will not work on a processor with a different instruction set
6. What are mnemonics and why are they used? [2 marks]
- [1]Short codes like LDA that represent machine code instructions
- [1]They are easier for humans to understand and form the basis of assembly language
7. Embedded Systems
Anembedded systemis a computer system with a dedicated function within a larger mechanical system. It is different from a general-purpose computer that is used to perform many different functions.
Properties of Embedded Systems
- Low power consumption
- Small size
- Rugged operating systems
- Low cost per unit
These benefits come at the cost of limited processing resources, making them more difficult to program and interact with.
Examples of Embedded Systems
- Traffic lights
- Domestic appliances (washing machines, dishwashers, coffee machines)
- Factory equipment
- Engine management systems in cars
- Hospital equipment
- Security systems
- Lighting systems
- Vending machines
- Set-top boxes
- Heating thermostats
Benefits and Drawbacks of Embedded Systems
| Benefits | Drawbacks |
|---|---|
| Small in size and easy to fit into devices | Difficult to upgrade some devices to take advantage of new technology |
| Relatively low cost to make | Troubleshooting faults becomes a specialist task |
| Dedicated to one task — simple interfaces, often no OS required | Devices accessible over the internet are open to hackers and viruses |
| Consume very little power | Often thrown away rather than repaired due to upgrade/fault difficulties |
| Can be controlled remotely using a mobile phone | Can lead to an increase in 'throw away' society |
Real-Life Example: Motor Vehicles
Modern cars have many parts that rely on embedded systems to function correctly. For example, engine management systems use embedded systems to monitor and control the engine's performance. Many modern cars allow updates to engine management systems and other components via satellite link.
Real-Life Example: Set-Top Box
A set-top box uses an embedded system to allow recording and playback of television programmes. This can be operated remotely by the user when not at home using an internet-enabled device. The embedded system looks after many functions involving inputs from a number of sources such as a solid state device where television programmes can be stored or retrieved, or a satellite signal where it will be necessary to decode the incoming signal.
Activity 7: Embedded Systems
- Tick two boxes to show which are examples of an embedded system:
- Laptop
- Washing Machine
- Mobile Phone
- Car Engine Management System
- Justify your choice to question 1. [2]
Solution:
- Washing Machine ✓ and Car Engine Management System ✓ [2]
- A washing machine and car engine management system are not general-purpose computers [1]. They have a single purpose and are both housed inside a larger mechanical unit [1].
Check Your Understanding: Embedded Systems
1. What is an embedded system? [2 marks]
- [1]A computer system with a dedicated function
- [1]Within a larger mechanical system
2. Give three examples of devices that use embedded systems. [3 marks]
- [1]Any one of: traffic lights, domestic appliances (washing machine, dishwasher, coffee machine), factory equipment, engine management systems, hospital equipment, security systems, lighting systems, vending machines
- [1]A second from the list
- [1]A third from the list
3. State two properties of embedded systems. [2 marks]
- [1]Low power consumption / small size
- [1]Rugged operating systems / low cost per unit
4. Give two drawbacks of embedded systems. [2 marks]
- [1]Difficult to upgrade devices to take advantage of new technology / troubleshooting faults becomes a specialist task
- [1]Devices accessible over the internet are open to hackers and viruses / often thrown away rather than repaired
5. Explain how an embedded system is used in a washing machine. [3 marks]
- [1]The embedded system controls the wash cycle
- [1]It takes input from the user via keypad or dials (temperature, cycle selection)
- [1]It then carries out the required task without any further human intervention
6. What is the difference between an embedded system and a general-purpose computer? [2 marks]
- [1]An embedded system performs a dedicated/single function
- [1]A general-purpose computer performs many different functions (e.g. a PC or laptop)
Key Takeaways
- TheCPUis the brain of the computer — it fetches, decodes and executes instructions.
- Amicroprocessoris an integrated circuit on a single chip that includes the CPU and sometimes other components.
- Von Neumann architectureis based on the stored program concept — both data and instructions are stored in the same memory.
- The CPU consists of theALU(calculations and logic), theCU(control and coordination),registers(fast temporary storage) andbuses(connections).
- Registers: PC holds the address of the next instruction; MAR holds the address being accessed; MDR holds the data; CIR holds the current instruction; ACC holds calculation results.
- Buses: Address bus is unidirectional (carries addresses); Data bus is bidirectional (carries data/instructions); Control bus is bidirectional (carries control signals).
- TheFetch-Decode-Execute cycleis the process the CPU runs billions of times per second.
- Fetch: the instruction is fetched from memory.Decode: the instruction is interpreted.Execute: the instruction is carried out.
- CPU performanceis affected byclock speed(number of cycles per second),cache size(amount of fast temporary storage) andnumber of cores(separate processing units).
- Aninstruction setis a list of all commands a CPU can process. Instructions are made up of anopcode(what to do) and anoperand(what to do it to).
- Machine codeis machine-specific — code for one processor will not work on another.
- Embedded systemsare dedicated computer systems built into larger devices. They are small, low cost, and low power, but difficult to upgrade.
Question Bank
1. Describe the function of the ALU. [2 marks]
- [1]Carries out arithmetic operations
- [1]Carries out logic operations
2. Describe the function of the Control Unit. [2 marks]
- [1]Controls operation of memory, processor and I/O devices
- [1]Sends signals to coordinate all computer components
3. State the role of the Program Counter (PC). [2 marks]
- [1]Holds the address of the next instruction to be executed
- [1]Increments by 1 as the fetch-decode-execute cycle runs
4. State the role of the Memory Data Register (MDR). [2 marks]
- [1]Stores data or instructions that are in use
- [1]Data/instruction from the address in the MAR
5. Name the three buses used in the fetch-execute cycle and state the direction of each. [3 marks]
- [1]Address bus — unidirectional
- [1]Data bus — bidirectional
- [1]Control bus — bidirectional
6. Explain how an instruction is fetched using Von Neumann architecture. [6 marks]
- [1]The Program Counter (PC) holds the address of the next instruction to be fetched
- [1]The address held in the PC is sent to the Memory Address Register (MAR)
- [1]The memory address is sent using the address bus
- [1]The Program Counter is incremented
- [1]The instruction is sent from the address in memory to the Memory Data Register (MDR)
- [1]The instruction is transferred using the data bus / The instruction is sent to the Current Instruction Register (CIR)
7. Explain what is meant by the stored program concept. [2 marks]
- [1]Programs/instructions and data are both stored in memory
- [1]Instructions are fetched and executed one after another
8. One computer has a single core processor and the other has a dual core processor. Explain why having a dual core processor might improve the performance of the computer. [2 marks]
- [1]The computer with the dual core processor has two cores / double the amount of cores
- [1]Parallel processing can take place — each core can execute a separate instruction at the same time
9. Explain how the size of the cache can affect the performance of a CPU. [2 marks]
- [1]A larger cache can store more frequently used instructions and data
- [1]This reduces the need to fetch from RAM (which is slower), improving performance
10. Identify and describe the purpose of two different buses used in a processor. [4 marks]
- [1]Address bus — carries an address/location of the next item to be fetched
- [1]Data travels one way (unidirectional)
- [1]Data bus — carries data that is currently being processed / will be / has been processed
- [1]Data can travel in both directions (bidirectional) / Control bus — carries signals that control/direct the actions of the CPU
11. The following table shows the stages in the fetch-execute cycle. They are not written in the correct order. Place the numbers 1 to 6 in the right-hand column to show each stage in its correct order. [5 marks]
- address is copied from PC to MAR; this is done using the address bus →2
- contents at memory location contained in MAR are copied temporarily into MDR →3
- contents of MDR are copied and placed in CIR →4
- instruction is finally decoded and then executed by sending out signals (via the control bus) to various components of the computer system →6
- program counter (PC) contains address of memory location of next instruction to be fetched →1
- value in PC is incremented by 1 so that it now points to the next instruction to be fetched →5
12. A memory location contains the address 1 1 0 1 1 0 0 0 and the contents 0 0 0 1 1 0 0 0. Describe a READ operation on location 1 1 0 1 1 0 0 0 indicating the role of the MAR, MDR and buses. [4 marks]
- [1]MAR will contain 11011000 (the address to be read)
- [1]A read signal is sent to the computer memory along the control bus
- [1]MDR will contain 00011000 (the contents of that address)
- [1]The address is sent along the address bus and the data is returned along the data bus
13. Describe how special purpose registers are used in the fetch stage of the fetch-execute cycle. [4 marks]
- [1]The Program Counter (PC) holds the address of the next instruction to be fetched
- [1]The address in the PC is copied to the Memory Address Register (MAR)
- [1]The Program Counter (PC) is incremented
- [1]The instruction is copied to the Memory Data Register (MDR) from the address held in the MAR / The instruction from the MDR is copied to the Current Instruction Register (CIR)
14. What is an embedded system? [2 marks]
- [1]A computer system with a dedicated function
- [1]Within a larger mechanical system
15. Explain why a program written for one computer will not necessarily work on another computer with a different processor. [2 marks]
- [1]Each processor has its own specific instruction set
- [1]Machine code for one processor will not work on a different processor