This chapter covers Computer Architecture from the 1st Year (ICS Part-I) Computer Science syllabus of the Punjab Curriculum and Textbook Board (PTB/PCTB). It explains bus interconnection, the I/O unit, CPU registers, computer operations and the instruction cycle, the instruction format, software and language translators. These notes are prepared by freebooks.pk.
Computer architecture describes how the internal parts of a computer are organised and how they work together to carry out instructions. This chapter looks inside the machine.
Learning Objectives
- Describe the system buses and their functions.
- Explain the role of the I/O unit and CPU registers.
- Describe the instruction (fetch-decode-execute) cycle.
- Explain the instruction format.
- State the purpose of system software.
- Describe the functions of language translators.
Key Concepts
Bus Interconnection
The parts of a computer, the CPU, memory and input/output units, are connected by groups of parallel wires called buses, along which data and signals travel. There are three main buses. The data bus carries the actual data between the CPU, memory and devices. The address bus carries the address of the memory location or device that the CPU wants to use, and works in one direction only. The control bus carries the control and timing signals that coordinate all the activities, such as read and write commands.
The Input/Output Unit
The input/output (I/O) unit connects the computer to the outside world, allowing input devices to send data into the computer and output devices to receive results from it. Because devices work at different speeds from the CPU, the I/O unit contains interfaces and buffers that hold data temporarily and match the speeds, so that the fast CPU is not held up waiting for slow devices.
CPU Registers
Registers are very small, very fast storage locations inside the CPU that hold data and instructions during processing. Important registers include the program counter (PC), which holds the address of the next instruction; the instruction register (IR), which holds the instruction currently being executed; the memory address register (MAR), which holds the address of the memory location to be accessed; the memory data register (MDR), which holds the data being transferred to or from memory; and the accumulator, which stores the results of arithmetic and logic operations.
Computer Operations and the Instruction Cycle
A computer runs a program by carrying out its instructions one after another in a repeating sequence called the instruction cycle or machine cycle, which has three steps. In the fetch step the next instruction is brought from memory into the CPU. In the decode step the control unit works out what the instruction means. In the execute step the instruction is carried out, for example by the ALU performing a calculation. The cycle then repeats for the next instruction until the program ends.
Instruction Format
Every machine instruction is made up of two parts. The operation code (opcode) tells the CPU what operation to perform, such as add, subtract, load or store. The operand (or address part) tells the CPU what data to use or where in memory to find it. Together the opcode and operand make up the instruction in a fixed pattern called the instruction format, which the control unit decodes.
Software and the Operating System
Software is the set of programs that make the hardware useful. The most important system software is the operating system, which starts the computer, manages the memory, files and devices, runs the user’s programs and provides the interface between the user and the machine. Without an operating system the hardware could not be used conveniently.
Language Translators
Programs are usually written in a language that people can understand, but the computer can only run machine code (0s and 1s). Language translators are system programs that convert a program from one form to another. An assembler translates assembly language into machine code. A compiler translates a whole high-level language program into machine code at once, producing a file that can be run. An interpreter translates and runs a high-level program one statement at a time. These translators make programming in convenient languages possible.
Important Definitions
Bus
A group of parallel wires that carries data or signals between parts of the computer.
Data bus
The bus that carries data between the CPU, memory and devices.
Address bus
The bus that carries the address of a memory location or device.
Control bus
The bus that carries control and timing signals.
Register
A small, fast storage location inside the CPU.
Instruction cycle
The repeating fetch-decode-execute sequence.
Opcode
The part of an instruction that says which operation to perform.
Compiler
A translator that converts a whole high-level program into machine code.
Key Facts & Rules
| Item | Detail |
|---|---|
| Three buses | Data bus, Address bus, Control bus |
| Instruction cycle | Fetch -> Decode -> Execute |
| Instruction format | Opcode + Operand |
| Program counter (PC) | Holds the address of the next instruction |
| Accumulator | Holds results of arithmetic/logic operations |
| Compiler | Translates whole program at once |
| Interpreter | Translates and runs one statement at a time |
Diagrams & Illustrations
System buses: the CPU, memory and I/O unit connected by the address bus, data bus and control bus.

Fetch-decode-execute cycle: the instruction cycle repeating through the fetch, decode and execute steps.

Language translators: a source program passed through a translator (assembler, compiler or interpreter) to produce machine code.

