1.3 COMPUTER ARCHITECTURE, CPU, CONTROL UNIT, COMPUTER ARITHMETIC, I/O ORGANIZATION AND MEMORY ORGANIZATION

 


1.3.1 What is Computer Architecture?

Computer architecture refers to the basic design and organization of a computer system. It explains how different parts of a computer are arranged and how they work together to execute instructions.

Simple Definition

Computer architecture is the conceptual design and functional organization of a computer system.

It mainly describes:

  • CPU
  • Memory
  • Input/Output devices
  • Data paths
  • Control mechanisms
  • Communication between components

Basic Computer Architecture

                 COMPUTER SYSTEM
                       │
       ┌───────────────┼───────────────┐
       ↓               ↓               ↓
     INPUT            CPU            OUTPUT
     DEVICES           │             DEVICES
                       │
              ┌────────┴────────┐
              ↓                 ↓
             ALU               CU
              │                 │
              └────────┬────────┘
                       ↓
                    MEMORY
                       │
                       ↓
                    STORAGE

1.3.2 Basic Components of a Computer

A computer system mainly consists of:

  1. Input Unit
  2. Central Processing Unit (CPU)
  3. Memory Unit
  4. Output Unit
  5. Storage Unit

1. Input Unit

Accepts data and instructions from the user.

Examples: Keyboard, mouse, scanner.

2. CPU

Processes instructions and controls the operation of the computer.

3. Memory

Stores data, instructions and intermediate results.

4. Output Unit

Provides processed results to the user.

Examples: Monitor, printer, speaker.

5. Storage

Stores data and programs for long-term use.

Examples: HDD, SSD, USB drive.


1.3.3 Von Neumann Architecture

One of the most important concepts in computer architecture is the Von Neumann architecture.

The Von Neumann model was proposed by John von Neumann and is based on the idea that instructions and data can be stored in the same memory.

Main Components

  1. Memory
  2. Control Unit
  3. ALU
  4. Input
  5. Output
                 ┌───────────────┐
                 │    MEMORY     │
                 │ Data +        │
                 │ Instructions  │
                 └───────┬───────┘
                         │
                         ↓
                ┌─────────────────┐
                │       CPU       │
                │                 │
                │  ┌─────┐ ┌────┐ │
                │  │ ALU │ │ CU │ │
                │  └─────┘ └────┘ │
                └───────┬─────────┘
                        │
              ┌─────────┴─────────┐
              ↓                   ↓
           INPUT                OUTPUT

Important Feature

Von Neumann architecture stores both data and instructions in the same memory.


1.3.4 Von Neumann Bottleneck

The Von Neumann architecture has an important limitation called the Von Neumann bottleneck.

The CPU and memory communicate through shared pathways. Since data and instructions must travel between memory and CPU, the speed of the overall system can be limited by this communication.

Simple Example

Imagine:

CPU ←────── Narrow Road ──────→ Memory

Even if the CPU is very fast, a limited communication path can reduce overall performance.

Exam Point

Von Neumann bottleneck = limitation caused by the limited data transfer between CPU and memory.


1.3.5 CPU — Central Processing Unit

The CPU (Central Processing Unit) is the main processing component of a computer.

It is often called the brain of the computer because it executes instructions and controls many operations.

Simple Definition

CPU is the component that executes instructions, performs calculations and controls the operation of the computer system.

Main Components of CPU

  1. ALU — Arithmetic Logic Unit
  2. CU — Control Unit
  3. Registers
                 CPU
                  │
       ┌──────────┼──────────┐
       ↓          ↓          ↓
      ALU         CU      Registers
       │          │          │
 Arithmetic     Control    Temporary
 & Logic        Signals     Data

1.3.6 Arithmetic Logic Unit — ALU

ALU = Arithmetic Logic Unit

The ALU performs:

Arithmetic Operations

  • Addition
  • Subtraction
  • Multiplication
  • Division

Logical Operations

  • AND
  • OR
  • NOT
  • XOR
  • Comparison operations

Example

If the CPU needs to calculate:

20 + 30

The operation is performed by the ALU.

Simple Definition

ALU is the part of CPU responsible for arithmetic and logical operations.


1.3.7 Control Unit — CU

The Control Unit (CU) controls and coordinates the activities of the computer.

It tells different components what to do and when to do it.

Main Functions

  • Fetches instructions from memory
  • Decodes instructions
  • Generates control signals
  • Controls data movement
  • Coordinates CPU, memory and I/O operations

