Unit 1 - Notes

CSE111

Unit 1: Computer System

1. Basic Structure of a Computer and its Components

The computer system functions based on the Von Neumann Architecture, which describes a system where the CPU, memory, and I/O devices are connected via a system bus.

A. The Block Diagram of a Computer

A computer performs five major operations:

  1. Inputting: Accepting data/instructions.
  2. Storing: Saving data/instructions.
  3. Processing: Performing arithmetic or logical operations.
  4. Outputting: Displaying results.
  5. Controlling: Directing the sequence of operations.

B. Main Components

1. Input Unit

  • Function: Converts raw data from the outside world into a format the computer can understand (binary).
  • Examples: Keyboard, Mouse, Scanner, Microphone.

2. Central Processing Unit (CPU)

Known as the "brain" of the computer. It consists of three main sub-units:

  • Arithmetic Logic Unit (ALU):
    • Performs arithmetic operations (Addition, Subtraction, Multiplication, Division).
    • Performs logical operations (AND, OR, NOT, comparisons like <, >, =).
  • Control Unit (CU):
    • Decodes instructions.
    • Controls the flow of data between the CPU, memory, and peripherals.
    • Does not process data itself; it acts as a "traffic signal."
  • Registers:
    • High-speed, temporary storage locations directly inside the CPU.
    • Examples: Accumulator, Program Counter (PC), Memory Address Register (MAR).

3. Memory Unit

  • Stores data, instructions, and intermediate results.
  • Categorized into Primary and Secondary memory.

4. Output Unit

  • Function: Converts processed binary data into human-readable forms (text, images, sound).
  • Examples: Monitor, Printer, Speakers.

5. System Bus

The communication pathway connecting components:

  • Data Bus: Carries actual data.
  • Address Bus: Carries the location (address) of where data should go or come from.
  • Control Bus: Carries control signals (Read/Write commands).

2. Memories and its Types (RAM, ROM)

Computer memory is the storage space where data is to be processed and instructions required for processing are stored.

A. Primary Memory (Main Memory)

Directly accessible by the CPU. It is faster but usually volatile.

1. RAM (Random Access Memory)

  • Nature: Volatile (Data is lost when power is turned off).
  • Function: Read/Write memory. Stores data currently in use by the OS and applications.
  • Types of RAM:
    • SRAM (Static RAM): Uses flip-flops to hold data. Faster, consumes less power, but more expensive and less dense. Used for CPU Cache.
    • DRAM (Dynamic RAM): Uses capacitors to hold data. Must be constantly refreshed (recharged) or data fades. Slower but cheaper and higher density. Used for System Main Memory.

2. ROM (Read Only Memory)

  • Nature: Non-Volatile (Retains data without power).
  • Function: Read-only. Stores critical startup instructions (BIOS/UEFI) required to boot the computer.
  • Types of ROM:
    • PROM (Programmable ROM): Can be programmed once by the user; cannot be erased.
    • EPROM (Erasable Programmable ROM): Can be erased by exposing it to ultra-violet light and reprogrammed.
    • EEPROM (Electrically Erasable Programmable ROM): Can be erased and reprogrammed electrically. This is the technology behind Flash Memory (USB drives, SSDs).

3. Secondary Storage Devices

Secondary storage (Auxiliary memory) is non-volatile, has high capacity, and is slower than primary memory. It stores data permanently.

Classification of Secondary Storage:

  1. Magnetic Storage:
    • Hard Disk Drive (HDD): Uses magnetic platters to store data.
    • Magnetic Tape: Sequential access storage, used primarily for archival backup.
  2. Optical Storage:
    • Uses lasers to read/write data on discs.
    • CD (Compact Disc): ~700 MB.
    • DVD (Digital Versatile Disc): ~4.7 GB to 8.5 GB.
    • Blu-ray: ~25 GB to 50 GB (High definition storage).
  3. Solid State Storage (Flash Memory):
    • Uses electronic circuits (transistors) with no moving parts.
    • Examples: SSDs, USB Pen Drives, SD Cards.

4. SSD vs HDD

Comparison between Solid State Drives (SSD) and Hard Disk Drives (HDD).

