Computer Architecture
1. Introduction to Computer Architecture
- Computer Architecture refers to the internal components of a computer and the relationships between them.
- Almost all computers share a similar foundational structure.
- A computer consists of three main components:
- Input/Output Unit
- Central Processing Unit (CPU)
- Memory Unit
2. Input and Output Units
Input Unit
- Definition: Hardware devices used to send data, instructions, or programs into the computer.
- Without an input unit, a computer would just be a display device like a TV, and the user could not perform any tasks.
- Key Function: It translates the data or commands given in human language into Binary Code that the computer (CPU) can understand.
- Primary Tasks:
- Accepts and reads instructions and data provided by the user.
- Converts this data into a format accepted by the computer.
- Sends the converted data to the CPU for further processing.
Output Unit
- Definition: Devices used to display the final results of data and instructions.
- Key Function: It takes the processed results from the computer (which are in binary code) and translates them into appropriate signals, languages, or images that humans can understand.
- Primary Tasks:
- Accepts the final results generated by the computer in binary form.
- Converts these binary results into a human-readable and understandable format.
- Presents or prints the converted results for the user.
Comparison Table: Input vs. Output Unit
| Feature |
Input Unit |
Output Unit |
| Basic Function |
Sends data and commands into the computer. |
Displays processed results from the computer. |
| Data Conversion |
Human Language $\rightarrow$ Binary Code. |
Binary Code $\rightarrow$ Human Readable Format. |
| Next Step in Flow |
Sends data to the CPU for processing. |
Presents or prints final data for the user. |
3. Central Processing Unit (CPU)
- Definition: The CPU is the primary processing unit and is commonly known as the "Brain of the Computer".
- In microcomputers, the CPU is also called a Microprocessor.
- Core Responsibilities:
- Controls all internal and external devices of the computer.
- Performs all arithmetic and logical operations.
- Decodes and executes instructions.
- Major Functions:
- Transfers data and instructions from the Main Memory into registers.
- Executes instructions sequentially.
- Transfers output data from registers back to the main memory when required.
Three Main Components of the CPU:
A. Arithmetic and Logical Unit (ALU)
- Function: Performs all arithmetic operations (addition, subtraction, multiplication, division) and logical comparisons (identifying if numbers are smaller, larger, or equal).
- Mechanism: Operates using the binary system. It is made up of electronic circuits that take two numbers and produce their sum, difference, product, or quotient.
- Contains special bytes called Registers to temporarily store incoming numbers and operational results.
B. Registers
- Definition: The fastest, temporary storage devices located at the highest level of the computer's memory hierarchy.
- Purpose: They provide the CPU with the fastest access path to use data, ensuring high-speed execution of programs.
C. Control Unit (CU)
- Definition: The most crucial part of the CPU, acting as a supervisor that monitors and coordinates all parts of the computer.
- Functions:
- Reads programs from memory sequentially, analyzes them, and ensures their execution.
- Issues exact commands to other parts of the computer (e.g., instructing the memory to store data or send it to the ALU).
- Handles the flow of input and routes final results/messages to the output unit.
4. Microprocessor
- Definition: A programmable digital electronic component built on a semiconductor integrated circuit (IC) that performs all CPU functions.
- It acts as the heart and brain of microcomputers and only understands Machine Language.
- Math Processor: Sometimes, a separate math processor is added to handle complex calculations.
- Important Examples:
- Intel 4004: The very first microprocessor that combined all CPU components onto a single chip.
- Modern Examples: Intel Dual Core, Pentium IV.
5. Memory Unit
- Definition: The part of the computer that stores data and instructions.
- It provides the facility of "Information Retention," which is a fundamental function of modern computers.
- Classification: Memory is divided into two parts:
- Primary Memory
- Secondary Memory
Primary Memory (Main/Internal Memory)
- Connection: Directly connected to the CPU. The CPU continuously reads and executes instructions from it.
- Nature: Very fast processing speed but has a limited storage size.
- Function: Temporarily stores active programs, their input data, and outputs. Once the task is finished, the old data is removed to make space for new programs.
- What it Stores:
- All data to be processed and input instructions.
- Intermediate processing results.
- Final results (kept safely until sent to the output device).
- Types of Primary Memory:
- Random Access Memory (RAM)
- Read Only Memory (ROM)
Random Access Memory (RAM)
- Composition: Located on a chip made of Metal-Oxide Semiconductor (MOS). It consists of registers and connected circuits that allow data transfer.
- Functionality: Users can select any memory location and directly access it to either read data from it or store data into it.
- Addressing: Every memory location in RAM has a specific address, allowing the CPU to quickly locate and access required data.
- Volatility: RAM is temporary (volatile) memory; all stored information is lost as soon as the computer's power is turned off.
- Functionality: Data and programs are sectioned systematically so the CPU can fetch and store information via the data bus using specific memory addresses.
2. Instruction Format
- Computers only understand instructions in the form of 0s and 1s, which is called Machine Language.
- A computer program is a set of instructions detailing the exact steps needed to complete a task.
- Any processor requires two types of inputs to function:
- Data
- Instruction (Tells the computer what action to perform)
- Parts of an Instruction: An instruction is divided into two main parts:
- Op-code (Operation): The actual action or operation to be performed.
- Operand: The data or variables on which the operation is performed.
- Example: In "$A + B$", '$A$' and '$B$' are the operands, and '$+$' is the op-code.
3. The Instruction Cycle
- The Control Unit (CU) is known as the "Nervous System" of the computer because all commands pass through it.
- The sequence of processing an instruction is called the Instruction Cycle, which consists of four main steps:
| Step |
Phase Name |
Description |
Cycle Type |
| 1 |
Fetching |
Retrieves the instruction from memory and brings it to the Instruction Register. |
Fetch Cycle (Same for all instructions) |
| 2 |
Decoding |
Interprets and decodes the fetched instruction. |
Fetch Cycle (Same for all instructions) |
| 3 |
Read Effective Address |
If the instruction uses an indirect address, it reads the actual address from memory. |
Execute Cycle (Varies per instruction) |
| 4 |
Execution |
Executes the operation defined by the instruction. |
Execute Cycle (Varies per instruction) |
4. Read Only Memory (ROM)
- Definition: Pre-written memory that can only be read, not erased or modified by standard computer operations.
- Nature: It is Permanent (Non-Volatile); data remains safe even when the power is turned off.
- Applications: Extensively used in electronic devices like calculators, video games, and digital cameras.
- BIOS (Basic Input-Output System): Older personal computers stored the BIOS in ROM. It acted as a translator between the PC's hardware and the Operating System and contained the boot program.
5. Secondary (External) Memory
- Why is it needed?: Main memory (RAM) is very expensive, has limited capacity, and is volatile. Secondary memory solves these issues.
- Characteristics:
- Located outside the CPU (External Memory).
- Highly cost-effective with massive storage capacity.
- Permanent storage (Non-volatile).
- Drawback: Read and write times are much slower compared to main memory.
- Usage: Primarily used for long-term storage and Backups of data that is not immediately needed, freeing up active space.
- Examples: Punched cards, paper tape, and magnetic tapes were used historically. Today, Magnetic Disks (like Hard Drives) are predominantly used due to convenience.
6. The Motherboard
- Definition: The central, most important printed circuit board (PCB) in a computer, originating around 1974 for microcomputers.
- Other Names: Mainboard, Baseboard, System Board, or Logic Board.
- Function: Provides the essential electronic and logical connections to link all system components together.
- Connected Components: It houses the Microprocessor (CPU) and Main Memory, and connects to external storage, video/sound controllers, and I/O devices via ports and cables.
7. System Bus (Data & Signal Transmission)
- Definition: A bus is a collection of wires or connections that act as a transmission medium to carry signals, data, and instructions between the CPU, memory, and peripheral devices.
- Types of Buses:
A. Internal Bus (System Bus)
- Connects internal motherboard components (like CPU and System Memory).
- Key Internal Buses include:
- Control Bus: Carries control instructions to memory and I/O devices.
- Address Bus: Carries the specific memory addresses of I/O devices or memory locations.
- Data Bus: Responsible for safely transferring the actual data.
B. External Bus
- Connects external components to the motherboard, such as peripherals, ports, and expansion slots.
8. Important Terminology (For Quick Reference)
- Machine Cycle: The time it takes to bring two operands from registers, perform an ALU operation on them, and store the resulting data back into the register.
- Buffer: A temporary storage area within RAM used to hold data while it is being transferred from one place to another. Input data lands here first.
- System Performance: A computer's execution power depends heavily on the size/speed of its Registers, RAM, Cache Memory, and the System Clock speed.
- Sockets: The physical connecting points on the motherboard where microchips are installed.
- Clock: Often refers to the control unit / timing mechanism of a digital computer that synchronizes operations.
- Instruction Code: A specific grouping of bits that commands the computer to perform a targeted task.
- Processing Cycle: The total time taken by a device to locate data/instructions and deliver them to the CPU.
Quick Revision Summary (Key Takeaways)
- Computer Architecture = Input/Output Unit + CPU + Memory.
- Input Unit: Human readable $\rightarrow$ Binary.
- Output Unit: Binary $\rightarrow$ Human readable.
- CPU (Brain): Contains ALU (Math/Logic), Registers (Fast temporary storage), and Control Unit (Coordinator).
- Registers: Highest and fastest in the memory hierarchy.
- Microprocessor: A CPU on a single semiconductor IC. First ever was the Intel 4004.
- Primary Memory: Directly linked to CPU. Fast but temporary. Holds active data, instructions, and results.
- RAM: Random Access Memory made of MOS, allows direct reading and writing to any location.
- Instruction parts: Op-code (action) + Operand (data).
- Instruction Cycle: Fetch $\rightarrow$ Decode $\rightarrow$ Read Address $\rightarrow$ Execute.
- ROM vs. RAM: RAM is volatile and read/write; ROM is permanent (stores BIOS/boot programs) and read-only.
- Secondary Memory: High capacity, cheap, slow, and permanent. Great for backups (e.g., Magnetic Disks).
- Motherboard: The main circuit board connecting the CPU, memory, and all peripherals.
- System Bus: The wire pathways for data. Address Bus (locates data), Data Bus (moves data), and Control Bus (sends commands).
- Buffer: Temporary RAM storage for data in transit.
Comments
Post a Comment