Unit 4: Computer organization
Computer Architecture notes · PTU syllabus (UGCC2502)
On this page
Unit summary
A computer is a system of processor, memory and input–output units working together under a stored program. This unit introduces computer and CPU organisation, the stored program concept, the Von Neumann and Harvard architectures, RISC and CISC, register transfer and micro-operations, instruction formats (memory reference, register reference and I/O) and the common bus system with data, control and address buses.
After this unit you can
- Describe the functional units of a computer and the organisation of the CPU
- Explain the stored program concept and compare Von Neumann and Harvard architectures
- Compare RISC and CISC
- Write register transfer statements and perform micro-operations
- Describe instruction formats and the common bus system
PTU syllabus topics
- Introduction to computer and CPU organization
- stored program concept
- Von Neumann and Harvard architectures
- RISC and CISC architecture
- register transfer and micro-operations
- instruction formats (memory reference, register reference, I/O instructions)
- common bus system — data
- control and address buses
Topic 1
Computer and CPU organisation
- 1Input unit
Keyboard, mouse, sensors — data and instructions enter
- 2Memory unit
Stores programs and data
- 3CPU
Control unit and ALU process the data
- 4Output unit
Display, printer
- 5Secondary storage
Disk and SSD
Instructions and data travel between the units on buses; the control unit directs every unit
Control unit
Fetches and decodes instructions, issues control signals
Arithmetic logic unit (ALU)
Arithmetic and logic operations
Registers
Fast storage inside the CPU
Internal buses and clock
Move data and synchronise
Important CPU registers
| Function | |
|---|---|
| Program counter (PC) | Holds the address of the next instruction |
| Instruction register (IR) | Holds the instruction being executed |
| Memory address register (MAR / AR) | Address of the memory location to access |
| Memory data register (MDR / DR) | Data read from or to be written to memory |
| Accumulator (AC) | Holds ALU operands and results |
| Status (flag) register | Carry, zero, sign, overflow flags |
| Stack pointer (SP) | Top of the stack |
| General-purpose registers | Temporary data and addresses |
- 1
Fetch — PC gives the address, instruction is read into IR, PC is incremented
- 2
Decode — control unit interprets the opcode
- 3
Fetch operands if needed
From memory or registers
- 4
Execute — ALU or data transfer
- 5
Store the result
- 6
Check for interrupt and repeat
Single accumulator
One accumulator
Early machines, 8085
General register
Many registers
x86, ARM, MIPS
Stack
Stack — zero-address
JVM, calculators
Example
One fetch cycle: the program counter (PC) holds 100. The address goes to the memory address register (MAR ← PC). The instruction at address 100 is read into the instruction register (IR ← M[MAR]). The PC is increased to 101. The control unit then decodes and executes the instruction.
Topic 2
Stored program concept, Von Neumann and Harvard architectures
Stored program concept: both the instructions and the data are stored in the same read-write memory as binary numbers, so a program can be loaded, changed and run without rewiring the machine. The CPU fetches instructions one after another using the program counter.
- 1
Program and data are loaded into memory
- 2
PC is set to the first instruction address
- 3
Fetch the instruction from memory
- 4
Decode and execute
- 5
PC points to the next instruction (or a branch target)
- 6
Repeat until halt
Von Neumann architecture
Instructions and data share the same memory and bus, so they cannot be fetched at the same moment
Harvard architecture
Separate memories and buses let the CPU fetch an instruction while reading or writing data
Memory
One memory for instructions and data
Separate instruction and data memories
Buses
Single set
Separate buses for each
Speed
Von Neumann bottleneck — one access at a time
Faster — parallel access
Cost and complexity
Simple, cheaper
More hardware
Flexibility
Program can modify itself
Instructions are protected
Used in
General-purpose PCs
DSPs, microcontrollers (AVR, PIC), cache split in modern CPUs
Exam tip
Modern processors use a modified Harvard design — separate instruction and data caches but a single main memory.
Example
Where each is used: a desktop PC follows the Von Neumann design, with programs and data in the same memory, which is simple and flexible. Many microcontrollers and digital signal processors use the Harvard design, with separate program and data memories, so an instruction and its data can be fetched at the same time.
Exam tip
The Von Neumann bottleneck: instructions and data share one bus, so the CPU waits on memory.
Topic 3
RISC and CISC
RISC and CISC are two approaches to designing a processor's instruction set. RISC uses a small set of simple instructions that each run in one clock cycle. CISC uses a large set of complex instructions, some of which do several operations at once.
Instructions
Few, simple, fixed length
Many, complex, variable length
Execution
Mostly one clock cycle
Several clock cycles
Addressing modes
Few
Many
Memory access
Only LOAD and STORE instructions
Most instructions can access memory
Registers
Large register file
Fewer registers
Control unit
Hardwired (fast)
Micro-programmed
Pipelining
Easy and efficient
Difficult
Program size
Larger
Smaller
Examples
ARM, MIPS, RISC-V, SPARC
Intel x86, VAX, Motorola 68000
CPU time
CPU time = Instruction count × CPI × Clock cycle time
RISC
Larger instruction count but CPI close to 1
CISC
Smaller instruction count but higher CPI
- RISC
- Mobile phones, embedded systems, servers (ARM, RISC-V)
- CISC
- Desktop and laptop PCs (x86)
- Modern trend
- CISC chips translate instructions into RISC-like micro-operations inside
Example
Multiplying two numbers in memory: a CISC processor may do it with one instruction, MULT A, B, which loads both values, multiplies and stores the result. A RISC processor uses four simple instructions: LOAD R1, A; LOAD R2, B; MUL R1, R2; STORE A, R1. More instructions, but each is fast and easy to pipeline.
Exam tip
ARM processors in mobile phones are RISC. Intel x86 processors in most PCs are CISC.
Topic 4
Register transfer and micro-operations
A micro-operation is an elementary operation on data stored in registers. Register Transfer Language (RTL) describes them symbolically. Register transfer notation
| Meaning | |
|---|---|
| R2 ← R1 | Copy the contents of R1 into R2 |
| P: R2 ← R1 | Transfer only if the control condition P = 1 |
| R1 ← R1 + R2 | Add and store in R1 |
| AR ← PC | Transfer between registers |
| DR ← M[AR] | Memory read — word at address AR goes to DR |
| M[AR] ← DR | Memory write |
| R2 ← R1, R1 ← R2 | Simultaneous exchange (same clock pulse) |
Register transfer
Move data between registers
Arithmetic
Add, subtract, increment, decrement, complement
Logic
AND, OR, XOR, complement, clear, selective set or clear
Shift
Logical, circular, arithmetic
Bus transfer using multiplexers
Select lines S1 S0 = 00, 01, 10, 11 connect R0, R1, R2, R3 to the bus; one MUX per bit gives a multi-bit bus
Arithmetic micro-operations
Addition
R3 ← R1 + R2
Sum of R1 and R2
Subtraction
R3 ← R1 + R2′ + 1
2's complement subtraction
Increment
R1 ← R1 + 1
Add one
Decrement
R1 ← R1 − 1
Subtract one
Complement
R1 ← R1′
1's complement
Negate
R1 ← R1′ + 1
2's complement
Logic micro-operations
| Operation | Symbolic | R1 = 1100, R2 = 1010 gives |
|---|---|---|
| AND (mask) | R1 ← R1 ∧ R2 | 1000 |
| OR (selective set) | R1 ← R1 ∨ R2 | 1110 |
| XOR (selective complement) | R1 ← R1 ⊕ R2 | 0110 |
| Complement | R1 ← R1′ | 0011 |
| Clear | R1 ← 0 | 0000 |
Shift micro-operations
| Shift | Symbolic | R = 1011 becomes |
|---|---|---|
| Logical shift left | shl R | 0110 (0 enters at the right) |
| Logical shift right | shr R | 0101 (0 enters at the left) |
| Circular shift left (rotate) | cil R | 0111 |
| Circular shift right | cir R | 1101 |
| Arithmetic shift right | ashr R | 1101 (sign bit kept) |
| Arithmetic shift left | ashl R | 0110 (overflow — sign changed) |
- Shift left
- Multiplies a binary number by 2
- Shift right
- Divides by 2 (arithmetic shift keeps the sign)
- Rotate
- Moves bits without loss
- Serial transfer
- Moving data through a shift register
Example
Reading RTL: R2 ← R1 copies the contents of R1 into R2; R1 is unchanged. P: R2 ← R1 does so only when control signal P is 1. R3 ← R1 + R2 is an arithmetic micro-operation. R1 ← shl R1 shifts left: 0011 (3) becomes 0110 (6).
Topic 5
Instruction formats
An instruction has an opcode (operation) and operands (addresses or data). Instruction formats by number of addresses (X = (A + B) × (C + D))
| Program | |
|---|---|
| Three-address | ADD R1, A, B ; ADD R2, C, D ; MUL X, R1, R2 |
| Two-address | MOV R1, A ; ADD R1, B ; MOV R2, C ; ADD R2, D ; MUL R1, R2 ; MOV X, R1 |
| One-address (accumulator) | LOAD A ; ADD B ; STORE T ; LOAD C ; ADD D ; MUL T ; STORE X |
| Zero-address (stack) | PUSH A ; PUSH B ; ADD ; PUSH C ; PUSH D ; ADD ; MUL ; POP X |
Addressing modes
| Operand found… | |
|---|---|
| Immediate | In the instruction itself |
| Direct | At the address given in the instruction |
| Indirect | The instruction address holds the address of the operand |
| Register | In a CPU register |
| Register indirect | Register holds the operand's address |
| Indexed | Address = address field + index register |
The basic computer instruction format (16-bit)
| Bit 15 | Bits 14–12 | Bits 11–0 |
|---|---|---|
| I | Opcode (3 bits) | Address (12 bits) |
Memory-reference
Opcode 000 to 110; I = 0 direct, I = 1 indirect; 12-bit address
AND, ADD, LDA, STA, BUN, BSA, ISZ
Register-reference
Opcode 111 and I = 0; bits 11–0 select one register operation
CLA, CMA, CIR, CIL, INC, HLT
Input–output
Opcode 111 and I = 1; bits 11–0 select one I/O operation
INP, OUT, SKI, SKO, ION, IOF
- 1Look at bits 14–12
- 2If not 111 — memory-reference instruction
- 3If 111, look at bit 15 (I)
- 4I = 0 — register-reference instruction
- 5I = 1 — input–output instruction
Memory-reference instructions
| Operation | |
|---|---|
| AND | AC ← AC ∧ M[AR] |
| ADD | AC ← AC + M[AR], carry to E |
| LDA | AC ← M[AR] |
| STA | M[AR] ← AC |
| BUN | PC ← AR (branch unconditionally) |
| BSA | M[AR] ← PC, PC ← AR + 1 (branch and save return address) |
| ISZ | M[AR] ← M[AR] + 1; skip next instruction if zero |
Example
The 16-bit code 0001 0000 0000 0100 has I = 0, opcode 001 (ADD) and address 004: it adds the word at address 4 to the accumulator.
Topic 6
Common bus system
Registers and memory exchange data over a shared set of wires called the bus; a control signal decides which register places data on it.
Memory, AR, PC, DR, AC, IR, TR and OUTR connect to one bus; the selection lines S2 S1 S0 pick the register that drives the bus
| S2 S1 S0 | Register placed on the bus |
|---|---|
| 0 0 0 | None |
| 0 0 1 | AR |
| 0 1 0 | PC |
| 0 1 1 | DR |
| 1 0 0 | AC |
| 1 0 1 | IR |
| 1 1 0 | TR |
| 1 1 1 | Memory |
Data bus
Bidirectional; carries data; width = word size (8, 16, 32, 64 bits)
Address bus
Unidirectional from CPU; carries the memory address; width decides memory size (n lines = 2ⁿ locations)
Control bus
Carries read, write, clock, interrupt and reset signals
Data bus vs address bus vs control bus
| Data bus | Address bus | Control bus | |
|---|---|---|---|
| Direction | Both ways | From CPU to memory and I/O | Both ways, mostly from CPU |
| Carries | Data and instructions | Memory or port address | Timing and command signals |
| Width decides | Word size | Memory size | Number of control functions |
- Memory read
- AR gives the address; read signal; data appears on the data bus and enters DR
- Memory write
- Address on the address bus; data from DR; write signal
- Tri-state buffers
- Let many registers share one bus; only the selected one drives it
- 16-bit address lines
- Address 2¹⁶ = 64 K locations
- Bus conflict
- Two registers driving the bus at once — prevented by the selection lines
Example
A system with a 16-bit address bus can address 2¹⁶ = 65,536 memory locations; with a 32-bit address bus 2³² = 4 GB of byte-addressable memory.
Key terms
- Stored program concept
- Instructions and data are kept in the same memory
- Von Neumann architecture
- One memory and bus for instructions and data
- Harvard architecture
- Separate memories and buses for instructions and data
- RISC
- Reduced instruction set computer with simple fixed-length instructions
- CISC
- Complex instruction set computer with many powerful instructions
- Register transfer language
- Symbolic notation for micro-operations
- Micro-operation
- Elementary operation on register contents
- Opcode
- Part of an instruction that specifies the operation
- Bus
- Common set of wires shared by units
Quick revision
- CPU = control unit + ALU + registers; instruction cycle = fetch, decode, execute.
- Stored program: instructions and data share memory; Von Neumann has one bus (bottleneck), Harvard has separate memories and buses.
- RISC: simple, fixed length, load/store, pipelined; CISC: complex, variable length, many addressing modes.
- RTL: R2 ← R1; P: R2 ← R1; DR ← M[AR].
- Micro-operations: transfer, arithmetic, logic, shift.
- Basic computer format: I (1 bit), opcode (3 bits), address (12 bits); opcode 111 for register/I-O.
- Buses: data (bidirectional), address (unidirectional), control; select lines pick the register for the common bus.
Important exam questions
Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).
Short-answer questions
- Q1.State the stored program concept.
- Q2.Differentiate between Von Neumann and Harvard architectures.
- Q3.What is the Von Neumann bottleneck?
- Q4.Name any four CPU registers and their functions.
- Q5.Differentiate between RISC and CISC.
- Q6.What is a micro-operation?
- Q7.Explain the RTL statement P: R2 ← R1.
- Q8.Perform a circular left shift on 1011.
- Q9.Write the format of a memory-reference instruction.
- Q10.How is a register-reference instruction identified?
- Q11.Name the three types of buses.
- Q12.How many locations can a 16-bit address bus address?
Long-answer questions
- Q1.Explain the organisation of a computer and the CPU with the instruction cycle.
- Q2.Explain the stored program concept and compare Von Neumann and Harvard architectures.
- Q3.Compare RISC and CISC architectures in detail.
- Q4.Explain register transfer and the types of micro-operations with examples.
- Q5.Explain the instruction formats of the basic computer and the number of addresses in instructions.
- Q6.Explain the common bus system with the data, address and control buses.
Stuck on this unit?
Message SBS on WhatsApp for help with Computer Architecture, or to ask about studying BCA at Synetic.
