Learning Objectives
By the end of this chapter, you will be able to:
- Draw and explain the block diagram of a computer.
- State the role of the CPU and its parts (ALU, CU, registers) and the memory unit.
- Explain the fetch decode execute cycle with a traceable example.
- Explain why units must be interconnected, and name the three system buses.
- Identify factors that affect processor performance in three groups.
Detail: cabinet and motherboard, memory hierarchy, how the CPU uses memory.
Block diagram of a computer
Data enters, waits, is transformed, and leaves. Memory holds. The CPU transforms. Buses carry. Storage keeps. The diagram is the contract between those jobs.
flowchart LR
IN[Input unit: keyboard, mouse, scanner] --> MEM
subgraph CPU[Central Processing Unit]
CU[Control Unit]
ALU[Arithmetic Logic Unit]
REG[Registers]
end
MEM[Memory unit: RAM] <--> CU
CU <--> ALU
ALU <--> REG
CU --> OUT[Output unit: monitor, printer]
MEM <--> SEC[Secondary storage: SSD, HDD]
Data enters through the input unit, is held in memory, processed by the CPU, and results leave through the output unit. Secondary storage keeps data permanently. Without the connections, each unit would be a capable island with no trade.
Central Processing Unit: three jobs in one chip
Do not memorize parts as a list. Group them by job.
A. Direct: the Control Unit
The Control Unit reads instructions, tells other units what to do, and keeps time with the clock. It fetches from RAM, decodes meaning, and issues control signals. It does no arithmetic. It decides.
B. Compute: the ALU
The ALU does arithmetic and logic. Add, subtract, multiply, divide, compare, AND, OR. It works only on what registers hand it. It is fast and narrow.
C. Keep close: registers
Registers are tiny, fastest storage inside the CPU. They hold the current instruction, addresses, and operands for this cycle. Bytes, not gigabytes. If registers were larger, the CPU would be slower and hotter. Their smallness is the point.
| Part | Job | Analogy |
|---|---|---|
| Control Unit | Directs flow, decodes instructions | Supervisor with the work order |
| ALU | Calculates and compares | Worker with the calculator |
| Registers | Holds what is being worked on now | Hands holding the current sheet |
The instruction cycle: a worked trace
To calculate A + B and store it in C:
- Fetch: the control unit fetches the instruction “add A and B” from RAM via the address and data buses.
- Decode: the control unit interprets it: addition, operands A and B, destination C.
- Execute: A and B are loaded into registers and the ALU adds them.
- Store: the result is written back to memory location C.
A modern processor repeats this cycle billions of times per second. The cycle never changes. Only the clock and the parallelism around it change.
Self-check
Memory unit
Primary memory (RAM) holds the operating system, programs, and data currently in use. It is volatile: contents vanish when power is off. Secondary storage (HDD, SSD) is non-volatile and slower. Registers and cache sit between the ALU and RAM so the CPU is not waiting on every byte. That gap is why hierarchy exists. See memory hierarchy for the pyramid.
Interconnecting the units: motherboard and buses
The motherboard is the printed circuit board that holds the CPU socket, RAM slots, chipset, and expansion slots. The chipset acts as traffic controller between CPU, RAM, and peripherals.
Buses are shared electrical paths. Three carry different questions.
| Bus | Carries | Direction | Question it answers |
|---|---|---|---|
| Address bus | The memory location the CPU wants | One way, CPU to memory and I/O | Where? |
| Data bus | The actual data being read or written | Two way | What? |
| Control bus | Commands and timing (read, write, clock) | Two way | When and whether? |
Without a shared interconnection, the CPU could not read a keystroke or write a file. Wider buses move more data per tick, but need more pins and power. That cost is a design choice, not just a speed number.
Factors affecting processor performance: three groups
Do not list five isolated factors. Group them so you can argue a purchase.
A. Silicon: what the chip itself gives
- Clock speed in GHz. A 3.2 GHz CPU ticks about 3.2 billion times per second. Higher clock helps single thread work, but heat rises with it.
- Cores and threads. Four cores can do four independent tasks at once. Sixteen threads help when the software is parallel. For a single Excel sheet, clock often beats core count.
- Word size. A 64 bit CPU moves 8 bytes per word, a 32 bit moves 4. Larger words help large numbers and large memory.
B. System: what feeds the chip
- Cache size. More L1, L2, L3 cache means fewer slow trips to RAM. For repeated ledger loops, cache matters more than GHz.
- RAM amount and speed. A fast CPU with 4 GB RAM stalls, paging to disk. DDR4 vs DDR5 also changes bandwidth.
- Storage speed. An SSD feeds the CPU far faster than an HDD. The CPU was waiting for the disk, not computing.
C. Workload: what you ask it to do
A billing program that adds 200 lines stresses single core speed. A branch running Tally, Chrome with ten tabs, and antivirus stresses cores and RAM. The bottleneck moves with the job.
Nepal worked example: the upgrade that pays back (NPR, BS 2081)
Scenario: An accounting firm in Lalitpur runs Tally Prime and Chrome on six PCs with 4 GB RAM and 1 TB HDDs. Staff complain that day end closing takes 22 minutes. On 2081-07-20 the manager prices two options for six machines.
- Option A: replace all six PCs at NPR 78,000 each = NPR 468,000.
- Option B: add 8 GB RAM (NPR 4,200 per stick) and a 512 GB SATA SSD (NPR 5,800 per drive) per PC, plus labour NPR 800 per PC.
Cost of B per PC = 4,200 + 5,800 + 800 = NPR 10,800. For six PCs = NPR 64,800. Saving versus A = 468,000 - 64,800 = NPR 403,200.
Result after B: closing time falls from 22 minutes to 7 minutes. The CPU was not weak. It was starved of data. Bandwidth to RAM and disk was Group B, not Group A, and the cheaper fix targeted the right group.
Example 1: In a cooperative, Group B decides audit risk. Ask: on 2081-08-15 can we post interest for 6,000 members within the nightly window with current RAM and SSD? If not, the audit queue slips, not the CPU spec.
Example 2: In a retail chain, Group C decides queue time. Ask: how many seconds per bill when five tills hit one stock file at 6 p.m.? If Tally plus Chrome plus scanner needs cores and RAM, buy Group B before chasing GHz.
Summary
- A computer is five units plus the buses and board that join them.
- CPU is Control, ALU, and registers: direct, compute, keep close.
- Memory holds work now; storage keeps work later.
- Buses answer where, what, and when.
- Performance is Silicon times System for the Workload you run. Name the group before you spend.
Key Takeaways
- Registers are smallest and fastest because proximity is speed.
- The fetch decode execute store cycle is the same at 1 GHz or 5 GHz.
- Address bus is one way. Data and control are two way.
- Faster cache and RAM often beat a faster clock for business apps.
Discussion Questions
- Why can a 5 GHz CPU still stall on a 4 GB HDD machine?
- Give one sentence each: what RAM does versus what an SSD does.
- What does widening the data bus improve, and what cost does it add?
Exercises
Short answer
- Name the three parts of the CPU and state the job of each in one line.
- Name the three system buses and state direction for each.
- List two factors from Group A and one from Group B that affect CPU performance.
Long answer
- Draw the block diagram of a computer and explain each unit plus how buses and motherboard connect them.
- Trace the fetch decode execute cycle for
C = A + Band explain why a fast CPU still waits for slow memory, using the Lalitpur firm numbers.