Simple Example

Suppose the instruction is:

ADD A, B

The Control Unit:

  1. Fetches the instruction.
  2. Decodes it.
  3. Tells the ALU to perform addition.
  4. Controls movement of the required data.
  5. Helps store the result.

Easy Definition

CU controls the operation of the computer but does not normally perform arithmetic calculations itself.


1.3.8 Registers

Registers are very small and very fast storage locations inside the CPU.

They temporarily hold:

  • Data
  • Instructions
  • Addresses
  • Intermediate results

Why are registers important?

The CPU can access registers much faster than main memory.

Common Registers

1. Accumulator (ACC)

Stores intermediate arithmetic and logical results.

2. Program Counter (PC)

Stores the address of the next instruction to be executed.

3. Instruction Register (IR)

Stores the current instruction being executed or decoded.

4. Memory Address Register (MAR)

Stores the address of the memory location to be accessed.

5. Memory Data Register (MDR)

Stores data being transferred to or from memory.

6. Status/Flag Register

Stores information about the result of operations.

Examples of flags:

  • Zero flag
  • Carry flag
  • Sign flag
  • Overflow flag

1.3.9 CPU Working Cycle

The CPU generally works through the following basic cycle:

Fetch → Decode → Execute → Store

This is known as the instruction cycle.


Step 1: Fetch

The CPU gets the next instruction from memory.

Step 2: Decode

The Control Unit interprets the instruction.

Step 3: Execute

The required operation is performed.

Step 4: Store

The result is stored in a register or memory as required.

Example

Suppose the computer needs to perform:

5 + 3
Instruction
     ↓
   Fetch
     ↓
   Decode
     ↓
    ALU
     ↓
  5 + 3 = 8
     ↓
   Store

1.3.10 Instruction Cycle

The instruction cycle can be represented as:

       ┌─────────────┐
       │    FETCH    │
       └──────┬──────┘
              ↓
       ┌─────────────┐
       │   DECODE    │
       └──────┬──────┘
              ↓
       ┌─────────────┐
       │   EXECUTE   │
       └──────┬──────┘
              ↓
       ┌─────────────┐
       │    STORE    │
       └──────┬──────┘
              │
              └────→ Next Instruction

1.3.11 Control Unit Functions

The Control Unit performs several important functions.

1. Instruction Fetching

Gets instructions from memory.

2. Instruction Decoding

Determines what the instruction means.

3. Control Signal Generation

Generates signals to control different components.

4. Data Movement

Controls movement of data between:

  • CPU
  • Memory
  • Input devices
  • Output devices

5. Coordination

Coordinates the activities of ALU, registers, memory and I/O devices.


1.3.12 Types of Control Unit

There are two major types of Control Unit:

  1. Hardwired Control Unit
  2. Microprogrammed Control Unit

A. Hardwired Control Unit

A hardwired control unit uses fixed electronic logic circuits to generate control signals.

Advantages

  • Very fast
  • Efficient

Disadvantages

  • Difficult to modify
  • Complex for large instruction sets

B. Microprogrammed Control Unit

A microprogrammed control unit uses microinstructions stored in control memory to generate control signals.

Advantages

  • Easier to modify
  • Easier to design for complex instruction sets

Disadvantages

  • Generally slower than hardwired control

Comparison

Hardwired CUMicroprogrammed CU
Uses hardware logicUses microinstructions
Generally fasterGenerally slower
Difficult to modifyEasier to modify
Commonly associated with simpler instruction controlUseful for complex instruction sets

1.3.13 Computer Arithmetic

Computer arithmetic refers to the methods used by computers to perform arithmetic operations on binary numbers.

Computers internally use the binary number system.

The main arithmetic operations are:

  • Addition
  • Subtraction
  • Multiplication
  • Division

1.3.14 Binary Addition

Binary addition follows these basic rules:

ABSumCarry
0000
0110
1010
1101

Example

    1010
  + 0011
  ------
    1101

Therefore:

1010₂ + 0011₂ = 1101₂


1.3.15 Binary Subtraction

Basic rules:

ABDifferenceBorrow
0000
1010
1100
0111

Example

    1101
  - 0011
  ------
    1010

Therefore:

1101₂ − 0011₂ = 1010₂


1.3.16 Binary Multiplication

Binary multiplication is similar to decimal multiplication.

Important rules:

0 × 0 = 0
0 × 1 = 0
1 × 0 = 0
1 × 1 = 1

