Slides badge

Computer Structure

Learning Intentions

  • Describe the concept of the fetch-execute cycle

  • Describe factors affecting computer performance

Success Criteria

  • I can name and describe the stages of the fetch-execute cycle
  • I can name and describe several ways of measuring and comparing performance of computer systems
  1. Name the 3 parts of the processor
  2. Name the three buses that connect the CPU and main memory

Starter task

  1. Name the 3 parts of the processor - The Control Unit, the ALU and Registers
  2. Name the three buses that connect the CPU and main memory - The address bus, data bus and control bus

Starter task

What we will cover

  • In this lesson, we will cover:

    • The fetch-execute cycle

    • Factors affecting computer system performance

Computer Architecture - National 5

The processor

  • From this diagram we should also know that the CPU is broken down into 3 main parts:

Control Unit

The control unit controls the order of execution and the timing of all instructions

Arithmetic and Logic Unit (ALU)

The ALU performs the calculations for the processor and evaluates logical decisions.

Registers

The registers are temporary storage spaces for data. They are found directly on the CPU and are often only a few bytes in size.

The Control Unit

  • The control unit is used mainly to ensure the proper execution of instructions and keep the parts of the computer in sync with each other.
  • It ensures that instructions are fetched, decoded and executed in the correct order.
  • Connected to the control unit is the control bus which is then connected to several different parts of the computer system via control lines.

The Control Unit

  • The control lines in the control unit have various functions:
Control Line Function
Clock Generates a constant pulse (measured in MHz). One operation will be carried out per pulse
Read Signals that the processor wishes to read data from the memory
Write Signals that the processor wishes to write data to the memory
Reset Causes the processor to halt execution of current instruction. All registers cleared and machine reboots
Interrupt (IRQ) Notifies the processor that an external event has occurred such as I/O from a device. This type of interrupt can be ignored. 
Non-Maskable Interrupt (NMI) This is an interrupt that CANNOT be ignored such as a low power failure notification

Clock Speeds

  • Clock speed is the number of pulses that occur in a second. Which is measured in hertz

    • 1 clock pulse = 1 hertz

    • 1000 clock pulses = 1000 hertz = 1 kilohertz

    • 1000 kilohertz = 1 megahertz

    • 1000 megahertz = 1 gigahertz

    • 1000 gigahertz = 1 terahertz

The Arithmetic and logic Unit

  • The primary role of the ALU is arithmetic calculations, including addition, subtraction, multiplication and division.

  • In relation to logic it will perform calculations such as AND/OR/NOT (such as those used in programming or in a processor instruction)

  • One particular register used by the ALU is the accumulator which holds the results of calculations. (Intel calls this the EAX)

Registers

  • Registers are very small memory locations found on the CPU itself. Because they are found on the CPU die, they are incredibly quick to access. 

  • Registers are used to store small amounts of data whilst a program is being executed. The data they tend to hold varies from program data, to instructions to memory locations.

  • Registers are very close to the processing units of the CPU (such as the ALU and control unit) to improve system performance, but they are also very small and limited to around 64 bits (8 bytes).

Registers

  • Below is a simple C program to add two numbers in x86 Assembly Code:

add(int, int):
        push    rbp
        mov     rbp, rsp
        mov     DWORD PTR [rbp-4], edi
        mov     DWORD PTR [rbp-8], esi
        mov     eax, DWORD PTR [rbp-4]
        add     eax, DWORD PTR [rbp-8]
        pop     rbp
        ret

Registers

  • Some specialist registers are shown below:

Register name Description
Instruction Register Holds the address in memory of the next instruction to be executed
Memory Address Register (MAR) This is used to hold a value representing the address in memory that the processor needs to access. This would be connected to the address bus
Memory Data Register (MDR) This is used to gold data read from or being written to memory. Connected to the data bus
Program Counter Stores the instruction number that the program is currently executing. On x86 machines this is called the instruction pointer.

Buses

  • Buses are lines (wires) that connect different parts of a computer together.

  • If you flip a motherboard over, you can see all the lines (called traces) that show all the buses.

Different buses

  • Data Bus – Used to carry data to and from the CPU and memory. It holds a binary word. The data bus is bidirectional.

  • Address Bus - Used to carry the address of the memory location that is being used. It is unidirectional.

  • Control Bus – This doesn’t carry data but has a number of status signals it can send (reset, interrupt etc.)

unidirectional = one way

bidirectional = two way

Word length

  • A binary word is the number of bits that can be transferred by the data bus in a single operation.

  • Most PCs just now have a word length of 32 or 64 bits. Meaning the data bus can carry 16 (WORD), 32 (DWORD) or 64 (QWORD) bits in a single operation.

Effects of changing bus width

  • Changing the width of the data bus means that we can move more or less data in a single operation - this would lead to increased performance due to less operations required to move

  • Changing the width of the address bus means that we can address more memory - this wouldn’t necessarily lead to an increase in performance in all cases

0

1

0

1

1

0

0

1

0

0

1

1

1

0

0

1

1

1

1

1

1

0

1

1

1

1

0

0

0

0

0

0

16 bit address bus

