Computer Architecture [ Note of RBB (Rastriya Banijya Bank) ] | Note of Rastriya Banijya Bank

Anil Pandit
0

 

Computer Architecture

·         Computer Architecture is the design and organization of a computer system that describes how different components of a computer work together to perform tasks.

·         It defines the structure, functionality, and interaction of hardware components such as the CPU, memory, input/output devices, and storage systems.

·         Computer architecture acts as a blueprint that explains how instructions are processed and how data flows within a computer.

Main Components of Computer Architecture

1.      Central Processing Unit (CPU)

·         The CPU is the main processing unit of a computer.

·         It executes instructions and controls all operations.

·         It consists of:

§  Arithmetic Logic Unit (ALU):

ü  Performs arithmetic operations such as addition, subtraction, multiplication, and division.

ü  Performs logical operations such as comparison and decision-making.

§  Control Unit (CU):

ü  Controls and coordinates all activities of the computer.

ü  Manages the flow of data between CPU, memory, and input/output devices.

§  Registers: Small, high-speed storage locations inside the CPU.

2.      Memory Unit

§  Stores data, instructions, and results temporarily or permanently.

§  Includes:

1.      Primary Memory: RAM and ROM.

2.      Secondary Memory: Hard drives, SSDs, and other storage devices.

3.      Input Unit

·         Allows users to enter data and instructions into the computer.

·         Examples: Keyboard, mouse, scanner.

4.      Output Unit

·         Displays processed information to users.

·         Examples: Monitor, printer, speakers.

5.      System Bus

·         A communication pathway that transfers data, instructions, and signals between computer components.

Importance of Computer Architecture

·         Determines the speed and performance of a computer.

·         Helps in designing efficient computer systems.

·         Improves hardware and software compatibility.

·         Defines how data is processed and stored.

 

 

Registers

·         Registers are small, high-speed storage locations inside the CPU used to temporarily store data, instructions, and addresses during processing.

·         They provide faster access to information compared to main memory (RAM).

·         Registers help the CPU perform calculations, execute instructions, and control computer operations efficiently.

·         The size and number of registers affect the performance and speed of a processor.

·         Used in computers, smartphones, and other digital devices to improve processing speed.

Types of Registers

1. Accumulator (ACC)

        Stores intermediate results of arithmetic and logical operations.

        Helps the CPU perform calculations quickly.

        Used frequently by the Arithmetic Logic Unit (ALU).

2. Program Counter (PC)

        Stores the address of the next instruction to be executed.

        Helps the CPU execute instructions in the correct sequence.

        Automatically updates after each instruction is processed.

3. Instruction Register (IR)

        Holds the current instruction being executed by the CPU.

        Helps the control unit decode and process instructions.

        Ensures proper execution of program commands.

4. Memory Address Register (MAR)

        Stores the address of the memory location to be accessed.

        Helps the CPU locate data or instructions in memory.

        Used during read and write operations.

5. Memory Data Register (MDR)

        Stores data being transferred to or from memory.

        Acts as a temporary storage area during memory operations.

        Helps transfer information between CPU and memory.

6. General Purpose Registers (GPR)

        Store temporary data and intermediate results during processing.

        Can be used for various operations by programs.

        Improve the efficiency of CPU operations.

 

 

Memory Management

        Memory management is the process of controlling and organizing the computer's main memory (RAM) by the operating system.

        It manages the allocation and deallocation of memory space to different programs and processes.

        Ensures that programs get enough memory to run efficiently and prevents memory conflicts.

        Improves system performance by using memory resources effectively.

        Handles tasks such as memory allocation, memory protection, and virtual memory management.

Functions of Memory Management

1. Memory Allocation

        Assigns memory space to programs and processes when they need it.

        Ensures efficient use of available memory resources.

        Releases memory when a program finishes execution.

2. Memory Deallocation

        Removes unused memory from completed processes.

        Makes memory available for other programs.

        •Prevents unnecessary memory usage.