Example

       101
     ×  11
     -----
       101
      101
     -----
      1111

Therefore:

101₂ × 11₂ = 1111₂


1.3.17 Binary Division

Binary division follows the same basic concept as decimal long division.

Example:

1100 ÷ 10 = 110

Therefore:

1100₂ ÷ 10₂ = 110₂


1.3.18 Signed Number Representation

Computers need a way to represent both positive and negative numbers.

Common methods include:

  1. Sign-Magnitude
  2. One's Complement
  3. Two's Complement

Sign-Magnitude Representation

The most significant bit represents the sign.

0 → Positive
1 → Negative

The remaining bits represent the magnitude.

Example

For an 8-bit number:

00000101 = +5
10000101 = -5

1.3.19 One's Complement

The one's complement of a binary number is obtained by changing:

0 → 1
1 → 0

Example

Original:       00000101
One's complement:
                11111010

1.3.20 Two's Complement

Two's complement is widely used for representing signed integers.

Steps

  1. Find the one's complement.
  2. Add 1.

Example: Find two's complement of 00000101

Original:
00000101

One's complement:
11111010

Add 1:
00000001
---------
11111011

Therefore:

Two's complement = 11111011

Important

Two's complement = One's complement + 1


1.3.21 Input/Output Organization

Input/Output (I/O) organization refers to how a computer communicates with external devices.

Examples of I/O devices:

Input

  • Keyboard
  • Mouse
  • Scanner
  • Microphone

Output

  • Monitor
  • Printer
  • Speaker
  • Projector

1.3.22 I/O Module

An I/O module is a hardware component that acts as an interface between the CPU/memory and peripheral devices.

Simple Structure

CPU / Memory
     │
     ↓
  I/O Module
     │
     ├──── Keyboard
     ├──── Mouse
     ├──── Printer
     └──── Monitor

Functions of I/O Module

  • Communicates with CPU
  • Communicates with peripheral devices
  • Provides buffering
  • Controls data transfer
  • Detects errors
  • Provides status information

1.3.23 Methods of I/O Data Transfer

There are three important methods:

  1. Programmed I/O
  2. Interrupt-Driven I/O
  3. Direct Memory Access (DMA)

1.3.24 Programmed I/O

In Programmed I/O, the CPU continuously checks the status of an I/O device and controls the transfer.

Example

CPU repeatedly checks:

"Is the keyboard ready?"

If not:

"Check again."

This is also called polling.

Disadvantage

The CPU spends time waiting for the I/O device.


1.3.25 Interrupt-Driven I/O

In interrupt-driven I/O, the device sends an interrupt signal to the CPU when it needs attention or when an operation is ready.

Example

Instead of continuously checking the keyboard:

CPU → Continue other work

Keyboard → "I have data!"

CPU → Handles keyboard request

Advantage

CPU does not need to continuously wait for the device.


1.3.26 Direct Memory Access — DMA

DMA = Direct Memory Access

DMA allows an I/O device to transfer data directly to or from main memory with minimal CPU involvement.

Normal transfer

I/O Device → CPU → Memory

DMA transfer

I/O Device ─────────→ Memory
          DMA

The CPU mainly initializes and controls the DMA operation, while the DMA controller handles the actual data transfer.

Advantages

  • Faster data transfer
  • Reduces CPU workload
  • Useful for large blocks of data

Examples

DMA is useful for:

  • Disk transfers
  • Network transfers
  • Audio/video data
  • High-speed peripherals

1.3.27 Programmed I/O vs Interrupt I/O vs DMA

FeatureProgrammed I/OInterrupt I/ODMA
CPU involvementHighModerateLow during transfer
CPU waits/pollsYesNo continuous pollingNo
SpeedRelatively lowBetterHigh
Suitable forSimple transfersEvent-based I/OLarge/high-speed transfers

Easy Trick

Programmed I/O = CPU keeps checking

Interrupt I/O = Device calls CPU

DMA = Device transfers directly with memory


1.3.28 Memory Organization

Memory organization refers to how computer memory is arranged, addressed and accessed.

Memory stores:

  • Instructions
  • Data
  • Intermediate results
  • Programs

1.3.29 Memory Hierarchy

Computer memory is organized into levels according to:

  • Speed
  • Cost
  • Capacity

Memory Hierarchy

        Fastest
          ↑
       Registers
          ↓
         Cache
          ↓
          RAM
          ↓
       SSD / HDD
          ↓
      Backup/Archive
          ↓
        Slowest