Solved Examples & Practice
Identify the bus
When the CPU sends the location of a memory cell it wants to read, it uses the address bus; the value read comes back on the data bus.
Order the cycle
The correct order of the instruction cycle is fetch, then decode, then execute.
Parts of an instruction
In the instruction ADD 20, ‘ADD’ is the opcode and ’20’ is the operand.
Choose the translator
To run a C program by first converting the whole program into an executable file, a compiler is used; to run it line by line, an interpreter is used.
Short Questions & Answers
Name the three system buses.
The data bus, the address bus and the control bus.
What is the function of the address bus?
It carries the address of the memory location or device that the CPU wants to access.
What is a register?
A small, very fast storage location inside the CPU used to hold data and instructions during processing.
State the three steps of the instruction cycle.
Fetch the instruction, decode it, then execute it.
What are the two parts of a machine instruction?
The opcode (the operation to perform) and the operand (the data or its address).
Differentiate a compiler and an interpreter.
A compiler translates the whole high-level program into machine code at once; an interpreter translates and runs it one statement at a time.
Long Questions & Answers
Q1: Describe the system buses and the CPU registers of a computer.
Inside a computer the main units, the central processing unit (CPU), the memory and the input/output units, are joined together by sets of parallel wires called buses, which carry data and control signals from one part to another. There are three principal buses. The data bus carries the actual data or instructions being transferred between the CPU, the memory and the input/output devices, and it works in both directions because data must be able to travel to and from the CPU. The address bus carries the address, that is, the number identifying the particular memory location or device that the CPU wishes to use; it works in one direction only, from the CPU outwards, and the more lines it has, the more memory the computer can address. The control bus carries the control and timing signals that coordinate all the operations of the computer, such as the signals that tell memory whether to perform a read or a write. In addition to the buses, the CPU itself contains a small number of very fast storage locations called registers, which hold data and instructions while they are being processed. The program counter (PC) holds the address of the next instruction to be fetched; the instruction register (IR) holds the instruction currently being executed; the memory address register (MAR) holds the address of the memory location that is to be read from or written to; the memory data register (MDR) holds the data on its way to or from memory; and the accumulator stores the results produced by the arithmetic and logic unit. These registers, being inside the CPU, are far faster than main memory and are essential to the smooth running of the machine.
Q2: Explain the instruction (fetch-decode-execute) cycle and the instruction format.
A computer carries out a program by executing its machine instructions one after another, and the sequence of steps it repeats for every instruction is called the instruction cycle or machine cycle. The cycle has three basic stages. In the fetch stage, the control unit uses the address in the program counter to bring the next instruction from memory into the instruction register, and the program counter is then increased so that it points to the following instruction. In the decode stage, the control unit examines the instruction in the instruction register and works out what operation is required and what data it involves. In the execute stage, the operation is actually performed: this may involve the arithmetic and logic unit carrying out a calculation, or data being moved between registers and memory. After the execute stage the cycle begins again with the next instruction, and this continues until the program is finished. For the control unit to be able to decode an instruction, every machine instruction is arranged in a fixed pattern called the instruction format, which has two parts. The first part is the operation code, or opcode, which specifies the operation to be carried out, such as add, subtract, load or store. The second part is the operand, or address part, which specifies the data to be used or the memory address where that data is to be found. By reading the opcode the control unit knows what to do, and by reading the operand it knows what to do it to.
Q3: Explain the purpose of system software and describe the functions of language translators.
Hardware on its own can do nothing useful; it needs software, the set of programs that tell it what to do. The most important kind of software is system software, and in particular the operating system, which is the master control program of the computer. The operating system starts the computer when it is switched on, manages the main memory and decides where programs and data are placed, controls the input and output devices, organises files on the disk, loads and runs the user’s application programs, and provides the interface through which the user gives commands to the machine. Without an operating system, an ordinary user could not conveniently use the hardware at all. Another essential group of system programs are the language translators, which are needed because programmers write their programs in languages that are convenient for people, such as high-level languages or assembly language, whereas the computer can only actually execute machine code made up of 0s and 1s. A translator converts a program from the form the programmer wrote into machine code. An assembler translates a program written in assembly language, which uses short mnemonic codes, into machine code. A compiler translates an entire high-level language program into machine code in one operation, producing an executable file that can then be run as often as required and that runs quickly. An interpreter, by contrast, translates and immediately carries out a high-level program one statement at a time, which makes it convenient for testing but generally slower to run. Thanks to these translators, people can write programs in easy, meaningful languages while the computer still receives the machine code it needs.
MCQs with Answers
The bus that carries actual data is the: (a) address bus (b) data bus (c) control bus (d) local bus
Correct Answer: (b) data bus.
The address bus works in: (a) both directions (b) one direction (c) no direction (d) reverse only
Correct Answer: (b) one direction.
Read and write signals travel on the: (a) data bus (b) address bus (c) control bus (d) system bus
Correct Answer: (c) control bus.
A small fast store inside the CPU is a: (a) register (b) disk (c) cache tape (d) file
Correct Answer: (a) register.
The register holding the next instruction’s address is the: (a) IR (b) PC (c) MAR (d) MDR
Correct Answer: (b) PC.
The correct order of the instruction cycle is: (a) decode, fetch, execute (b) fetch, decode, execute (c) execute, fetch, decode (d) fetch, execute, decode
Correct Answer: (b) fetch, decode, execute.
The part of an instruction giving the operation is the: (a) operand (b) opcode (c) address (d) register
Correct Answer: (b) opcode.
The master control program of a computer is the: (a) compiler (b) operating system (c) assembler (d) browser
Correct Answer: (b) operating system.
A translator that converts a whole program at once is a: (a) interpreter (b) compiler (c) loader (d) linker
Correct Answer: (b) compiler.
An interpreter translates a program: (a) all at once (b) one statement at a time (c) never (d) into assembly
Correct Answer: (b) one statement at a time.
Quick Revision Summary
- Buses: data (both ways), address (one way), control (signals).
- I/O unit connects devices; buffers match speeds.
- Registers: PC (next instruction), IR (current), MAR/MDR (memory), accumulator (results).
- Instruction cycle: fetch -> decode -> execute (repeats).
- Instruction format = opcode + operand.
- OS = master system software; translators: assembler, compiler (whole program), interpreter (one line). Notes by freebooks.pk.
Exam Tips
- Name the three buses and what each carries.
- List the main registers and their jobs.
- State the instruction cycle in the correct order.
- Split an instruction into opcode and operand.
- Give the main functions of the operating system.
- Compare compiler and interpreter clearly.