3. Memory Protection

        Prevents one process from accessing another process's memory without permission.

        Maintains security and stability of the system.

        Protects important operating system data.

4. Virtual Memory Management

        Uses a portion of secondary storage as an extension of RAM.

        Allows larger programs to run even when physical memory is limited.

        Improves multitasking capability of the computer.

5. Address Translation

        Converts logical addresses generated by programs into physical memory addresses.

        Helps the CPU access the correct memory location.

        Managed using techniques such as paging and segmentation.

Types of Memory Management Techniques

1. Paging

        Divides memory into fixed-size blocks called pages and frames.

        Allows efficient use of memory and reduces external fragmentation.

        Commonly used in modern operating systems.

 

2. Segmentation

        Divides memory into variable-sized segments based on program structure.

        Helps organize programs into logical parts such as code, data, and stack.

        Provides better memory organization.

3. Swapping

        Temporarily moves processes between RAM and secondary storage.

        Helps manage limited memory resources.

        Allows multiple programs to run simultaneously.

Importance of Memory Management

        Improves computer performance and speed.

        Allows multiple programs to run at the same time.

        Prevents memory wastage and conflicts.

        Provides security and efficient use of memory resources.

Types of Computer Memory

Computer memory is divided into two main categories: Primary Memory and Secondary Memory.

1. Primary Memory (Main Memory)

        Primary memory is the main storage area directly accessed by the CPU.

        It stores data and instructions that are currently being processed.

        It is faster than secondary memory but has limited storage capacity.

Types of Primary Memory

a. RAM (Random Access Memory)

        RAM is a temporary (volatile) memory used to store data and programs currently in use.

        Data is lost when the computer is turned off.

        Examples include Dynamic RAM (DRAM) and Static RAM (SRAM).

b. ROM (Read Only Memory)

        ROM is a permanent (non-volatile) memory that stores important instructions.

        Data remains stored even when power is turned off.

        Used to store firmware and boot instructions.

c. Cache Memory

        Cache is a high-speed memory located near or inside the CPU.

        Stores frequently used data and instructions for faster access.

        Improves the overall performance of the computer.

 

 

d. Registers

        Registers are the fastest memory units located inside the CPU.

        Temporarily store data, instructions, and processing results.

        Help the CPU execute operations quickly.

2. Secondary Memory (Auxiliary Memory)

        Secondary memory is used for permanent storage of data and programs.

        It has larger storage capacity but is slower than primary memory.

        Data remains stored even when the power is turned off.

Types of Secondary Memory

a. Hard Disk Drive (HDD)

        Stores large amounts of data permanently.

        Uses magnetic storage technology.

        Commonly used for operating systems, software, and files.

b. Solid State Drive (SSD)

        Uses flash memory to store data.

        Faster and more reliable than traditional hard disks.

        Commonly used in modern computers and laptops.

c. Optical Storage

        Stores data using laser technology.

        Examples include CDs, DVDs, and Blu-ray discs.

        Used for media storage and data backup.

d. USB Flash Drive

        A portable storage device used to transfer and store data.

        Uses flash memory technology.

        Provides convenient data storage and sharing.

e. Memory Card

        A small portable storage device used in cameras, smartphones, and other devices.

        Provides additional storage capacity.

        Examples include SD cards and microSD cards.

Organization of Hard Disk

        A hard disk is organized into several parts that work together to store and retrieve data efficiently.

        Data is stored magnetically on rotating platters and accessed by read/write heads.

        The organization of a hard disk helps the operating system locate and manage stored files.

 

Components of Hard Disk Organization

1. Platters

        Platters are circular magnetic disks where data is permanently stored.

        A hard disk may contain one or more platters.

        Both sides of each platter can store data.

2. Tracks

        Tracks are concentric circular paths on the surface of a platter.

        Data is written and read along these circular paths.

        Each platter surface contains many tracks.

