What Is a Computer?; Machine Cycle: Fetch–Decode–Execute; CPU Organization
What Is a Computer?; Machine Cycle: Fetch–Decode–Execute; CPU Organization
What Is a Computer?
A computer is an electronic machine that performs tasks by executing a stored sequence
of instructions. At the architectural level, the central idea is simple: **fetch an
instruction, decode it, execute it and repeat** until the program halts or an interrupt
redirects control.
Modern computers are built from:
Understanding architecture means understanding how these blocks cooperate in time
(cycles, pipelining, interrupts) and how data is stored (RAM, ROM, cache, auxiliary
stores).
Machine Cycle: Fetch–Decode–Execute
Every instruction passes through a machine cycle (also called the **instruction
cycle**). The classic three phases taught in standard textbooks are:
```
┌─────────┐ ┌─────────┐ ┌──────────┐
│ FETCH │───▶│ DECODE │───▶│ EXECUTE │───▶ (next instruction)
└─────────┘ └─────────┘ └──────────┘
```
2.1 Fetch
- The Program Counter (PC) holds the address of the next instruction.
- That address
is placed in the MAR (Memory Address Register).
- The memory returns the instruction
opcode/operands via MDR into the CIR (Current Instruction Register).
- PC is
incremented (or updated by branch) to point to the following instruction.
2.2 Decode
- The Control Unit (CU) interprets the opcode in CIR.
- Control signals are generated to
select ALU operation, register paths and memory/I/O access.
2.3 Execute
- The operation runs: e.g. ADD places result in Accumulator (AC), STORE writes AC to
memory, JMP loads PC.
2.4 Worked Timeline (Conceptual)
Suppose memory contains:
Cycle 1: PC=2001 → Fetch LOAD A → Decode → Execute (A loaded to AC).
Cycle 2:
PC=2002 → Fetch LOAD B → Execute (B in register).
Cycle 3: PC=2003 → ADD → result in AC.
Cycle 4: PC=2004 → STORE → memory[C] updated.
This sequential story is exactly what non-pipelined machines do: one full cycle
completes before the next instruction begins.
CPU Organization
Computer architecture design consists of:
- Control Unit (CU)
- Arithmetic and Logic Unit (ALU)
- Memory Unit
(conceptually; physically separate chips)
- Registers
- Input/Output devices
The CPU (Central Processing Unit) is the electronic circuit that executes program
instructions. It is often called the microprocessor or processor when implemented on
a single chip.
```
┌──────────────────────────────────────┐
│ CPU │
│ ┌────┐ ┌────┐ ┌──────────────┐ │
│ │ CU │───│ALU │───│ Registers │ │
│ └────┘ └────┘ └──────────────┘ │
└───────────┬────────────┬─────────────┘
│ Address │ Data
│ Control │
┌───────────▼────────────▼─────────────┐
│ Memory / I/O │
└──────────────────────────────────────┘
```
Continue full topic on App →Practice MCQs (20)
1. During which machine-cycle stage does the control unit interpret the fetched instruction?
- A. Execute
- B. Fetch
- C. Store input
- D. Decode
2. What is the basic purpose of a computer?
- A. Transmit analog signals without processing
- B. Store data without executing instructions
- C. Only display text on a screen
- D. Accept data, process it under program control, store it and produce information
3. Which sequence correctly represents the basic instruction cycle?
- A. Fetch, decode, execute
- B. Decode, execute, fetch
- C. Execute, fetch, decode
- D. Store, print, fetch
4. Which CPU register normally contains the address of the next instruction?
- A. Accumulator
- B. Program counter
- C. Instruction register
- D. Memory data register
5. What does the instruction register hold?
- A. The instruction currently being decoded or executed
- B. The address of every I/O device
- C. The result of every previous program
- D. The size of main memory
6. What is held in the memory address register during a memory access?
- A. The data returned by the ALU
- B. The number of clock cycles elapsed
- C. The current instruction opcode only
- D. The address of the memory location being accessed
7. What is the role of the memory data register?
- A. Hold data being transferred to or from memory
- B. Generate the next instruction address
- C. Select an input peripheral
- D. Decode the operation code
8. Which CPU component performs arithmetic and logical operations?
- A. Program counter
- B. Control unit
- C. Arithmetic and logic unit
- D. Input unit
9. What is the main responsibility of the control unit?
- A. Convert every input into analog form
- B. Perform only addition and subtraction
- C. Direct the sequence of operations by generating control signals
- D. Store files permanently
10. Why are CPU registers faster to access than main memory?
- A. They are accessed through a network
- B. They are small storage locations built directly into the processor
- C. They use magnetic disks
- D. They contain only program source code
11. Which register commonly stores an intermediate arithmetic result?
- A. Instruction register
- B. Program counter
- C. Accumulator
- D. Memory address register
12. What normally happens to the program counter after a sequential instruction is fetched?
- A. It advances to the address of the following instruction
- B. It is cleared permanently
- C. It becomes the instruction register
- D. It receives the arithmetic result
13. Which bus carries the location that the processor wants to access?
- A. Expansion clock
- B. Address bus
- C. Data bus
- D. Control bus
14. Which bus carries instruction and operand values between the CPU and memory?
- A. Address bus
- B. Clock bus only
- C. Data bus
- D. Power bus
15. Which bus carries signals such as memory read and memory write?
- A. Video bus
- B. Data bus
- C. Control bus
- D. Address bus
16. During execution of an ADD instruction, which unit performs the addition?
- A. Input device
- B. Instruction register
- C. Program counter
- D. Arithmetic and logic unit
17. What does CPU organization describe?
- A. How users organize folders
- B. How processor components, registers, buses and control paths are arranged and connected
- C. How files are named on a disk
- D. How a monitor draws pixels
18. What is the role of main memory while a program runs?
- A. Generate all processor control signals
- B. Hold active instructions and data for processor access
- C. Provide permanent mechanical output
- D. Replace the arithmetic and logic unit
19. A processor has a 16-bit address bus. How many distinct addresses can it represent?
- A. 1,048,576
- B. 32,768
- C. 16
- D. 65,536
20. Which part of an instruction specifies the operation to perform?
- A. Opcode
- B. Memory capacity
- C. Bus width
- D. Clock period