Lecture 2 CompSci

Introduction to Computers

Definition of a Computer

  • A computer is defined as a device that:

    • Takes input

    • Processes this input according to stored instructions

    • Produces results as output.

Computer Hardware

Components of Hardware

  • Hardware refers to all electronic and mechanical equipment in a computer, including:

    • Storage: Hard disk

    • Memory: RAM

    • Processor: CPU (Central Processor Unit)

    • Input Devices: Keyboard, mouse

    • Output Devices: Monitor

    • Cables

Basic Computer Organization

Structure of a Computer System

  • Key components include:

    • CPU/Processor

    • Memory Subsystem

    • I/O Devices

Data Buses

  • Address Bus: Carries the address to access data

  • Data Bus: Transmits the actual data

  • Control Bus: Carries control signals

Central Processing Unit (CPU)

Function of the CPU

  • The CPU executes programs by performing four main steps:

    1. Fetch: Retrieve an instruction from program memory.

    2. Decode: Break down the instruction into parts relevant to the CPU.

    3. Execute: Different portions of the CPU perform the required operations.

    4. Write Back: Store the results of execution if necessary.

Organization of the CPU

  • Components include:

    • Control Unit: Directs the execution of instructions.

    • Execution Units: Perform specific operations (e.g., arithmetic).

    • Register File: Contains information necessary for current instruction execution.

Memory Subsystem

Types of Memory

  • Memory is organized into numbered storage locations:

    • Nonvolatile Memory:

      • Retains data when the system is shut down.

      • Typically has a higher capacity yet slower than volatile memory.

    • Volatile Memory (Primary Memory):

      • Loses data when powered off.

      • Examples include Cache Memory and RAM.

Primary Memory

  • Essential for CPU functionality and directly connected to it.

  • Types include:

    • Registers: Store data the CPU needs for instructions.

    • Main Memory: Contains currently executed programs and operational data.

    • Cache Memory: A fast, small internal memory enhancing CPU performance.

Input/Output Subsystem

I/O Devices

  • Input Devices: Feed data into the computer (e.g., keyboard, mouse).

  • Output Devices: Display or transmit information back to the user (e.g., monitors, printers).

  • I/O devices communicate with the processor via the I/O bus, commonly using PCI Express in PCs.

Summary of Key Components

  • Despite differences in hardware across computing devices, they all share core components:

    • CPU

    • RAM

    • I/O Devices

    • Busses