General Rule

As we move down the hierarchy:

  • Speed generally decreases
  • Capacity generally increases
  • Cost per bit generally decreases

1.3.30 Registers

Registers are the fastest storage locations inside the CPU.

Features

  • Very fast
  • Very small capacity
  • Located inside CPU
  • Hold temporary data and instructions

1.3.31 Cache Memory

Cache memory is a small, high-speed memory located close to or integrated with the CPU.

It stores frequently or recently used data and instructions so the CPU can access them quickly.

Why is cache needed?

CPU is much faster than main memory.

Cache helps reduce the effective time needed to access frequently used information.

Levels of Cache

  • L1 Cache
  • L2 Cache
  • L3 Cache

Generally:

L1 is smaller and faster than L2, while L3 is generally larger and slower than L1/L2.


1.3.32 Main Memory

Main memory is the memory directly used by the computer during normal operation.

It mainly includes:

  1. RAM
  2. ROM

1.3.33 RAM

RAM = Random Access Memory

RAM stores programs and data that are currently being used by the CPU.

Features

  • Fast
  • Read/write
  • Volatile
  • Temporary storage
  • Usually larger than cache

Example

When you open Microsoft Word:

SSD/HDD
   ↓
 RAM
   ↓
 CPU

The program is loaded into RAM for active use.


1.3.34 Types of RAM

Two major types are:

1. SRAM

SRAM = Static Random Access Memory

  • Faster
  • More expensive
  • Does not require periodic refreshing in the same way DRAM does
  • Commonly used for CPU cache

2. DRAM

DRAM = Dynamic Random Access Memory

  • Slower than SRAM
  • Less expensive
  • Higher density
  • Requires periodic refreshing
  • Commonly used as main memory

SRAM vs DRAM

SRAMDRAM
FasterSlower
More expensiveLess expensive
Lower densityHigher density
Used commonly for cacheUsed commonly for main memory
Does not require refresh cycles like DRAMRequires periodic refresh

1.3.35 ROM

ROM = Read Only Memory

ROM is non-volatile memory used to store information that should remain available when power is turned off.

Traditionally, ROM referred to memory that was mainly read-only.

Modern systems commonly use forms of non-volatile memory such as flash memory for firmware.

Uses

  • Firmware
  • Boot-related programs
  • Embedded systems

1.3.36 Types of ROM

Common types include:

1. PROM

Programmable Read Only Memory

Can be programmed once after manufacturing.

2. EPROM

Erasable Programmable Read Only Memory

Can be erased, traditionally using ultraviolet light, and programmed again.

3. EEPROM

Electrically Erasable Programmable Read Only Memory

Can be erased and programmed electrically.

4. Flash Memory

A widely used form of electrically erasable non-volatile memory.

Used in:

  • SSDs
  • USB drives
  • Memory cards
  • Firmware storage

1.3.37 RAM vs ROM

RAMROM
VolatileNon-volatile
Read/write during normal operationTraditionally mainly read-oriented
Used for active programs/dataUsed for persistent firmware/data
Contents normally lost when power is removedContents retained without power
Generally larger in modern computersUsually smaller for firmware purposes

1.3.38 Memory Address

Each memory location has a unique address.

Think of memory like a large collection of numbered boxes.

Address       Data
1000          101010
1001          110011
1002          111000
1003          010101

The CPU uses the address to identify the location from which it wants to read or to which it wants to write.


1.3.39 Word

A word is the natural unit of data handled by a processor.

The word size depends on the architecture.

Examples:

  • 8-bit
  • 16-bit
  • 32-bit
  • 64-bit

Example

A 64-bit processor architecture generally has a 64-bit word size for many core operations, although specific implementation details can vary.


1.3.40 Memory Unit Conversion

Basic units:

1 Byte = 8 bits

Common decimal storage units:

1 KB = 1,000 Bytes
1 MB = 1,000 KB
1 GB = 1,000 MB
1 TB = 1,000 GB

Binary-based units use:

1 KiB = 1,024 Bytes
1 MiB = 1,024 KiB
1 GiB = 1,024 MiB
1 TiB = 1,024 GiB

Exam Note

Many traditional computer-fundamentals questions use 1 KB = 1024 bytes, but technically KiB is the correct term for 1024 bytes.


1.3.41 Buses

A bus is a communication pathway used to transfer data, addresses and control signals between computer components.

The three traditional categories are:

  1. Data Bus
  2. Address Bus
  3. Control Bus

