C Programming • Introduction to Computer, Programming & algorithms
C Programming / Architecture

Architecture

Notes 1 Introduction to Computer, Programming & algorithms

Computer Architecture refers to the design, structure, and organization of a computer system and the way its major components work together to execute programs.

Notes

Computer Architecture refers to the design, structure, and organization of a computer system and the way its major components work together to execute programs.

💡 In Simple Words

Computer Architecture is like the blueprint of a computer. It explains how the CPU, memory, input/output devices, and other components are organized and how they work together.

Computer Architecture

What is Computer Architecture?

Computer Architecture describes the design and functional behavior of a computer system. It explains how the processor, memory, input/output devices, instructions, and data are organized and how they interact while a program is executed.

It provides the programmer's view of a computer system and includes concepts such as instruction sets, data formats, registers, addressing methods, memory organization, and input/output mechanisms.

📌 Important Point

Architecture tells us what the system does, while organization explains how the hardware implements it.

Architecture vs Computer Organization

Computer Architecture Computer Organization
Describes the functional behavior and programmer-visible design of a computer. Describes how the hardware components are connected and implemented.
Concerned with what the system does. Concerned with how the system does it.
Includes instruction set, data formats, registers and addressing modes. Includes hardware connections, buses, control signals and implementation.

Instruction Set Architecture (ISA)

Instruction Set Architecture, commonly called ISA, defines the instructions and programmer-visible features that a processor supports.

It describes the instruction set, registers, data formats, addressing methods, and other features that software uses when communicating with the processor.

Examples of architectures include x86, ARM, MIPS, and RISC-V.

Von Neumann Architecture

Von Neumann Architecture is based on the stored-program concept. In this architecture, program instructions and data are stored in the same memory.

The CPU fetches instructions from memory one by one, decodes them, and executes them.

💡 In Simple Words

In Von Neumann Architecture, both instructions and data use the same memory. The CPU takes an instruction from memory, understands it, executes it, and then moves to the next instruction.

Characteristics of Von Neumann Architecture

  • A single memory stores both program instructions and data.
  • Instructions are executed sequentially.
  • CPU, memory and input/output devices communicate through the system bus.
  • The Fetch–Decode–Execute cycle is used to process instructions.
  • The shared memory and bus can create the Von Neumann bottleneck.

Functional Units of a Computer System

A computer system can be understood through five important functional units:

  1. Input Unit
  2. Memory Unit
  3. Arithmetic Logic Unit (ALU)
  4. Control Unit (CU)
  5. Output Unit
Functional Unit Main Function
Input Unit Accepts data and instructions from the user.
Memory Unit Stores data, instructions and results.
ALU Performs arithmetic and logical operations.
Control Unit Controls and coordinates computer operations.
Output Unit Presents processed information to the user.

CPU Organization

CPU organization describes the internal structure of the processor and how its different parts work together during instruction processing.

The major parts of CPU organization include:

  • Arithmetic Logic Unit (ALU)
  • Control Unit (CU)
  • Registers
  • Cache Memory
  • Internal data paths and buses
💡 In Simple Words

Inside the CPU, the ALU performs calculations, the Control Unit controls the operations, and registers temporarily hold important data and instructions.

Arithmetic Logic Unit (ALU)

The Arithmetic Logic Unit is the part of the CPU responsible for performing arithmetic and logical operations.

Arithmetic Operations

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • Increment
  • Decrement

Logical Operations

  • AND
  • OR
  • NOT
  • XOR
  • Comparison
  • Shift and Rotate operations
Operation Type Examples
Arithmetic +, −, ×, ÷, Increment, Decrement
Logical AND, OR, NOT, XOR
Comparison Equal, Greater than, Less than

Control Unit (CU)

The Control Unit manages and coordinates the activities of the computer system. It directs the flow of data and instructions between the CPU, memory and input/output devices.

Functions of Control Unit

  1. Fetch: Gets the required instruction from memory.
  2. Decode: Interprets the instruction and identifies the required operation.
  3. Execute: Sends appropriate control signals to the required units.
📌 Remember

The Control Unit controls and coordinates the operations of the computer. It does not perform the actual arithmetic calculations.

Registers and Their Types

Registers are small, high-speed storage locations inside the CPU. They temporarily hold data, instructions, addresses, and intermediate results during instruction execution.

Register Function
PC — Program Counter Stores the address of the next instruction.
IR — Instruction Register Stores the current instruction.
ACC — Accumulator Stores results produced by ALU operations.
MAR — Memory Address Register Stores the memory address being accessed.
MDR — Memory Data Register Stores data being transferred to or from memory.
Flag / PSW Stores status information such as zero, carry and sign.

Memory Organization

Memory organization explains how memory is structured and accessed according to speed, capacity and cost.

Faster memory is generally smaller and placed closer to the CPU, while slower storage provides larger capacity.

