CIE IGCSE | 3.1.2 Components of the CPU

Lesson objective

Identify CPU units, registers and buses in Von Neumann architecture, and trace how they work together during fetch, decode and execute.

Learn

3.1.2 | COMPONENTS OF THE CPU

01 | A STORED-PROGRAM COMPUTER

In Von Neumann architecture, program instructions and data are stored in the same main memory. The CPU obtains instructions from memory and carries them out.

Think of memory as numbered locations. An address identifies a location; its contents are the value held there. Address 20 and the value 42 stored at address 20 are different things.

Simplified Von Neumann architectureThe CPU contains the control unit, arithmetic logic unit and registers. Main memory stores both instructions and data. The address bus goes from CPU to memory; the data bus carries values both ways; the control bus carries control and status signals.CPUCONTROL UNITDecodes • coordinatesALUArithmetic • logicREGISTERS: tiny, fast internal storagePC: next instruction addressMAR: address for a memory accessMDR: value moving to / from memoryCIR: current instructionACC: working value / resultMAIN MEMORY (RAM)INSTRUCTIONS + DATAin the same memoryAddress 100: LOAD 20Address 101: ADD 21Address 20: 42Address 21: 8Illustrative memory contentsADDRESS BUS →DATA BUS ↔CONTROL BUS ↔
Addresses select locations; the data bus carries instructions as well as data. Control signals coordinate the transfer. Internal connections and input/output circuitry are omitted for clarity.

The readable instructions in this diagram are teaching labels. Real instructions are stored as binary machine code. The CPU interprets a value according to how the program uses it.

02 | THE CONTROL UNIT AND ALU

Units perform operations; registers hold values
UnitJobExample
Control unit (CU)Decodes instructions and coordinates their execution; sends control signalsRequests a memory read and directs the required transfers
Arithmetic logic unit (ALU)Carries out arithmetic and logical operationsAdds two values or performs a comparison

The control unit is not where all program data is stored. The ALU is not a permanent file store. Separate doing a job from holding a value.

03 | FIVE REGISTERS, FIVE DISTINCT JOBS

Registers are small, fast storage locations inside the CPU
RegisterFull nameWhat it holdsMemory aid
PCProgram counterAddress of the next instruction to fetchNEXT instruction
MARMemory address registerAddress of the location being accessedWHERE in memory
MDRMemory data registerInstruction or data being transferred to/from memoryWHAT is moving
CIRCurrent instruction registerInstruction currently being decoded/executedCURRENT instruction
ACCAccumulatorWorking values and results in this simplified CPUWORKING result

The PC is an address, not the instruction itself. The MAR is also an address, but it can select an instruction or a data location. The MDR can contain either an instruction or operand data.

Copying a value does not automatically erase the source register. If PC 100 is copied into MAR, the MAR now contains 100 and the PC still contains 100 until another step updates it.

04 | THE THREE BUSES

A bus is a communication pathway, not a storage location
BusWhat travelsDirection in this model
Address busAddress selecting a memory or input/output locationFrom CPU towards the addressed component
Data busInstructions and data valuesBoth ways between CPU and memory / input-output
Control busSignals such as read, write and statusSignals can travel in different directions

For a read, the CPU places the MAR address on the address bus and sends a read signal. Memory returns the selected contents on the data bus into MDR.

For a write, the address still selects the location, but the value travels from the CPU towards memory. Control signals tell the components which operation to perform.

05 | SEE THE COMPLETE CYCLE

Fetch, decode, execute cycleFetch the instruction from memory, decode it using the control unit, then execute the operation. Repeat for the next instruction.1. FETCHPC → MARMemory → MDR → CIR2. DECODECU interpretsthe instruction in CIR3. EXECUTECarry out the operationMay access data in memoryRepeat: fetch the next instruction
Instruction fetch and operand access are different memory operations. Not every instruction performs arithmetic or changes the accumulator.

Fetch: obtain an instruction. Decode: the CU determines the operation and any operand information. Execute: carry out that operation, which may require another memory access.

The PC advances for the next instruction during this teaching fetch sequence. A jump or branch can later replace it with a different address. Here we use one memory location per instruction, so advancing means adding 1.

06 | WALK THROUGH LOAD 20

Start with PC = 100. At memory address 100 is the instruction LOAD 20, meaning “copy the value at address 20 into ACC”. At address 20 the value is 42.

Prediction: the final accumulator should hold 42, not 20 and not 100. Use Next step to watch which register changes.

PC100
MARNot set
MDRNot set
CIRNot set
ACC0

START | BEFORE FETCH