3. Sectors

        Sectors are small divisions of a track used to store data.

        Each sector stores a fixed amount of data, usually 512 bytes or 4096 bytes (4 KB).

        Sectors are the smallest physical storage units on a hard disk.

4. Clusters

        A cluster is a group of one or more sectors.

        The operating system stores files in clusters instead of individual sectors.

        Larger files occupy multiple clusters.

5. Cylinder

        A cylinder is formed by tracks of the same position on all platters.

        It allows faster data access without moving the read/write head to another track.

        Cylinders help organize data across multiple platters.

6. Read/Write Head

        A read/write head reads data from and writes data to the platter surface.

        Each platter surface has its own read/write head.

        The heads move across the platters to access different tracks.

7. Spindle

        The spindle holds the platters together and rotates them at high speed.

        Common speeds are 5400 RPM and 7200 RPM.

        Faster rotation provides quicker data access.


Importance of Hard Disk Organization

        Enables efficient storage and retrieval of data.

        Improves file management and disk performance.

        Reduces the time required to access stored information.

        Supports reliable and organized data storage.

Working of Hard Disk

        The platter rotates at high speed using the spindle.

        The read/write head moves over the platter surface.

        The head reads data from or writes data to specific tracks and sectors.

        The disk controller manages the data transfer between the hard disk and computer.

 

CPU Architecture

        CPU (Central Processing Unit) architecture refers to the design and organization of the internal components of a processor.

        It defines how the CPU processes instructions, manages data, and communicates with other computer components.

        CPU architecture determines the speed, performance, and efficiency of a computer system.

        It includes components such as the Control Unit, Arithmetic Logic Unit, Registers, and Cache Memory.

        Modern CPUs use advanced architectures to perform multiple operations quickly and efficiently.

Components of CPU Architecture

1. Control Unit (CU)

        Controls and coordinates all activities of the CPU.

        Fetches instructions from memory and decodes them for execution.

        Manages the flow of data between CPU, memory, and input/output devices.

2. Arithmetic Logic Unit (ALU)

        Performs arithmetic operations such as addition, subtraction, multiplication, and division.

        Performs logical operations such as comparisons and decision-making.

        Processes data according to instructions provided by the Control Unit.

3. Registers

        Small and high-speed storage locations inside the CPU.

        Temporarily store data, instructions, and intermediate results.

        Help the CPU execute instructions faster.

4. Cache Memory

        A high-speed memory located inside or near the CPU.

        Stores frequently used data and instructions.

        Reduces the time needed to access information from main memory.

5. Buses

        Buses are communication pathways that transfer data between CPU and other components.

        Data Bus transfers actual data.

        Address Bus carries memory addresses.

        Control Bus carries control signals.

 

CPU Instruction Cycle

1. Fetch

        The CPU retrieves an instruction from memory.

        The address of the instruction is stored in the Program Counter (PC).

2. Decode

        The Control Unit interprets the instruction.

        Determines what operation needs to be performed.

3. Execute

        The CPU performs the required operation using the ALU or other components.

        Results are stored in registers or memory.

4. Store

        The result of the operation is saved for future use.

 

 

 

Types of CPU Architecture

1. Von Neumann Architecture

        Uses a single memory unit to store both data and instructions.

        Data and instructions are transferred through the same bus.

        Works on the fetch-decode-execute cycle.

        It is simple, cost-effective, and widely used in general-purpose computers.

        A limitation is the Von Neumann bottleneck, where data and instructions compete for the same memory path.

        Used in desktop computers, laptops, and many general-purpose systems.

2. Harvard Architecture

        Uses separate memory units for data and instructions.

        Has separate buses for transferring data and instructions.

        Allows data and instructions to be accessed simultaneously.

        Provides faster processing compared to Von Neumann architecture.

        Commonly used in microcontrollers, embedded systems, and digital signal processors.

