Overview of the chapter
This chapter is the further extension of “Computer Architecture” in IGCSE.
This is a small chapter. Mr. Luke finished all of it in just one double-period!
|5.1 Von Neumann Architecture||5.1.1 Structure Overview||2|
|5.2.2 CPU Architecture|
-> Control Unit
-> Control Bus
-> Data Bus
-> Address bus
|5.2 Fetch-execute cycle||4|
|5.3 Interrupt Handling||5|
Next page: 5.1 Von Neumann Architecture
5.1 Von Neumann Architecture
The Architecture requires the following characteristics:
- Has a center processing unit
- Has direct access to memory
- Executes instructions in sequence
- Stores stored programs and data required. They are stored in same memory and treated the same.
5.1.2 Processor Structure
The processor consists of two sections:
CPU (purple) and
Central Processing Unit
Consists of two components: Control Unit and ALU.
|Functions||1. Control flow of data through processor — and whole computer.||1. Handles any Arithmetic / Logic processing operation.|
|2. Synchronize actions of the processor.|
Consists of two clocks to synchronize processes.
– The internal clock controls cycle of activities within processor
– The system clock controls activities outside the processor
The clocks have defined frequency called clock speed. It defines the minimum period of time that separates successive activities in the system.
(For example, for a 1MHz CPU, there can be only max. 1 million operations per second.)
|3. Decodes instructions for execution.|
5.2 Fetch-decode-execute cycle (-> Page 4)
Registers are storage components. Their proximity to ALU provides fast access speed.
There are two types of register: General-purpose and Special-Purpose.
The accumulator is the only type of general-purpose register.
Next page: 5.1.3 Busses
Parallel, synchronized transmission device. It allows data transmission in CPU, with I/O and memory.
The number of bytes handled as a unit is called a word. Ideally the bus width should be same as word length — during the transmission each wire in the bus carries a bit for parallel transmission.
|Address Bus||Data Bus||Control Bus|
(For some systems data from I/O
can be written into memory directly)
|Carries||An address||Data: |
* Address or
* A value.
|* Control signals|
* Timing signals for sync.
USB: Universal Serial Bus
Serial, not synced, bi-directional data transmission.
- Shows the plug-and-play concept
- A hierarchy of connection is supported, max. 127 devices.
- Device can be attached / detached while device is on.
- Drivers can be automatically installed for use
- Current standard USB 3.0
Next page: 5.2 Fetch-decode-execute cycle
5.2 Fetch-decode-execute cycle
This diagram describes how the cycle works.
The fetch-decode-execute cycle does normal operation.
After each cycle it checks for any interrupts. If there is any, the system will handle it.
This is a summary of the registers used in the cycle. We will look at them one by one in detail.
5.2.1 Fetch Cycle
|1. Program Counter||PC||Stores the address of next instruction|
|2. Index Register||IX||Stores the amount PC will increment after the cycle — for the next data address.|
|3. Memory Address Register||MAR||Stores the address of a memory that is going to be read / write from|
|4. Memory Data Register||MDR||Stores the data of a memory that |
* Is going to be written into memory
* Has just been read from the memory
Here is a trace table of fetching the information from address 101. The information stored in address 101 is a command “LDA 111”.
for understanding only
|PC data||IX data||MDR data||MAR data||CIR data|
|0: PC stores address of next instruction||101||14|
|1: Address is transferred to MDR||101||14||101|
|2: The control unit sends command to RAM for reading data |
through control bus.
The address stored in MDR is sent to RAM through data bus.
|Steps 3.1 and 3.2 happens simultaneously;|
3.1: The RAM sends data stored in that memory address to MAR.
Or usually, 3.1 is combined with step 2:
Note the double brackets!
|3.2: The PC is incremented for next instruction||115||14||LDA 111||101|
|4: [For commands only]|
The command is sent from MDR to CIR for next stage: Decode.
|115||14||LDA 111||101||LDA 111|
5.2.2 Decode cycle
If the data fetched is a commend, then it is sent and stored in CIR.
The control unit then decodes it. The ALU will be activated for any arithmetic / logic calculations.
|1. Current Instruction Register||CIR||Stores current instruction for decoding and execution.|
5.2.3 Execute cycle
Main article: Chapter 6, Assembly language programing
If the data requires calculation, then it is executed in the ALU unit.
(The only General-purpose register)
|ACC||Stores the value before and after ALU operation.|
5.2.4 Other registers
|1. Status Register||SR||Contains a combination of bits to indicate results, e.g.|
b) Carry bit
c) Interrupt received
Next page: 5.3 Interrupts
A signal sent to the processor, seeking for its attention.
Different interrupts have different priorities. Interrupt is only detected at the end of fetch-execute cycle by checking status register.
After detection of interrupt the interrupt service routine (ISR) is initiated. Its start address is loaded into PC, and a fetch-decode-execute cycle for the ISR will be started.
After handling all interrupts the original program is reloaded into the registers, and the original program is resumed.
Examples of interrupts
- Fatal Error
- User interrupt (Ctrl + Alt + Del)
- Timer signal
- Hardware fault
- Request of I/O to begin
- Paper jam