PC identifies the next instruction at address 100. Press Next step.

No transfer yet.

Step 0 of 9

This model uses symbolic instructions and an illustrative sequential order, not clock-accurate hardware. Registers marked “Not set” have no relevant value supplied for this example. Previous step replays the model, rather than reversing a real CPU.

07 | TRACE THE REGISTER CHANGES

Arrows indicate copying / assignment; brackets mean contents at an address
StageTransfer / operationWhy it happens
FetchMAR ← PC (100)Select the next instruction location
FetchMDR ← memory[100] (LOAD 20)Read the instruction into CPU
FetchCIR ← MDR (LOAD 20)Keep the current instruction
FetchPC ← PC + 1 (101)Prepare the sequential next instruction address
DecodeCU interprets LOAD 20 in CIRDetermine operation and operand address
ExecuteMAR ← 20Select the data location named by the instruction
ExecuteMDR ← memory[20] (42)Read the operand value
ExecuteACC ← MDR (42)Carry out the LOAD operation
EndNext cycle starts from PC 101Fetch the following instruction

At the end, CIR still holds LOAD 20 while MDR holds 42. That is why the instruction needs its own register: the MDR can be reused for operand transfers.

08 | WHAT WOULD ADD 21 DO NEXT?

At address 101 is ADD 21. A new fetch puts 101 into MAR, reads ADD 21 into MDR and then CIR, and advances PC to 102.

During execution, the CPU reads address 21, whose contents are 8. The ALU adds that operand to the accumulator: 42 + 8 = 50. ACC holds the result.

LOAD copies a value; ADD performs arithmetic. Not every execute stage is an addition, and not every instruction needs to read a separate operand from memory.

09 | UNSTICK THE CONFUSING PARTS

  • Address versus contents: MAR = 20 selects a location; MDR = 42 holds its returned contents.
  • PC versus CIR: PC points to the next instruction; CIR holds the current one.
  • MAR versus MDR: address selects; data moves.
  • Fetch versus execute: first fetch the instruction, then perform its operation, possibly reading operand data.
  • CU versus ALU: CU directs and decodes; ALU performs arithmetic and logic.
  • Data bus: it carries instruction values too, despite its name.

MATCH THE PROCESSING ROLE

Terminology

Terminology

Von Neumann architecture

A stored-program architecture with instructions and data in the same main memory.

Control unit (CU)

Decodes instructions and coordinates their execution using control signals.

ALU

Arithmetic logic unit: performs arithmetic and logical operations.

Register

A small, fast storage location inside the CPU.

PC

Program counter: holds the address of the next instruction to fetch.

MAR

Memory address register: holds the address of the location being accessed.

MDR

Memory data register: holds instructions or data transferred to/from memory.

CIR

Current instruction register: holds the instruction being decoded and executed.

ACC

Accumulator: holds working values and results in this model.

Address bus

Carries addresses from CPU to the selected memory or input/output location.

Data bus

Carries instructions and data in either direction.

Control bus

Carries signals that coordinate operations and report status.

Questions

Questions

CHECK YOUR UNDERSTANDING

Select all correct choices. Each exact set earns one point.

1. Which is a defining stored-program feature?
2. Which register holds the next instruction address?
3. Which statements about MAR and MDR are correct?
4. Which tasks belong to the CU?
5. Which bus carries instruction values from memory?
6. After LOAD 20 reads value 42 from address 20, what does ACC hold?
7. Why copy the instruction into CIR before reusing MDR?
8. Which statements are correct in this example?

EXPLAIN AND COMPARE

Write your answers before revealing each sample.

1. Describe Von Neumann architecture.

2. Compare the roles of MAR and MDR.

3. Explain why CIR is needed as well as MDR.

4. Describe the fetch stage in the lesson model.

5. Explain how LOAD 20 results in ACC holding 42.

6. Compare the jobs of the CU and ALU during ADD 21.

TRACE IT | CHANGE THE DATA

Keep LOAD 20 at address 100, but change the contents of address 20 from 42 to 17. Predict the final values of PC, MAR, MDR, CIR and ACC.

Reveal suggested trace

PC = 101; MAR = 20; MDR = 17; CIR = LOAD 20; ACC = 17. Changing operand data does not change the instruction address or its meaning.

Flashcards

Flashcards

Click to flip. Select the ideas you need to revisit.

0 cards selected for revision.

    Selections are kept while this page is open.

    Workbook

    Workbook

    COMING SOON

    The workbook for 3.1.2 Components of the CPU is coming soon. Complete the matching task and written questions in your exercise book.