Basics of Computer Organization & Architecture
Hardware vs Software, Firmware, Flynn's Taxonomy, Memory Hierarchy, CPU Registers, and ISA Design
- Distinguish between Computer Organization and Architecture
- Understand the functional blocks of a CPU and system bus
- Classify systems using Flynn's Taxonomy (SISD, SIMD, MISD, MIMD)
- Differentiate Von Neumann and Harvard memory architectures
1. Introduction, Hardware & Software
1.1 Definitions
- Computer: An electronic device that accepts data (input), processes it as per a set of instructions (program), and produces meaningful results (output), and can store data for future use.
- Computer Organization: Deals with how a system is designed/built — the operational units, their interconnections, and how they realize the architecture (e.g., control signals, memory technology, peripherals). It answers "How is it implemented?"
- Computer Architecture: Deals with the functional behavior/attributes visible to the programmer — instruction set, addressing modes, data types, registers exposed to software. It answers "What does the programmer see?"
Key distinction
: Two computers can have the same architecture (same ISA, e.g., x86) but different organization (different cache sizes, pipeline depths, clock speeds) — e.g., Intel i5 vs i9.
1.2 Block Diagram of a Computer System
1 ┌───────────────┐2 │ INPUT UNIT │3 └───────┬───────┘4 │5 ┌──────────▼───────────┐6 │ CENTRAL PROCESSING │7 │ UNIT (CPU) │8 │ ┌─────┐ ┌───────┐ │ ┌───────────────┐9 │ │ ALU │ │ CU │◄├────────┤ MEMORY UNIT │10 │ └─────┘ └───────┘ │ │ (Primary/RAM) │11 │ Registers │ └───────────────┘12 └──────────┬───────────┘13 │14 ┌───────▼───────┐15 │ OUTPUT UNIT │16 └───────────────┘- Input Unit: Converts external data into machine-readable form and feeds it to memory.
- CPU: The "brain" — contains the Arithmetic Logic Unit (ALU), Control Unit (CU), and registers.
- Memory Unit: Stores data and instructions (primary — RAM/ROM, and secondary — disks).
- Output Unit: Converts processed results into a human-readable form.
- All units are interconnected via a system bus (data bus, address bus, control bus).
1.3 Hardware vs Software
| Aspect | Hardware | Software |
|---|---|---|
| Definition | Physical, tangible components of a computer | Set of instructions/programs that direct hardware |
| Nature | Can be touched/seen | Intangible, logical |
| Examples | CPU, RAM, keyboard, monitor, motherboard | OS, compilers, applications |
| Failure | Wears out physically (mechanical/electrical failure) | Fails due to bugs/logical errors |
| Modification | Difficult, needs physical replacement | Easy, can be updated/patched |
| Dependency | Cannot function meaningfully without software | Cannot run without hardware |
1.4 Firmware
- Firmware: Software permanently stored on hardware (usually in ROM/Flash), providing low-level control for a device's specific hardware.
- It is a hybrid between hardware and software — stored physically (like hardware) but consists of instructions (like software).
- Examples: BIOS/UEFI, router firmware, printer firmware.
- Characteristics: Rarely modified by the end user, boots up the device, provides an interface between hardware and higher-level software (OS).
Common Traps & Exam Tips
- Do NOT confuse Computer Organization with Computer Architecture — Architecture = programmer-visible attributes; Organization = implementation details. This distinction is a favorite MCQ trap. - Firmware is often wrongly classified as pure hardware or pure software — remember it's stored in hardware but is software in nature. - BIOS/UEFI is the most commonly asked example of firmware.
2. Input/Output Devices
2.1 Classification
| Category | Description | Examples |
|---|---|---|
| Input Devices | Send data INTO the computer | Keyboard, mouse, scanner, joystick, mic |
| Output Devices | Receive data FROM the computer | Monitor, printer, speaker, plotter |
| Both (I/O) | Can send and receive data | Touchscreen, modem, network card |
2.2 Working Principles of Major Devices
Keyboard: Each key press generates a unique scan code, detected by a keyboard controller (microcontroller), which converts it into ASCII/Unicode and sends it to the CPU via an interrupt.
Mouse:
- Mechanical: A rubber ball rotates rollers, converting movement into X-Y coordinate signals.
- Optical: An LED/laser + image sensor tracks surface movement optically (thousands of images/sec compared for displacement), converted into cursor movement.
Scanner: Uses a light source (CCD/CIS sensor) to scan a document line by line; reflected light intensity is converted into digital pixel values (analog-to-digital conversion) to reconstruct a digital image.
Monitor:
- CRT: Electron guns fire beams onto a phosphor-coated screen, causing pixels to glow.
- LCD: Uses liquid crystals that twist to block/pass polarized backlight, forming images (no self-emission).
- LED: An LCD variant using LEDs for backlighting — better contrast/power efficiency.
Printers:
| Type | Mechanism | Speed | Quality | Impact/Non-Impact |
|---|---|---|---|---|
| Dot Matrix | Pins strike an ink ribbon onto paper | Slow | Low | Impact |
| Inkjet | Sprays tiny ink droplets onto paper | Medium | High | Non-Impact |
| Laser | Laser beam charges a drum, toner sticks to charged areas, fused onto paper by heat | Fast | Very High | Non-Impact |
Common Traps & Exam Tips
- Touchscreen, modem, and NIC are classic examples of "both input and output" devices — frequently tested. - Laser printers use electrostatic + toner + heat fusing, NOT ink — a common confusion with inkjet. - LCD does not emit light itself; it blocks/modulates backlight — often confused with LED/OLED which do emit light.
3. Basics of Memory
3.1 Units of Memory
- Bit: Smallest unit, holds 0 or 1.
- Nibble: 4 bits.
- Byte: 8 bits — smallest addressable unit in most systems.
- Word: The natural data size a CPU processes at once (16/32/64 bits depending on architecture).
- Larger units: 1 KB = 2¹⁰ bytes, 1 MB = 2²⁰ bytes, 1 GB = 2³⁰ bytes, 1 TB = 2⁴⁰ bytes.
3.2 Memory Hierarchy Overview
1Fastest, Smallest, Costliest Registers2 │ Cache Memory (L1, L2, L3)3 │ Main Memory (RAM)4 ▼ Secondary Memory (HDD/SSD)5Slowest, Largest, Cheapest Tertiary/Backup (Tape, Cloud)- Principle: As we go up the hierarchy → speed ↑, cost/bit ↑, capacity ↓.
- As we go down → speed ↓, cost/bit ↓, capacity ↑.
3.3 Primary, Secondary, Cache Memory
| Type | Volatility | Speed | Access by CPU | Examples |
|---|---|---|---|---|
| Primary (Main) | Volatile | Fast | Direct | RAM |
| Cache | Volatile | Fastest (next to registers) | Direct | SRAM-based cache |
| Secondary | Non-volatile | Slow | Indirect (via I/O) | HDD, SSD |
3.4 SRAM vs DRAM
| Feature | SRAM | DRAM |
|---|---|---|
| Construction | 6-transistor flip-flop cell | 1 transistor + 1 capacitor |
| Speed | Faster | Slower |
| Cost per bit | Higher | Lower |
| Density | Lower (needs more transistors/bit) | Higher |
| Refresh needed? | No | Yes (capacitor leaks charge, needs periodic refresh) |
| Power consumption | Lower (in standby) | Higher (due to refresh cycles) |
| Typical use | Cache memory | Main memory (RAM) |
3.5 ROM and Its Types
| Type | Full Form | Programmable | Erasable | Erase Method |
|---|---|---|---|---|
| ROM | Read Only Memory | Factory-programmed (mask ROM) | No | — |
| PROM | Programmable ROM | Once, by user (via fuse burning) | No | — |
| EPROM | Erasable PROM | Yes | Yes | UV light |
| EEPROM | Electrically Erasable PROM | Yes | Yes | Electrically, byte-level |
| Flash | Flash Memory (EEPROM variant) | Yes | Yes | Electrically, block-level (faster than EEPROM) |
3.6 Secondary Memory Devices
- HDD (Hard Disk Drive): Magnetic storage using rotating platters and read/write heads; mechanical, slower, cheaper per GB.
- SSD (Solid State Drive): Flash-memory based, no moving parts, much faster, more expensive per GB.
- Magnetic Tape: Sequential access, very high capacity, used for backups/archival — slowest access.
- Optical Disks: CD/DVD/Blu-ray — data stored as pits/lands read by laser; portable, moderate capacity.
Solved PYQ-Style Questions
- Q: Which memory type does not require refreshing? A: SRAM (uses flip-flops, stable as long as powered — unlike DRAM's capacitor-based cells that leak charge).
- Q: Arrange in increasing order of access speed: Cache, Register, Main Memory, Secondary Memory. A: Secondary Memory < Main Memory < Cache < Register.
- Q: Which ROM type can be erased using UV light? A: EPROM.
- Q: A system has 1 GB RAM. How many bits does it contain? A: 1 GB = 2³⁰ bytes = 2³⁰ × 8 bits = 2³³ bits ≈ 8.59 × 10⁹ bits.
- Q: Which memory offers byte-level electrical erasure? A: EEPROM (Flash does block-level erasure, which is faster but coarser).
Common Traps & Exam Tips
- SRAM = Static = Stable = no refresh; DRAM = Dynamic = needs refresh — mnemonic trick. - Flash is technically a type of EEPROM but erases in blocks, not bytes — a frequently tested nuance. - Don't confuse memory hierarchy direction: speed/cost is HIGHEST at the top (registers), capacity is HIGHEST at the bottom.
4. Evolution & History of Computers
4.1 Generations of Computers
| Generation | Period | Technology | Examples | Key Features |
|---|---|---|---|---|
| 1st | 1940–1956 | Vacuum Tubes | ENIAC, UNIVAC | Huge size, high power, machine language |
| 2nd | 1956–1963 | Transistors | IBM 1401 | Smaller, faster, assembly language |
| 3rd | 1964–1971 | Integrated Circuits (IC) | IBM 360 | High-level languages, OS introduced |
| 4th | 1971–present | Microprocessors (VLSI) | Intel 4004 onward, PCs | Personal computers, GUI |
| 5th | Present onward | AI, ULSI, Parallel Processing | AI-based systems | Natural language processing, machine learning |
4.2 Key Inventions Timeline
- 1837: Charles Babbage designs the Analytical Engine (father of the computer).
- 1945: Von Neumann proposes the stored-program concept.
- 1947: Invention of the transistor (Bell Labs).
- 1958: Integrated Circuit invented (Jack Kilby).
- 1971: First microprocessor — Intel 4004.
- 1981: IBM PC launched.
4.3 Evolution of Computer Architecture
- Early machines: fixed-wiring, no stored program (e.g., ENIAC required manual rewiring).
- Von Neumann architecture (1945): introduced stored-program concept — instructions and data share the same memory.
- Harvard architecture (parallel evolution): separate memory for instructions and data.
- Modern architectures: pipelining, superscalar, multicore, RISC/CISC hybrids.
Common Traps & Exam Tips
- ENIAC is 1st generation (vacuum tubes) — commonly confused with being "the first stored-program computer" (that credit goes to EDSAC/EDVAC using Von Neumann's concept). - Transistor → 2nd gen; IC → 3rd gen; Microprocessor → 4th gen — sequence is a favorite MCQ. - 5th generation is characterized by AI, not just faster hardware.
5. Computer Classification & Flynn's Taxonomy
5.1 Classification by Size/Purpose
| Type | Description | Example |
|---|---|---|
| Supercomputer | Extremely high processing power, used for complex simulations | PARAM, Cray |
| Mainframe | Large, handles bulk data processing for organizations | IBM Z-series |
| Minicomputer | Mid-sized, less powerful than mainframe | PDP-11 |
| Microcomputer | Personal computers | Desktops, laptops |
| Embedded computer | Special-purpose, built into devices | Microcontrollers in appliances |
5.2 Flynn's Taxonomy
Classifies architectures based on the number of instruction streams and data streams.
1 Single Data Multiple Data2Single Instr. SISD SIMD3Multiple Instr. MISD MIMD- SISD (Single Instruction, Single Data): One processor executes one instruction stream on one data stream sequentially. Example: Traditional uniprocessor systems (old single-core CPUs).
- SIMD (Single Instruction, Multiple Data): One instruction operates on multiple data elements simultaneously. Example: GPUs, vector processors, array processors.
- MISD (Multiple Instruction, Single Data): Multiple instructions operate on the same data stream — rare in practice. Example: Fault-tolerant systems (redundant computation for safety, e.g., space shuttle flight control).
- MIMD (Multiple Instruction, Multiple Data): Multiple processors execute different instructions on different data independently. Example: Modern multicore/multiprocessor systems, distributed systems.
5.3 Von Neumann vs Harvard Architecture
| Feature | Von Neumann Architecture | Harvard Architecture |
|---|---|---|
| Memory | Single shared memory for instructions & data | Separate memories for instructions & data |
| Bus | Single bus (shared) | Separate buses for instruction and data |
| Speed | Slower (bus contention — "Von Neumann bottleneck") | Faster (parallel access to instruction & data) |
| Complexity | Simpler design | More complex, more hardware |
| Flexibility | Memory can be dynamically allocated between code/data | Fixed partition between instruction/data memory |
| Usage | General-purpose computers (PCs) | DSPs, microcontrollers, embedded systems |
Solved PYQ-Style Questions
- Q: A GPU performing the same operation on thousands of pixels simultaneously is an example of? A: SIMD.
- Q: Which architecture suffers from the "Von Neumann bottleneck"? A: Von Neumann architecture (shared bus limits simultaneous instruction/data fetch).
- Q: Classify a modern multicore server running independent processes. A: MIMD.
- Q: Which Flynn's category is theoretically defined but has very limited practical implementation? A: MISD.
Common Traps & Exam Tips
- MISD is largely theoretical/niche — don't confuse with MIMD (most common trap in Flynn's taxonomy questions). - Harvard architecture ≠ no shared memory ever — modern "Modified Harvard" allows some communication between instruction/data caches, but conceptually kept separate at cache level. - Von Neumann bottleneck refers to the shared bus limiting throughput, not memory capacity.
6. CPU Organization Basics
6.1 Components of CPU
- ALU (Arithmetic Logic Unit): Performs arithmetic (add, subtract) and logical (AND, OR, NOT, comparison) operations.
- CU (Control Unit): Generates control signals to coordinate the fetch-decode-execute cycle, directs data flow between CPU and other units.
- Registers: Small, high-speed storage locations inside CPU used to hold data/instructions temporarily during execution.
6.2 Fetch-Decode-Execute Cycle
11. FETCH: Instruction fetched from memory (address in PC) into IR22. DECODE: CU decodes the opcode in IR to determine the operation33. EXECUTE: ALU/CU performs the operation; result stored/written back4 → PC incremented to point to the next instruction6.3 Types of Registers
| Register | Full Form | Role |
|---|---|---|
| PC | Program Counter | Holds the address of the NEXT instruction to be fetched |
| IR | Instruction Register | Holds the CURRENTLY fetched instruction |
| MAR | Memory Address Register | Holds the address of memory location to be accessed |
| MBR/MDR | Memory Buffer/Data Register | Holds the data being transferred to/from memory |
| AC | Accumulator | General-purpose register storing intermediate ALU results |
| Flags/Status Register | — | Holds condition codes (carry, zero, overflow, sign) after ALU ops |
| General Purpose Registers | GPRs | Hold temporary data/operands for various operations |
6.4 Register Transfer Language (RTL) Basics
- A symbolic notation to describe micro-operations (data movement between registers).
- Example:
MAR ← PCmeans "the contents of PC are transferred to MAR." - Example fetch cycle in RTL:
1 MAR ← PC2 MBR ← Memory[MAR]3 IR ← MBR4 PC ← PC + 16.5 Memory Extension / Addressing Width Concepts
- Addressing width (address bus width) determines the maximum addressable memory: with
naddress lines,2^nlocations can be addressed. - Memory extension: When available address bits are insufficient, extension techniques (e.g., bank switching, segmentation) allow addressing beyond the natural limit of the address bus.
Solved PYQ-Style Questions
- Q: Which register always holds the address of the next instruction? A: PC (Program Counter).
- Q: A CPU has a 32-bit address bus. What is the maximum addressable memory? A: 2³² bytes = 4 GB.
- Q: Which register holds data just read from or about to be written to memory? A: MBR/MDR.
- Q: After executing
ADD R1, R2, which register reflects a carry-out or overflow condition? A: Flags/Status Register. - Q: Write the RTL for storing AC's value into memory. A:
MAR ← address; MBR ← AC; Memory[MAR] ← MBR.
Common Traps & Exam Tips
- PC holds the next instruction's address, NOT the currently executing one (IR holds the current instruction) — the single most common CPU-registers trap. - MAR holds an address; MBR/MDR holds data — frequently swapped in questions. - Address bus width n → 2^n addressable locations — a direct numerical formula, always double-check units (bytes vs words).
7. Instruction Set Architecture (ISA) & Design
7.1 What is ISA?
- ISA is the interface between hardware and software — it defines everything a programmer/compiler can use: instructions, registers, data types, addressing modes, and memory model.
- It's the "contract" that a CPU implementation must honor so that software written for it runs correctly regardless of the underlying organization.
7.2 Components of ISA
- Instruction formats (opcode, operands).
- Addressing modes.
- Data types supported (integer, float, char).
- Registers available to the programmer.
- Instruction types (data transfer, arithmetic, logical, control).
7.3 ISA Design Issues
- Operand location: memory-memory, register-memory, or register-register?
- Number of operands per instruction: 0, 1, 2, or 3-address format?
- Operand types and sizes: fixed or variable?
- Instruction encoding: fixed-length vs variable-length?
7.4 Instruction Set Design Goals
- Completeness: Should support all necessary operations.
- Orthogonality: Independence of instruction functionality, addressing modes, and data types — any addressing mode should work with any instruction (simplifies compiler design).
- Compactness: Efficient use of encoding bits.
- Compatibility: Backward compatibility across CPU generations.
- Efficiency: Should map well to hardware for fast execution.
Common Traps & Exam Tips
- "Orthogonality" is a frequently tested keyword — remember it means addressing modes and instruction types can be combined freely/independently. - ISA is architecture-level (programmer-visible); microarchitecture/organization is implementation-level — don't mix them up here either.
8. Encoding Schemes
8.1 Instruction Encoding
- The process of representing instructions as binary patterns that hardware can decode and execute.
- Typically consists of an opcode field (specifies operation) and operand field(s) (specify data/addresses/registers).
8.2 Opcode Design
- Number of bits in opcode determines the maximum number of distinct instructions:
nbits → up to2^ninstructions. - Trade-off: more opcode bits = more instructions supported, but fewer bits left for operands (shorter addressable range).
8.3 Fixed vs Variable Length Encoding
| Feature | Fixed-Length Encoding | Variable-Length Encoding |
|---|---|---|
| Instruction size | Same for all instructions | Varies per instruction |
| Decoding | Simple, fast (good for pipelining) | Complex, slower decode |
| Memory efficiency | Less efficient (wastes bits for simple instructions) | More efficient (compact for simple instructions) |
| Used in | RISC architectures (e.g., MIPS, ARM) | CISC architectures (e.g., x86) |
Solved PYQ-Style Question
- Q: An instruction set has a 6-bit opcode field. How many distinct instructions can be represented? A: 2⁶ = 64 instructions.
Common Traps & Exam Tips
- Fixed-length → RISC (simplifies pipelining); Variable-length → CISC (more code-density) — a classic pairing tested in RISC vs CISC contexts too. - Opcode bits and operand bits trade off against each other within a fixed total instruction length — a common numerical trap.
9. Types of Software
9.1 Classification
| Type | Description | Examples |
|---|---|---|
| System Software | Manages/controls hardware, provides platform for application software | Operating System, Device Drivers |
| Application Software | Performs specific user tasks | MS Word, browsers, games |
| Utility Software | Maintains/optimizes system performance | Antivirus, disk cleanup, backup tools |
| Firmware | Low-level software embedded in hardware | BIOS, router firmware |
9.2 Key Differences
| Aspect | System Software | Application Software |
|---|---|---|
| Purpose | Runs the computer itself | Helps user perform tasks |
| Dependency | Independent, runs first (at boot) | Depends on system software to run |
| User Interaction | Indirect (works in background) | Direct |
| Examples | OS, compiler, linker | Word processor, spreadsheet |
Common Traps & Exam Tips
- Device drivers are system software (NOT application software) — commonly misclassified. - Utility software is sometimes considered a subset of system software — pay attention to how the specific question categorizes it.
10. Computer Interfaces
10.1 Types of Computer Interfaces
- Interfaces connect the CPU/system to peripheral devices, converting/managing signal formats, timing, and control between them.
- Broadly classified by: (a) data transmission pattern — serial vs parallel, and (b) timing synchronization — synchronous vs asynchronous.
10.2 Serial vs Parallel Interface
| Feature | Serial Interface | Parallel Interface |
|---|---|---|
| Data transmission | One bit at a time, over a single line | Multiple bits simultaneously, over multiple lines |
| Speed (short distance) | Slower (traditionally) | Faster (traditionally) |
| Cabling cost | Cheaper (fewer wires) | Costlier (more wires) |
| Distance suitability | Long distance (less signal degradation/crosstalk) | Short distance (crosstalk/skew issues over long runs) |
| Examples | USB, RS-232, SATA | Old printer (parallel) ports, PATA/IDE |
10.3 Synchronous vs Asynchronous Interface
| Feature | Synchronous Interface | Asynchronous Interface |
|---|---|---|
| Clock signal | Shared common clock between sender/receiver | No shared clock; uses start/stop bits |
| Speed | Faster (no per-byte overhead) | Slower (overhead per character/frame) |
| Complexity | More complex hardware (clock distribution) | Simpler hardware |
| Data framing | Data sent in continuous blocks/frames | Data sent character by character with start/stop bits |
| Example | High-speed data buses, synchronous serial (e.g., SPI) | UART-based serial communication (e.g., traditional RS-232) |
10.4 Examples
- USB (Universal Serial Bus): Modern serial interface, high-speed, widely used for peripherals.
- RS-232: Classic asynchronous serial standard, used in legacy serial ports.
Common Traps & Exam Tips
- Modern USB is serial but very fast — students often assume "serial = slow," which is an outdated generalization; at high frequencies, serial avoids parallel's crosstalk/skew problems and outperforms it. - Synchronous ≠ always parallel and Asynchronous ≠ always serial — these are two independent classification axes (transmission pattern vs timing method); don't conflate them.
Quick Revision Summary
- Organization = implementation details (how); Architecture = programmer-visible attributes (what). Firmware = software stored in hardware (e.g., BIOS).
- I/O devices classified as input, output, or both (touchscreen, modem). Laser printers use electrostatic + toner + heat; inkjet sprays liquid ink.
- Memory units: bit < nibble < byte (8 bits) < word. Hierarchy (fast→slow): Registers > Cache > Main Memory > Secondary Memory.
- SRAM = flip-flop based, fast, no refresh, costly → used in cache. DRAM = capacitor based, slower, needs refresh, cheaper → used in RAM.
- ROM types by erasability: ROM (none) < PROM (once) < EPROM (UV light) < EEPROM (electrical, byte-wise) < Flash (electrical, block-wise).
- 5 Generations: Vacuum Tubes → Transistors → ICs → Microprocessors → AI/ULSI.
- Flynn's Taxonomy: SISD (single core), SIMD (GPU), MISD (rare, fault tolerance), MIMD (multicore/distributed).
- Von Neumann = shared memory/bus for instructions & data (bottleneck); Harvard = separate memories/buses (faster, used in embedded/DSP).
- CPU = ALU + CU + Registers. Fetch-Decode-Execute cycle. PC = next instruction address; IR = current instruction; MAR = address; MBR/MDR = data.
- ISA = programmer-visible contract (instructions, registers, addressing modes, data types); Orthogonality = independence between instructions/addressing modes/data types.
- Opcode bits (
n) →2^npossible instructions. Fixed-length encoding → RISC (simpler decode); Variable-length → CISC (compact). - Software types: System (OS, drivers), Application (user tasks), Utility (maintenance), Firmware (embedded low-level).
- Interfaces: Serial (one bit/line, good for long distance, e.g. USB) vs Parallel (multiple bits/lines, short distance). Synchronous (shared clock, faster) vs Asynchronous (start/stop bits, e.g. RS-232, slower but simpler).
Mastery check
How well can you recall this?
Finished this lesson?