3. RISC Architecture (Reduced Instruction Set Computer)

        Uses a small set of simple instructions.

        Instructions are executed quickly, usually in a single clock cycle.

        Requires fewer transistors and provides high efficiency.

        Uses more registers to improve performance.

        Examples: ARM processors used in smartphones and tablets.

4. CISC Architecture (Complex Instruction Set Computer)

        Uses a large set of complex instructions.

        A single instruction can perform multiple operations.

        Reduces the number of instructions needed to complete a task.

        Requires more hardware complexity.

        Examples: x86 processors used in personal computers.

Difference Between RISC and CISC

RISC                                                               CISC

Uses fewer and simpler instructions    Uses many complex instructions

Faster execution of instructions                       Instructions may take more cycles

Uses more registers                              Uses fewer registers compared to RISC

Lower power consumption                  Higher power consumption

Example: ARM                                                Example: x86

 

 

I/O Management

        I/O (Input/Output) Management is the function of an operating system that controls and manages communication between the CPU, memory, and input/output devices.

        It provides a standard way for applications to interact with hardware devices.

        Ensures efficient data transfer between the computer and external devices.

        Manages device allocation, device drivers, buffering, and error handling.

        Improves the performance and reliability of input/output operations.

Functions of I/O Management

1. Device Control

        Controls and coordinates the operation of input and output devices.

        Sends commands to devices through device drivers.

        Ensures devices work properly with the operating system.

2. Device Scheduling

        Determines the order in which I/O requests are processed.

        Reduces waiting time and improves system performance.

        Manages multiple requests from different programs.

3. Buffering

        Uses temporary memory areas to store data during transfer.

        Helps match the speed difference between CPU and I/O devices.

        Improves efficiency of data transfer operations.

4. Error Handling

        Detects and manages errors during I/O operations.

        Reports device failures and communication problems.

        Helps maintain system reliability.

 

I/O Interface

        An I/O Interface is a hardware or software connection between the CPU and input/output devices.

        It allows communication and data exchange between the computer system and external devices.

        Converts signals and data formats so devices can communicate with the CPU.

        Provides control signals, status information, and data transfer mechanisms.

Components of I/O Interface

1. Data Register

        Stores data being transferred between CPU and I/O devices.

        Acts as a temporary storage area during communication.

2. Status Register

        Stores information about the current condition of an I/O device.

        Indicates whether a device is ready, busy, or has an error.

3. Control Register

        Stores commands and control information sent to devices.

        Helps the CPU manage device operations.

 

I/O Requests Handling

        I/O request handling is the process of managing requests made by programs to perform input or output operations.

        The operating system manages these requests using device drivers and I/O controllers.

Steps of I/O Request Handling

1. Request Generation

        A program sends an I/O request to the operating system.

        The request specifies the required operation and device.

2. Request Processing

        The operating system checks the request and identifies the required device.

        It communicates with the device driver to perform the operation.

3. Device Operation

        The device controller performs the requested input or output task.

        Data is transferred between the device and memory.

4. Completion and Notification

        The device sends a signal when the operation is completed.

        The operating system informs the requesting program about the result.

I/O Devices

        I/O devices are hardware components used to provide input to and receive output from a computer system.

        They allow users and computers to communicate with each other.

Types of I/O Devices

1. Input Devices

        Used to enter data and instructions into a computer.

        Convert user actions into digital signals.

        Examples: Keyboard, mouse, scanner, microphone, webcam.

2. Output Devices

        Used to display or produce processed information.

        Convert digital data into a human-readable form.

        Examples: Monitor, printer, speakers, projector.

3. Storage Devices

        Used to store and retrieve data permanently or temporarily.

        Provide additional storage capacity for computers.

        Examples: Hard disk, SSD, USB flash drive, memory card.

 

Importance of I/O Management

        Provides communication between CPU and external devices.

        Improves speed and efficiency of data transfer.

        Allows multiple devices to work together smoothly.

        Ensures proper control and error handling of I/O operation.


 


Post a Comment

0Comments

Post a Comment (0)