Computer Systems

Hardware and Software

Hardware

  • It includes the physical components or parts of a computer that you can touch and see.

  • Examples:

    • Input Devices: allows users to input data. e.g. Keyboard, mouse, microphone

    • Output Devices: devices that output data from the system. e.g. Monitor, printer, speakers

    • Storage Devices: stores data. e.g. SSD, HDD, USB drive

    • Processing Devices: processes instructions and renders images. e.g. CPU, GPU

Software

  • Set of programs or instructions that control the hardware and are used to operate computers and perform tasks.

  • Types:

    • System Software: Operating systems, utilities, drivers

    • Application Software: Word processors, web browsers, games

Central Processing Unit (CPU)

Purpose

  • It is also known as the center, main processor, or brain of a computer. It executes instructions, processes data, and performs calculations.

Components

  • Control Unit (CU): Manages execution of instructions.

  • Arithmetic Logic Unit (ALU): Performs calculations and logic.

  • Registers: small and fast storage located within the CPU used to store temporary data.

  • Cache: a small and very fast memory that stores frequently accessed data.

Buses

  • Data Bus: Transfers data between the CPU and memory

  • Address Bus: Transfers memory addresses or location of data.

  • Control Bus: Sends control signals from CPU to other components.

The Fetch-Decode-Execute Cycle:

  • Fetch: Instruction is fetched from memory (RAM) into a register

  • Decode: Instruction fetched is interpreted by the Control unit.

  • Execute: the CPU carries out Instruction decoded.

Von Neumann Architecture

  • A computer design model where the CPU uses a single or shared memory space to store both instructions and data.

  • Uses a single bus system for fetching both instructions and data.

  • Registers involved:

    • PC (Program Counter): Tracks the next instruction address.

    • MAR (Memory Address Register): Holds address of data to be fetched.

    • MDR (Memory Data Register): stores data being transferred to or from memory.

    • Accumulator: Stores intermediate data results.

Logic gates

  • A group of transistors connected together to give one or more outputs, each output based on the input or combination of inputs supplied to it.

  • Types:

    • AND gates- output is 1 or TRUE only if both of the inputs are 1.

    • OR gates- The output is 1 only if either or both of the inputs are 1.

    • NOT gates- the output is 1 if the input is 0 (FALSE), and the output is 0 if the input is 1.

    • XOR gates- The XOR gate outputs 1 when any input is 1. But unlike the OR gate, when both input 1 , the OUTPUT is 0.

Memory and Storage

Primary Storage

  • RAM (Random Access Memory):

    • Volatile memory – loses its contents when power is off.

    • Stores data and instructions currently in use.

  • ROM (Read-Only Memory):

    • Non-volatile memory – keeps its contents when power is off.

    • Used to store the BIOS/firmware

Secondary Storage

  • Used for long-term data storage and stores data and programs not currently in use.

  • Types:

    • Magnetic storage:

      • Uses spinning magnetic disks.

      • Large capacity, cheaper per GB, but slower and has moving parts

      • Example: Hard drive disks

    • Optical storage:

      • Uses lasers to read/write data.

      • Low cost, but limited storage capacity and slow speed.

      • Example: CDs or DVDs

    • Solid-State storage:

      • Uses flash memory.

      • Fast access times, durable (no moving parts), but more expensive per GB.

      • Example: SSDs and USB flash drives

Tertiary Storage:

  • Primarily used for backup, e.g. magnetic tape.

Embedded Systems

  • Computers within a larger system, dedicated to perform specific tasks.

  • Examples:

    • Washing machines, microwaves,

  • Features:

    • Limited functions

    • Low power

    • Real-time performance

    • Reliable and cheap

System Software

Operating System (OS)

  • Software that manages computer hardware and software resources.

  • Functions:

    • Memory management

    • Processor management

    • File and disk management

    • User interface (GUI/CLI)

    • Security management

    • Multitasking

Utility Software:

  • Tools to maintain and optimize system performance

  • Examples:

    • Antivirus

    • File compression

    • Backup software

    • Disk defragmentation

Factors Affecting CPU Performance

  • Clock Speed: Measured in GHz. Determines how many instructions per second the CPU can process.

  • Number of Cores: Each core can execute instructions independently. More cores means more multitasking.

  • Cache Size: Bigger cache reduces time the CPU spends accessing data from RAM.

  • Processor Architecture: Affects efficiency of instruction handling

The Basic Input Output System

  • Firmware stored in ROM. It initializes hardware during the startup process and loads the bootloader that launches the operating system

  • Functions:

    • Performs Power-On Self-Test (POST) to check hardware.

    • Loads bootloader to start the operating system.

    • Provides basic hardware control before the OS takes over..

Virtual Memory

  • Used when RAM is full.

  • Part of the secondary storage is used as extra RAM.

  • Slower than actual RAM.

  • Can cause disk thrashing if overused.