Feature HDD (Hard Disk Drive) SSD (Solid State Drive)
Mechanism Mechanical. Uses spinning magnetic platters and a read/write head. Electronic. Uses NAND Flash memory chips. No moving parts.
Speed Slower. Latency exists due to seek time (head movement) and rotational latency. Extremely fast. Near-instant data access.
Durability Fragile. Susceptible to damage from drops or magnets. Durable. Resistant to shock and drops.
Noise Generates noise (spinning/clicking). Completely silent.
Power Consumes more power (motor required). Energy efficient.
Cost Cheaper per Gigabyte (GB). More expensive per Gigabyte (GB).
Form Factor Typically larger (3.5" for desktop, 2.5" for laptop). Smaller (2.5", M.2 sticks).
Fragmentation Performance suffers when files are fragmented. Fragmentation does not affect read speed significantly.

5. Processors and GPU

A. CPU (Central Processing Unit)

  • Role: General-purpose processor designed to handle a wide variety of tasks (OS operations, running applications).
  • Architecture: Optimized for serial processing (doing one complex thing after another very quickly).
  • Cores: Modern CPUs are Multi-core (Dual-core, Quad-core, Octa-core), allowing multiple instructions to be processed simultaneously.
  • Clock Speed: Measured in GHz (Gigahertz). Indicates how many cycles the CPU executes per second.

B. GPU (Graphics Processing Unit)

  • Role: Specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display device.
  • Architecture: Optimized for Parallel Processing. A GPU has thousands of smaller, less powerful cores designed to handle thousands of threads simultaneously.
  • Uses:
    • Rendering 3D graphics (Gaming).
    • Video editing/encoding.
    • Machine Learning and AI computations (Deep Learning).
    • Cryptocurrency mining.

Key Difference: A CPU is like a race car (fast, versatile, few passengers), while a GPU is like a bus (slower per unit, but carries massive amounts of data at once).


6. PC Connection Interfaces

Interfaces allow the computer to communicate with internal components and external peripherals.

A. Wired Interfaces

  1. USB (Universal Serial Bus):

    • Standard for connecting peripherals (Mice, Keyboards, Drives).
    • Data Transfer: Supports power and data.
    • Versions: USB 2.0 (480 Mbps), USB 3.0/3.1 (5-10 Gbps), USB 4.0 (40 Gbps).
    • Connector Types: Type-A (Rectangular), Type-B (Printers), Type-C (Reversible, high power/speed).
  2. SATA (Serial AT Attachment):

    • Bus interface for connecting host bus adapters to mass storage devices.
    • Used for connecting internal HDDs and SSDs to the motherboard.
    • Speed: SATA III supports up to 6 Gbps.
  3. HDMI (High-Definition Multimedia Interface):

    • Proprietary audio/video interface for transmitting uncompressed video data and compressed/uncompressed digital audio.
    • Connects PC to Monitors, TVs, and Projectors.

B. Wireless Interfaces

  1. Bluetooth:

    • Short-range wireless technology standard used for exchanging data between fixed and mobile devices.
    • Range: Typically 10 meters (Class 2).
    • Use: Connecting headphones, mice, keyboards, and transferring small files.
    • Uses UHF radio waves in the ISM bands (2.402 GHz to 2.48 GHz).
  2. NFC (Near Field Communication):

    • Set of communication protocols for communication between two electronic devices over a distance of 4 cm or less.
    • Mechanism: Electromagnetic induction.
    • Use: Contactless payments (Apple Pay, Google Pay), electronic identity tokens, keycards.

7. Introduction to RAID and RAID Levels

RAID stands for Redundant Array of Independent Disks. It is a data storage virtualization technology that combines multiple physical disk drive components into one or more logical units.

Purpose of RAID:

  1. Data Redundancy: To protect data in case of drive failure.
  2. Performance Improvement: To speed up read/write operations.

Key Concepts:

  • Striping: Splitting data across multiple disks (Increases speed).
  • Mirroring: Storing the same data on two or more disks (Increases safety).
  • Parity: Calculated data used to reconstruct information if a drive fails.

Common RAID Levels:

1. RAID 0 (Striping)

  • Mechanism: Splits data evenly across two or more disks.
  • Pros: Excellent performance (Read/Write speed is multiplied by number of drives).
  • Cons: No redundancy. If one drive fails, all data is lost.
  • Min Drives: 2.

2. RAID 1 (Mirroring)

  • Mechanism: Data is written identically to two (or more) drives.
  • Pros: High fault tolerance. If one drive fails, the system continues using the other.
  • Cons: Storage capacity is cut in half (2 x 1TB drives = 1TB usable space). Slower write speeds.
  • Min Drives: 2.

3. RAID 5 (Striping with Parity)

  • Mechanism: Stripes data and parity information across all drives.
  • Pros: Balanced performance and security. Can withstand one drive failure.
  • Cons: Write performance is slower due to parity calculation. Rebuilding a failed drive takes a long time.
  • Min Drives: 3.

4. RAID 6 (Striping with Double Parity)

  • Mechanism: Similar to RAID 5, but writes two parity blocks.
  • Pros: Extremely secure. Can withstand two simultaneous drive failures.
  • Cons: Slower write performance than RAID 5; expensive (needs more drives).
  • Min Drives: 4.

5. RAID 10 (RAID 1+0)

  • Mechanism: A combination of Striping and Mirroring. It stripes data across mirrored pairs.
  • Pros: Best of both worlds: Fast performance (like RAID 0) and high fault tolerance (like RAID 1).
  • Cons: Expensive. You only get 50% of the total disk capacity.
  • Min Drives: 4.