1. Data Bus

Carries actual data between components.

CPU ↔ Memory

2. Address Bus

Carries the address of the memory or I/O location that the CPU wants to access.

CPU → Memory

3. Control Bus

Carries control signals.

Examples:

  • Read
  • Write
  • Interrupt
  • Clock-related control signals

1.3.42 Data Bus vs Address Bus vs Control Bus

BusMain Function
Data BusCarries data
Address BusCarries addresses
Control BusCarries control signals

Easy Trick

Data Bus = What?

Address Bus = Where?

Control Bus = How/When?


1.3.43 Computer Architecture — Complete Flow

A simple computer system works approximately like this:

        INPUT
          ↓
   ┌──────────────┐
   │    MEMORY    │
   └──────┬───────┘
          ↓
   ┌──────────────┐
   │     CPU      │
   │              │
   │ ALU + CU +   │
   │ Registers    │
   └──────┬───────┘
          ↓
        OUTPUT

Storage provides long-term data retention:

             CPU
              ↕
            Memory
              ↕
          SSD / HDD

⭐ 1.3.44 Important Comparisons

CPU vs ALU vs CU

CPUALUCU
Main processing unitPart of CPUPart of CPU
Contains ALU, CU, registersPerforms arithmetic/logicControls operations
Executes instructionsCalculates and comparesFetches/decodes and generates control signals

RAM vs Cache vs Register

RegisterCacheRAM
FastestVery fastSlower than cache/registers
SmallestSmallLarger
Inside CPUClose to/inside CPUMain memory
Holds immediate values/instructionsHolds frequently used data/instructionsHolds active programs/data

Easy Memory Hierarchy

Register → Cache → RAM → Secondary Storage

As you move right:

Capacity generally increases, speed generally decreases.


⭐ 1.3.45 Most Important Exam Questions

Long Questions

  1. What is computer architecture? Explain its major components.
  2. Explain Von Neumann architecture with a diagram.
  3. What is the Von Neumann bottleneck?
  4. What is CPU? Explain its major components.
  5. Explain ALU, Control Unit and registers.
  6. Explain the instruction cycle.
  7. Explain the functions of the Control Unit.
  8. Differentiate between hardwired and microprogrammed control units.
  9. What is computer arithmetic? Explain binary arithmetic.
  10. Explain binary addition and subtraction with examples.
  11. Explain sign-magnitude, one's complement and two's complement.
  12. What is I/O organization?
  13. Explain the functions of an I/O module.
  14. Explain programmed I/O, interrupt-driven I/O and DMA.
  15. What is DMA? Explain its advantages.
  16. What is memory organization?
  17. Explain memory hierarchy with a diagram.
  18. What is cache memory? Explain L1, L2 and L3 cache.
  19. Differentiate between SRAM and DRAM.
  20. Differentiate between RAM and ROM.
  21. Explain PROM, EPROM and EEPROM.
  22. What are data bus, address bus and control bus?
  23. Explain how CPU, memory and I/O devices communicate.
  24. Explain the complete instruction execution process.

🧠 1.3.46 Quick Revision — One Page

Computer Architecture

Design and organization of a computer system

CPU

Main processing unit

CPU consists mainly of:

ALU + CU + Registers

ALU

Performs arithmetic and logical operations

CU

Controls and coordinates computer operations

Register

Very small and very fast storage inside CPU

Instruction Cycle

Fetch → Decode → Execute → Store

Von Neumann Architecture

Data and instructions stored in the same memory

Von Neumann Bottleneck

Limited CPU–memory data transfer can restrict performance

Computer Arithmetic

Arithmetic operations performed using binary numbers

Addition | Subtraction | Multiplication | Division

Two's Complement

One's Complement + 1

I/O Organization

Communication between computer and peripheral devices

I/O Transfer Methods

Programmed I/O → Interrupt I/O → DMA

Remember:

Programmed I/O = CPU checks

Interrupt I/O = Device alerts CPU

DMA = Direct data transfer between I/O and memory

Memory Hierarchy

Fastest
   ↓
Registers
   ↓
Cache
   ↓
RAM
   ↓
SSD/HDD
   ↓
Slowest

RAM

Volatile working memory

ROM

Non-volatile memory traditionally used for persistent firmware/data

SRAM

Fast + Expensive + Cache

DRAM

Less expensive + Higher density + Main Memory

Buses

Data Bus = Data

Address Bus = Location

Control Bus = Control Signals 

Post a Comment

0 Comments