Computer systems consist of physical components working together to process data and execute instructions. Understanding hardware architecture is fundamental to computer science education.
Central Processing Unit (CPU)
The CPU serves as the brain of the computer, executing instructions and performing calculations. It contains several critical subcomponents:
Directs the flow of data between CPU, memory, and peripherals; fetches and decodes instructions
Registers
Small, high-speed storage locations within the CPU that hold data currently being processed
Cache
Fast memory located on or near the CPU that stores frequently accessed data and instructions
The CPU operates through the fetch-decode-execute cycle. During fetch, the control unit retrieves an instruction from memory. During decode, the instruction is interpreted to determine what operation to perform. During execute, the ALU or other components carry out the instruction.
Clock speed, measured in gigahertz (GHz), indicates how many cycles per second the CPU can perform. Higher clock speeds generally mean faster processing, but other factors like core count, cache size, and architecture also affect performance.
Modern CPUs contain multiple cores, allowing parallel execution of instructions. A quad-core processor can theoretically execute four instruction streams simultaneously, improving performance for multitasking and parallelizable workloads.
The instruction (fetch–decode–execute) cycle
Simplified schematic for study purposes; not to scale.
Memory Hierarchy
Computer memory exists in a hierarchy based on speed, cost, and capacity:
Registers
Fastest, smallest capacity, located in CPU
Cache (L1, L2, L3)
Very fast, small capacity, stores frequently used data
RAM (Random Access Memory)
Fast, moderate capacity, volatile storage for active programs and data
Secondary Storage (SSD, HDD)
Slower, large capacity, non-volatile storage for files and programs
Tertiary Storage (tape, optical)
Slowest, largest capacity, used for archival purposes
RAM is volatile, meaning it loses contents when power is removed. ROM (Read-Only Memory) is non-volatile and contains firmware and boot instructions.
The memory hierarchy
Simplified pyramid for study purposes.
Key Point
Programs and data must be loaded into RAM before the CPU can work on them. Cache keeps copies of the data the CPU is most likely to need next, which is why a larger cache can speed up a slower clock.
Storage Devices
Hard Disk Drives (HDD) use spinning magnetic platters with read/write heads. They offer large capacities at low cost but have slower access times due to mechanical components.
Solid State Drives (SSD) use flash memory with no moving parts. They provide faster read/write speeds, lower power consumption, and greater durability but cost more per gigabyte.
Optical drives read and write CDs, DVDs, and Blu-ray discs using laser technology. Storage capacity ranges from 700 MB (CD) to 128 GB (Blu-ray).
Flash drives use USB connections and flash memory for portable storage. Memory cards (SD, microSD) serve similar purposes in cameras and mobile devices.
Input Devices
Input devices allow users to enter data and commands:
Keyboard
Primary text input device using mechanical or membrane switches
Mouse
Pointing device using optical or laser sensors to track movement
Touchscreen
Combines display and input through capacitive or resistive touch detection
Microphone
Converts sound waves to electrical signals for audio input
Scanner
Digitizes physical documents and images
Webcam
Captures video input for communication and recording