REGISTERS ↓ CACHE ↓ RAM ↓ SSD / HDD Fast → Slow Small → Large

Cache Memory

Cache memory is a small and fast memory located between the CPU and main memory. It stores frequently used data and instructions so that the CPU can access them more quickly.

Cache Levels

Level General Characteristic
L1 Cache Smallest and fastest cache, very close to the CPU core.
L2 Cache Larger than L1 and generally slower than L1.
L3 Cache Larger cache that may be shared among CPU cores.
💡 In Simple Words

Cache is like a small fast storage area kept close to the CPU so frequently needed information can be accessed quickly.

Input/Output Organization

Input/Output organization deals with communication between the CPU and peripheral devices such as keyboards, displays, printers, storage devices and other external devices.

Programmed I/O

In programmed I/O, the CPU checks the device and waits for it to become ready. This can keep the CPU busy while waiting.

Interrupt-Driven I/O

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

DMA — Direct Memory Access

DMA allows data to be transferred directly between an I/O device and memory with reduced involvement of the CPU.

System Bus

A system bus provides the communication path between the CPU, memory and input/output devices.

Bus Direction Function
Data Bus Bidirectional Carries actual data between components.
Address Bus Unidirectional Carries memory or I/O addresses.
Control Bus Bidirectional Carries control and timing signals.
💡 In Simple Words

You can think of buses as communication roads inside the computer. They carry data, addresses and control signals between different components.

Fetch–Decode–Execute Cycle

The CPU processes an instruction through a basic cycle called the Fetch–Decode–Execute cycle.

Fetch Decode Execute Store Cycle

1. Fetch

The CPU obtains the required instruction from memory. The Program Counter helps identify the address of the next instruction.

2. Decode

The Control Unit interprets the instruction and determines what operation needs to be performed.

3. Execute

The required operation is performed. For arithmetic and logical operations, the ALU performs the required calculation.

4. Store

The result is written back to a register or memory as required.

Instruction Processing

Instruction processing involves fetching an instruction, decoding the operation and operands, obtaining required data, executing the operation and storing the result.

Instruction Format

OPCODE + OPERANDS

The opcode identifies the operation to be performed, while the operand identifies the data or location involved.

Common Addressing Modes

  • Immediate: The operand value is given directly.
  • Direct: The address of the operand is specified directly.
  • Indirect: The specified location contains the address of the operand.
  • Register: The operand is stored in a CPU register.

Memory Hierarchy

Memory hierarchy arranges storage according to speed, size and cost. Faster memory is generally smaller and more expensive, while larger storage is slower and cheaper per unit of capacity.

Computer Memory Hierarchy
Memory Level General Characteristic
Registers Very small and extremely fast storage inside the CPU.
Cache Very fast memory that reduces CPU access time.
RAM Main working memory for active programs and data.
SSD Fast, non-volatile secondary storage.
HDD Large-capacity magnetic secondary storage.

Quick Revision

Concept Remember This
Computer Architecture Design and functional behavior of a computer system.
Von Neumann Program instructions and data share the same memory.
ALU Performs arithmetic and logical operations.
Control Unit Controls and coordinates operations.
Registers Very fast temporary storage inside CPU.
System Bus Data Bus + Address Bus + Control Bus.
Instruction Cycle Fetch → Decode → Execute → Store.
Memory Hierarchy Registers → Cache → RAM → SSD/HDD.

Important Exam Questions

Short Answer Questions

  1. What is computer architecture?
  2. What is the difference between architecture and organization?
  3. What is ISA?
  4. What is Von Neumann Architecture?
  5. Write the five functional units of a computer system.
  6. What is CPU organization?
  7. What is ALU?
  8. What is the function of the Control Unit?
  9. What are registers?
  10. What is cache memory?
  11. What is a system bus?
  12. Name the three types of system bus.
  13. What is DMA?
  14. What is the Fetch–Decode–Execute cycle?

Long Answer Questions

  1. Explain computer architecture and its major features.
  2. Explain the difference between computer architecture and computer organization.
  3. Explain Von Neumann Architecture with a suitable diagram.
  4. Explain the functional units of a computer system.
  5. Explain CPU organization and the functions of ALU and Control Unit.
  6. Explain registers and their important types.
  7. Explain memory organization and cache memory.
  8. Explain Data Bus, Address Bus and Control Bus.
  9. Explain the Fetch–Decode–Execute cycle in detail.
  10. Explain memory hierarchy and its importance.
🎥 Recommended Learning

After reading the topic, watch this easy Hindi explanation of a major Computer Architecture concept.

▶ Watch: Von Neumann Architecture in Computer Architecture — Hindi

📝 Handwritten Notes

A short handwritten-style revision sheet covering Computer Architecture, Von Neumann Architecture, CPU, buses and memory hierarchy will be provided here.

🧠 Mind Map

Use the mind map for quick revision of Computer Architecture, CPU, memory, buses and instruction processing.