IT and Applications
Unit 3: Computer System Hardware
CPU, memory unit, memory hierarchy, primary, cache and secondary memory, storage devices, input and output devices, and the I/O system.
Introduction
Hardware refers to the physical components of a computer — anything you can touch. It includes the CPU, memory, storage, input/output devices, and the cabinet that holds them together. A computer cannot run without both hardware and software working together.
Central Processing Unit (CPU)
The CPU is the brain of the computer. It executes instructions from programs by fetching, decoding, and executing them.
It has three main parts:
- ALU (Arithmetic Logic Unit) — performs arithmetic (
+,-,*,/) and logic (AND,OR,NOT) operations. - CU (Control Unit) — directs the operation of the processor by telling other units what to do.
- Registers — small, fast storage inside the CPU.
Modern CPUs (e.g. Intel Core i9, AMD Ryzen, Apple M-series) have multiple cores, so they can do several things simultaneously.
Memory unit
The memory unit stores data and instructions. It is one of the most important parts of the computer because the CPU constantly reads and writes to it.
Interconnecting the units of a computer
The CPU, memory, and I/O devices are connected by buses:
- Address bus — carries the address of memory locations.
- Data bus — carries the actual data.
- Control bus — carries signals like read/write.
The motherboard is the main circuit board that houses these buses, plus sockets for the CPU, RAM, and expansion cards.
Inside a computer cabinet
A typical desktop cabinet contains:
- Motherboard — the main circuit board.
- CPU with heatsink and fan.
- RAM modules.
- SSD / HDD for storage.
- GPU (graphics card) — for graphics and AI workloads.
- PSU (Power Supply Unit) — converts AC to DC for the components.
- Cooling fans and sometimes liquid cooling.
Computer memory
Introduction
Memory stores data and instructions that the CPU needs. Without memory, the CPU has nothing to work on.
Memory representation
Data is represented in binary — 0s and 1s. The basic units are:
- 1 Bit = 0 or 1
- 1 Byte = 8 bits
- 1 KB = 1024 bytes
- 1 MB = 1024 KB
- 1 GB = 1024 MB
- 1 TB = 1024 GB
Memory hierarchy
Memory is arranged in a hierarchy based on speed and cost:
Fastest, smallest, most expensive
┌───────────────────────┐
│ CPU Registers │
├───────────────────────┤
│ Cache (L1/L2/L3)│
├───────────────────────┤
│ RAM (Primary) │
├───────────────────────┤
│ SSD / HDD (Secondary)│
├───────────────────────┤
│ Tape / Cloud Storage │
└───────────────────────┘
Slowest, largest, cheapest
CPU registers
Registers are tiny but extremely fast memory cells inside the CPU. Common ones:
- PC (Program Counter) — holds the address of the next instruction.
- IR (Instruction Register) — holds the current instruction being executed.
- MAR (Memory Address Register) — holds the memory address to access.
- MDR (Memory Data Register) — holds the data being read or written.
- Accumulator — holds intermediate ALU results.
Cache memory
Cache is a small, very fast memory close to the CPU that stores frequently used data. It is usually divided into:
- L1 — smallest and fastest, on the CPU core.
- L2 — larger, slightly slower.
- L3 — shared between cores.
Primary memory
Primary memory is directly accessible by the CPU:
- RAM (Random Access Memory) — volatile, fast, used during program execution.
- SRAM — fast, expensive, used in cache.
- DRAM — cheaper, slower, used as main RAM.
- ROM (Read Only Memory) — non-volatile, stores firmware like the BIOS.
Secondary memory
Secondary memory is non-volatile — it keeps data even when power is off.
- HDD (Hard Disk Drive) — magnetic, cheap, slower.
- SSD (Solid State Drive) — flash-based, faster, more reliable.
- External drives, USB drives, memory cards.
Access types of storage devices
- Sequential access — data is read in order (magnetic tape).
- Direct / random access — any location can be read instantly (RAM, SSD).
- Semi-random access — combination, like older hard drives.
Types of secondary storage
Magnetic tape
Stores data on a long plastic tape with magnetic coating. Used for backups; very cheap per GB but only sequential access.
Magnetic disk
Hard drives. Data is written on rotating platters; read/write heads access tracks and sectors.
Optical disk
Data is read/written using a laser:
- CD — ~700 MB
- DVD — ~4.7 GB
- Blu-ray — ~25–50 GB
Magneto-optical disk
Uses both magnetic and optical technologies. Rare today; once used for archival.
How the computer uses its memory
When you run a program:
- The OS loads the program from secondary storage (SSD/HDD) into RAM.
- The CPU fetches instructions from RAM into its registers.
- Frequently used data is kept in cache to avoid slow RAM access.
- The result is written back to RAM, and eventually saved to disk if needed.
Input and output devices
Introduction
I/O devices let the user and computer communicate. Input devices send data to the computer; output devices receive data from the computer.
Input devices
- Keyboard — type characters and commands.
- Mouse / Trackpad — point and click.
- Scanner — convert paper to digital images.
- Microphone — capture audio.
- Webcam — capture video.
- Touchscreen — input by touch.
- Barcode reader, QR scanner — scan codes.
Human data entry devices
Specialised input devices for fast or accurate data entry:
- OCR (Optical Character Recognition) — reads printed text.
- OMR (Optical Mark Recognition) — reads bubble-sheet answers (e.g. exam sheets).
- MICR (Magnetic Ink Character Recognition) — reads cheque numbers.
- Biometric devices — fingerprint, iris, face recognition.
Output devices
- Monitor / Display — shows visual output.
- Printer — produces hard copies (inkjet, laser, 3D printers).
- Speaker / Headphone — audio output.
- Projector — display on large surface.
- Plotter — large-format printing for engineering drawings.
I/O port
An I/O port is the interface through which a device connects to the computer. Examples:
- USB (Universal Serial Bus) — most common.
- HDMI / DisplayPort — video output.
- Ethernet (RJ-45) — networking.
- Audio jack (3.5 mm) — sound.
- Thunderbolt — high-speed combined data and video.
Working of I/O system
The I/O system works in three main ways:
- Programmed I/O — the CPU directly checks if the device is ready (slow, wastes CPU).
- Interrupt-driven I/O — the device interrupts the CPU when it has data ready.
- DMA (Direct Memory Access) — the device transfers data to/from memory without involving the CPU at all (fast, efficient).
Modern systems mostly use DMA for high-speed devices like disks, SSDs, and GPUs.