Effects of changing bus width

  • Changing the width of the data bus means that we can move more or less data in a single operation - this would lead to increased performance due to less operations required to move

  • Changing the width of the address bus means that we can address more memory - this wouldn’t necessarily lead to an increase in performance in all cases

0

1

0

1

1

0

0

1

0

0

1

1

1

0

0

1

1

1

1

1

1

0

1

1

1

1

0

0

0

0

0

0

32 bit address bus

Past Paper Question

Explain why increasing the width of the data bus will improve the system performance.

 

2 marks

SQP Q11 b)

The wider the data bus, the more bits that can be transferred (1 mark) in a single operation (1 mark)

The fetch-execute cycle

  • Fetch-execute cycle is how the CPU reads and writes instructions from the main memory.

The memory address of the next instruction is placed on the Memory Address Register

The processor activates the read line on the control bus

The instruction is fetched from the memory location using the data bus and stored in the Instruction Register

The instruction in the Instruction Register is then interpreted by the decoder and executed

Stage

1

2

3

4

From what we just looked at, write down the four stages of the fetch-execute cycle and describe them.

Task

Improving computer performance

Factors affecting performance

  • Computer performance can often be affected or improved by a number of different factors, including:
    • The number of processors/cores
    • Width of the data bus
    • Cache memory
    • Clock speed

The number of processors/cores

  • A multi-core processor is a processor with two or more separate processing units (cores).

  • Each core contains an ALU, Control Unit and Registers.

  • The greater the number of cores on a processor, the greater the number of instructions that can be carried out simultaneously.

  • However, it’s not always possible to share tasks between cores.

An AMD EPYC chip is shown to the right. It consists of multiple smaller chiplets which themselves have multiple cores. EPYC processors can have up to 128 cores as of 2023.

The number of processors/cores

  • It's also possible to get motherboards that can take multiple processors themselves. 

  • The board pictured here is a dual AMD EPYC board that can take two 128 core EPYC CPUs and up to 1.2TB of main memory.

  • Parallelism is a big research area in computer science today.

Increasing the width of the data bus

  • We already know that the data bus is used to carry data to and from the processor.

  • Each cycle of the fetch-execute cycle requires data to be moved along the data bus.

  • Increasing the width of the data bus, increases the amount of data that can be transported in a single cycle.

Cache memory

  • Cache memory is a small amount of fast accessible memory usually on the same chip as the processor.

  • The processor will check cache for data before accessing the main memory.

  • If it finds data or an instruction, this is known as a cache ‘hit’, resulting in improved performance. If the instruction is not present, then a cache ‘miss’ occurs and a slower main memory is accessed. 

  • Many computers use multiple levels of cache, with small caches backed up by larger, slower caches. 

Cache memory

  • There are different levels of cache memory:

Level Description
L1 In the processor core, generally around about 64KB
L2 Generally attached to the core, around about 256KB per core 
L3 Generally shared between all cores, between 4MB and 32MB
  • The processor always checks the fastest cache first. If the hit is not found it goes to the next fastest level and so on.

  • Cache memory is used to store frequently used data and instructions.

Clock speed

  • Clock speed is the measure of how many instruction cycles the system can work through within one second.

  • Clock pulses are used to trigger components to take their next step.

  • The higher the clock speed, the faster the computer can complete a set of instructions.

Clock speed - overclocking

  • It is possible with some CPUs (for example Intel K series CPUs and all AMD Ryzen CPUs) to push them passed their set clock speed. 

  • This is called overclocking.

  • The stability of a system can suffer as the clock speed gets higher, and since power consumption is directly proportional to the frequency the power draw can increase. Often overclockers tend to overvolt the system as well as overclock it to improve stability.

Past Paper Questions

Increasing clock speed is one method of improving processor performance.

 

a) State one other method of improving processor performance.

1 mark

b) Explain how your answer to part (a) improves performance

1 mark

2021 Q2 (a) & (b)

  1. Increasing the number of cores: multiple instructions can be processed simultaneously   
  2. Increasing the width of the data bus: more bits can be transferred in a single operation
  3. Increasing cache memory size: reduces the number of memory operations to slower memory

Remember

System Performance questions come up almost every year in the exam.

Make sure you know what can improve it and how it improves it

Try the following:

  1. SQP Q11 (a), (b)
  2. 2016 Q13 (c)
  3. 2017 Q15 (b) (i)
  4. 2018 Q9 (a), (b)
  5. 2021 Q2
  6. 2022 Q4

Past paper questions

Presentation Overview
Close
JB
Computer Structure
© 2020 - 2024 J Balfour
09:43 | 29-04-2024
Join Live Session
Start Remote
Save Progress
Slideshow Outline
Presenter Mode
Widget Screen
Canvas Controls
Random Selector
Timer
Volume Meter
Binary Converter
Python Editor
Show Knox 90
Provide Feedback
Help
!
Keywords
    DragonDocs Management
    Random selector
    Sections
      Binary conversion
      Denary to binary conversion
      Binary to denary conversion
      Feedback 👍
      Accessibility

      Apply a filter:

      ×
      All slideshow files