Computer Hardware, Architecture, and Basic Operations
Foundations of Computing & Data Representation
The Computer Hardware Cycle
- Every computing task operates through a fundamental four-stage cycle: Input Processing Memory / Storage Output.
- Input: Raw data and instructional signals enter the system via peripheral hardware devices.
- Processing: The Central Processing Unit (CPU) manipulates incoming raw data according to encoded program instructions.
- Memory / Storage: Serves as both an intermediate working workspace for active processing and a persistent repository for retained long-term data. Storage feeds directly back into the processing cycle, allowing saved data and operational results to be repeatedly reused.
- Output: Processed results and formatted information are delivered directly to human users or peripheral systems.
Digital Data Representation
- Digital computers are binary state systems that process information using two discrete electrical states represented as and .
- Bit: The absolute smallest unit of digital data, short for binary digit ( or ).
- Byte: A grouping of bits (), which represents a single character, number, or symbol in system memory.
- Data Measurement Hierarchies:
- Kilobyte (KB): Approximately ().
- Megabyte (MB): Approximately ().
- Gigabyte (GB): Approximately ().
- Terabyte (TB): Approximately ().
- Petabyte (PB): Approximately ().
- Universal Abstraction: All complex media types—including text characters, numeric arrays, high-resolution images, audio streams, and continuous video feeds—are ultimately reduced to structured sequences of binary data.
Binary Numbering & Encoding Systems
- Decimal System: Base- positional numbering system utilizing digits .
- Binary System: Base- positional numbering system utilizing digits and .
- Conversion Mechanics Example: Binary value maps to decimal based on positional powers of :
- Text Encoding Standards:
- ASCII (American Standard Code for Information Interchange): Traditional character coding standard used for legacy systems and basic English text.
- EBCDIC (Extended Binary Coded Decimal Interchange Code): Character encoding standard developed primarily for IBM mainframe environments.
- Unicode: Modern, comprehensive international encoding standard designed to uniquely represent characters from virtually every written language and script worldwide.
System Unit & Core Hardware Components

System Unit Overview
- The system unit is the main structural enclosure housing the primary internal electronic hardware components of a computer system. It forms an integrated environment that coordinates data reception, processing, storage, and signal transfer.
- Core Internal Hardware Components:
- Motherboard
- Central Processing Unit (CPU) / Microprocessor
- Main Memory (RAM)
- Power Supply Unit (PSU)
- Cooling Subsystems (Fans, Heat Sinks)
- Expansion Slots & Expansion Cards
- System Buses
- Peripheral Ports & Interface Connectors
Motherboard, Power, & Thermal Infrastructure
- Motherboard: The primary printed circuit board (PCB) inside the system unit. It provides physical mounting and high-speed electrical interconnections for the CPU, system memory, expansion cards, storage interfaces, power distribution, and external ports.
- Power Supply Unit (PSU) Converts high-voltage alternating current (AC) electrical grid power into low-voltage direct current (DC) required by internal microcircuits.
- Thermal Systems & Cooling: Modern microprocessors generate intense localized thermal energy during processing operations. Active cooling components—including aluminum/copper heat sinks, thermo-regulated cooling fans, and liquid cooling channels—are required to maintain stable operating temperatures and prevent hardware throttling or thermal destruction.
System Bus Architecture

* A **Bus** is a physical collection of parallel electrical traces/wires that provides communication pathways connecting the CPU, main memory, and peripheral controllers.
* **Address Bus**: Unidirectional pathway (CPU Memory / I/O Devices). It carries the memory address generated by the CPU specifying the exact target location for a read or write operation.
* **Data Bus**: Bidirectional pathway between CPU, Memory, and I/O devices. It carries the actual raw data values and instruction bit patterns being transferred across system components.
* **Control Bus**: Bidirectional pathway that carries control, timing, and status signals necessary to coordinate system operations. Key signals carried include **Read**, **Write**, **Clock Synchronization**, and hardware **Interrupts**.
Central Processing Unit (CPU) Architecture & Execution
- CPU Fundamentals & Evolutionary Dynamics

* The Central Processing Unit (CPU) is the primary computational engine and decision-making unit of the computer system, composed internally of millions or billions of microscopic transistors.
* **Physical Evolution**:
* *Mid-20th-Century*: CPUs required multiple physical equipment racks filled with individual discrete circuit assemblies.
* *Modern Systems*: Highly miniaturized single integrated circuits housed on small flat square packages (approximately ) mounted directly onto motherboard CPU sockets.
* *Mobile/Smartphones/MIDs*: Miniaturized to approximately half the size of a postage stamp, commonly integrated as complete Systems-on-Chip (SoCs).
* **Microprocessors & Microcontrollers**:
* A **Microprocessor** incorporates full processing capabilities on a single integrated circuit package made economically viable by semiconductor advancements.
* When customized and embedded into specialized equipment outside general-purpose computers (e.g., appliances, vehicles, industrial tools), microprocessors are designated as **Microcontrollers** or **Embedded Computers**.
Core Functional Components of the Processor
- Control Unit (CU): The operational director of the processor. It fetches instructions from main memory, decodes their bit patterns, and directs the sequential movement of signals across the CPU, memory, and peripheral controllers.
- Arithmetic/Logic Unit (ALU): The computational execution core. It contains internal digital circuits that perform basic arithmetic calculations (addition, subtraction, multiplication, division) and logical evaluation operations (AND, OR, NOT, bitwise comparisons).
- Registers: Specialized, ultra-fast internal storage cells located directly within the CPU logic array. Registers hold active operands, temporary memory addresses, intermediate mathematical outputs, and execution state pointers.
- General-Purpose Registers: Serve as temporary operational staging areas for data currently being manipulated by the ALU.
- Program Counter (PC): Holds the memory address of the next instruction scheduled for execution.
- Instruction Register (IR): Holds the bit pattern of the instruction currently being decoded and executed.
Processor Performance Factors
- Clock Speed: The operating frequency of the system processor, measured in Megahertz (MHz) or Gigahertz (GHz). One GHz represents one billion clock cycles per second.
- Multi-Core Processor Architecture: Integrates multiple independent execution cores within a single physical processor chip package.
- Example: A Quad-core CPU contains separate physical processing cores capable of running multiple instruction streams concurrently.
- Holistic Performance Dynamics: High clock speed alone does not dictate overall system throughput. Overall performance depends on an integrated combination of: core count, microarchitecture, cache allocation, main memory bandwidth, storage access latency, Dedicated Graphics Processing Unit (GPU) capabilities, and bus width/frequency.
The Stored-Program Concept
- Historical Shift: Early electronic computing systems were fixed-function hardware platforms that required physical rewiring via plugboards and patch cables to alter computational routines.
- The Paradigm Shift: Introduced the foundational principle that computer programs (instruction sequences) can be numerically encoded and stored directly within main memory alongside operational data values.
- Historical Attribution: Strongly associated with mathematician John von Neumann, though developed concurrently by J. Presper Eckert and his engineering team.
- Operational Advantage: Eliminates hardware rewiring. Programs are modified simply by overwriting memory contents, allowing computers to switch execution tasks dynamically.
The Machine Cycle (Fetch-Decode-Execute)


* Every program instruction is executed by repeating a standard continuous machine cycle consisting of three distinct phases:
1. **Fetch**:
* The Control Unit queries main memory using the address stored in the **Program Counter (PC)**.
* The bit pattern residing at that memory address is transferred over the bus into the **Instruction Register (IR)**.
* The Program Counter is automatically incremented to point to the subsequent instruction location. (In a machine where each instruction spans , the counter increments by : ).
2. **Decode**:
* The Control Unit interprets the operational bit pattern residing inside the Instruction Register (IR).
* Separates the instruction into its **Operation Code (Opcode)**—defining *what action* to perform—and its **Operands**—specifying *which registers, memory addresses, or raw values* are involved.
3. **Execute**:
* The Control Unit routes control signals to activate internal circuits to execute the specified operation.
* Actions include reading memory into registers, performing ALU math/logic, writing register data to memory, or adjusting the Program Counter value.
* Upon completion, the machine cycle immediately repeats with another Fetch step.
- Step-by-Step Program Execution Walkthrough

* **Program Context**: A sequential program resides in main memory across byte locations through . The goal is to add the numeric contents of memory location to memory location and store the final sum in memory location . Initial Program Counter value set to
* **Trace of Instructions in Memory**:
* Address (Opcode : Load Register from memory address )
* Address (Opcode : Load Register from memory address )
* Address (Opcode : Add contents of Register and Register ; store sum in Register )
* Address (Opcode : Store contents of Register into memory address )
* Address (Opcode : Halt execution)
* **Execution Sequence**:
* **Cycle 1**:
* *Fetch*: Retrieve instruction from location into IR. advances from .
* *Decode*: Opcode parsed. Command: Load target Register with byte value from memory address .
* *Execute*: Memory address is read over bus; value copied into Register
* **Cycle 2**:
* *Fetch*: Retrieve instruction from location into IR. advances from .
* *Decode*: Opcode parsed. Command: Load target Register with byte value from memory address .
* *Execute*: Memory address is read over bus; value copied into Register
* **Cycle 3**:
* *Fetch*: Retrieve instruction from location into IR. advances from .
* *Decode*: Opcode parsed. Command: Add contents of Register and Register via ALU; store output in Register
* *Execute*: ALU processes ; output stored into Register
* **Cycle 4**:
* *Fetch*: Retrieve instruction from location into IR. advances from .
* *Decode*: Opcode parsed. Command: Store byte value from Register into target memory address
* *Execute*: Value in Register is written over data bus into main memory cell
* **Cycle 5**:
* *Fetch*: Retrieve instruction from location into IR. advances from .
* *Decode*: Opcode parsed. Command: HALT execution.
* *Execute*: CPU halts machine cycle processing. Program complete.
* *Final Result*: - Control Flow Modification & JUMP Instructions

* By default, the Program Counter increments sequentially through contiguous memory addresses. **JUMP** instructions allow conditional or unconditional branch redirects by explicitly altering the address stored in the Program Counter.
* **Conditional Jump Breakdown Example ()**:
* *Opcode *: Test comparison operation.
* *Operand Digit *: Identifies target comparison Register
* *Operand Address *: Destination address to copy into Program Counter if condition holds.
* *Logical Rule*: Compare contents of Register against Register .
* If : Set . The next fetch step retrieves an instruction directly from memory location
* If : Take no action. Program Counter continues standard incrementing sequence.
* **Unconditional Jump Breakdown Example ()**:
* Compares Register to Register .
* Since is always evaluate as True, opcode acts as an forced, **unconditional jump**, instantly setting under all operational conditions.
- Duality of Programs and Data
- Both instructions and operational data values reside in main memory as binary bit patterns. The underlying system hardware has no internal mechanism to distinguish program instructions from numeric data.
- If the Program Counter is improperly redirected to point at raw data cells, the processor will fetch and attempt to decode those data bit patterns as machine instructions.
- Design Implication: This functional equivalence allows software programs to treat other executable programs—or even their own instruction code—as modifiable data blocks, forming the foundation for modern compilers, software installers, operating system loaders, and self-modifying code routines.
Memory Hierarchy & Cache Microarchitecture
Memory vs. Mass Storage Differentiated
- Main Memory (RAM): High-speed, volatile working space used to hold active program instructions and real-time operational data required for immediate processor execution. Contents are erased when system power is removed.
- Mass Storage: High-capacity, nonvolatile retention media used to permanently store files, programs, operating systems, and user data across system power cycles.
Comprehensive Memory Hierarchy Spectrum
- Speed and cost per bit increase moving upward; capacity increases moving downward:
Cache Microarchitecture (Levels 1, 2, and 3)
- Cache memory is an ultra-fast static RAM (SRAM) array integrated directly inside or adjacent to processor cores. It buffers frequently queried instructions and data from main memory to minimize processor idle cycles caused by slower system RAM.

* **L1 Cache (Level 1)**:
* *Location*: Integrated directly inside each individual CPU execution core.
* *Speed & Latency*: Fastest cache level; matches native core execution speed ( access latency).
* *Typical Size*: per core.
* **L2 Cache (Level 2)**:
* *Location*: Situated inside each execution core or immediately adjacent on the silicon die.
* *Speed & Latency*: Medium-fast speed ( access latency).
* *Typical Size*: per core. Serves as a primary fallback array to catch data requests missed by L1 cache.
* **L3 Cache (Level 3)**:
* *Location*: Shared across **all** execution cores on a multi-core processor chip package.
* *Speed & Latency*: Slowest cache tier, though vastly faster than main memory ( access latency vs. latency for system RAM).
* *Typical Size*: shared pool across all cores.
System Architectures, Interfacing, & Performance Bottlenecks
- CPU, Main Memory, and Peripheral I/O Controller Interfacing

* **Peripheral Controllers**: Dedicated interface adapter hardware (handling storage drives, network modems, graphic displays) interposed between the system bus and external physical peripheral devices. A controller often contains specialized local memory and dedicated onboard logic microprocessors.
* **Communication Mechanics**: The CPU interacts with peripheral controllers through bus pathways using memory-mapped or port-mapped I/O operations.
* **Direct Memory Access (DMA)**: An advanced hardware operational mode where I/O controllers transfer high-volume data streams directly into or out of Main Memory (RAM) across the system bus without involving the CPU. This frees the CPU from byte-by-byte data transfer processing.
The Von Neumann Bottleneck
- Definition: The fundamental operational latency limit imposed by a shared system bus architecture where instruction fetches and data read/write transfers must sequentially compete for access to the same physical data pathway.
- Architectural Bottleneck Mitigation Strategies:
- Cache Memory Integration: Keeping active data localized in high-speed SRAM caches (L1, L2, L3) to avoid bus traffic.
- Multi-Level Cache Structures: Tiering access latency to absorb memory requests.
- Wider / Higher-Frequency Buses: Increasing system bus width and timing speed to maximize throughput per cycle.
- Direct Memory Access (DMA): Removing peripheral data traffic bottlenecks from CPU processing routines.
- Hardware Prefetching: Instruction predictive units pre-fetching memory code blocks before execution requests occur.
- Multi-Channel Memory Architectures: Deploying independent parallel memory controllers/channels to double or quadruple memory bus bandwidth.
- Separate Path Architectures: Implementing physically isolated hardware data and instruction pathways.
Architectural Framework Comparisons

* **Von Neumann Architecture**:
* Program code instructions and functional data reside inside a single, unified main memory array.
* Uses a single shared bus system for instruction and data transfers.
* *Limitation*: Instruction and data transfers constantly compete for bandwidth, enforcing serial processing delays.
* **Harvard Architecture**:
* Maintains physically separate memory units for Program Code Memory and Data Memory.
* Uses isolated physical bus pathways for instruction addresses and data transfers.
* *Advantage*: Allows simultaneous instruction fetching and data read/write operations without bus contention.
* **Modern Modified Harvard Architecture**:
* The structural hybrid architecture used by modern commercial microprocessors (e.g., Intel, AMD, Apple M-series chips).
* *Internal Harvard Structure*: Incorporates completely separate Level 1 Instruction Cache (L1i) and Level 1 Data Cache (L1d) arrays within processor core silicon, enabling parallel internal instruction fetching and execution.
* *External Von Neumann Structure*: Integrates into a single, unified system main memory (RAM) pool externally, reducing physical pin counts, hardware footprint costs, and structural layout complexity.
Storage Systems & Technologies
Storage Operational Parameters
- Volatility: Nonvolatile systems retain stored digital data permanently without continuous electrical power; volatile systems lose data immediately upon power disconnection.
- Access Methods:
- Random Access: Data can be retrieved from any arbitrary physical storage location directly in a constant, uniform timeframe.
- Sequential Access: Data must be accessed in a fixed linear physical sequence (e.g., magnetic tape reels).
- Abstraction Representation:
- Logical View: File system abstractions presented to system software and users (Files, Directories, Named Folders).
- Physical View: Actual physical positioning of magnetic domains, floating-gate electrical charges, or optical reflective pits on physical hardware media.
Hard Drive Technologies Comparison
- Hard Disk Drive (HDD):
- Technology: Magnetic recording tracks on rotating metallic platters, read/write electromagnetic heads, motorized spindle assemblies, divided into circular tracks and pie-shaped sectors.
- Advantages: Very high storage capacities at exceptionally low monetary costs per gigabyte.
- Disadvantages: Mechanical moving parts introduce operational latency, physical shock vulnerability, higher power consumption, thermal generation, and operational noise.
- Solid-State Drive (SSD):
- Technology: Solid-state microchip flash memory arrays utilizing floating-gate or charge-trap semiconductor transistors without mechanical moving components.
- Advantages: Ultra-fast access latency, silent operation, structural physical shock resistance, lower power consumption, high read/write transfer rates.
- Disadvantages: Higher monetary cost per gigabyte relative to magnetic storage.
- Solid-State Hybrid Drive (SSHD):
- Technology: Integrated physical storage unit combining high-capacity conventional magnetic HDD platters with a smaller embedded flash memory cache controller module.
- Operation: Onboard logic automatically caches frequently queried files in high-speed flash memory while storing bulk background data on magnetic platters.
- Hard Disk Drive (HDD):
Optical Storage Systems
- Operational Principles: Reads and writes digital bit patterns using microscopic lasers focused on polycarbonate plastic discs. Data is stored as physical surface depressions (Pits) and flat reflective surfaces (Lands) that modulate reflected laser light received by an optical sensor.
- Standard Optical Formats & Capacities:
- Compact Disc (CD): Capacity approximately .
- Digital Versatile Disc (DVD): Capacity approximately (Single-layer) or (Dual-layer).
- Blu-ray Disc (BD): Capacity approximately (Single-layer) or (Dual-layer).
- Functional Disc Categories:
- ROM (Read-Only Memory): Pre-recorded media containing fixed factory content that cannot be altered or overwritten.
- R (Recordable): Write-once media allowing data to be recorded a single time.
- RW / RE (Rewritable / Re-Erasable): Multi-use phase-change optical media that can be written, erased, and rewritten repeatedly.
Flash, Enterprise, & Cloud Storage Options
- Flash Storage Media: Small nonvolatile flash memory configurations, including standard Secure Digital (SD) cards, microSD cards, embedded MultiMediaCards (eMMC), and Universal Serial Bus (USB) flash drives.
- Network-Attached Storage (NAS): Specialized high-capacity storage appliances connected directly to a network to provide centralized file-level data access to connected client systems.
- Cloud Storage: High-capacity remote storage infrastructure accessed over network connections or internet connections.
- Storage Selection Factors: Purchasing and deployment decisions depend on capacity requirements, access speeds, cost per gigabyte, nonvolatile reliability, and physical portability.
Input and Output (I/O) Peripherals
Interactive Input Hardware
- Input Devices: Peripheral hardware components used to enter raw data, control signals, and commands into a computer system.
- Keyboards: Primary text input devices used to enter alphanumeric characters, system symbols, and execution commands.
- Pointing Devices: Interface controllers used to manipulate an on-screen visual pointer or display cursor. Includes physical mice, digital styluses, touchpads, graphics tablet surfaces, and gaming controllers.
- Touch Screens: Display screens layered with touch-sensitive overlays to register input gestures directly.
Optical Readers, Scanners, & Biometrics
- Scanners: Optical devices that convert physical paper documents, printed photographs, or hand drawings into digital raster graphics files.
- Optical Character Recognition (OCR): Software algorithms that parse scanned visual images to convert written or printed text images into editable digital text files.
- Barcode Readers: Optical sensors designed to scan and decode printed linear barcodes (such as UPC standard codes).
- QR Code Readers: Camera-based optical sensors and algorithms that decode two-dimensional matrix patterns.
- Radio Frequency Identification (RFID): Uses specialized RFID Readers to wirelessly query and decode signal data transmitted by embedded physical RFID Tags for tracking and automated payment processing.
- Biometric Readers: Security verification hardware that identifies individuals based on unique biological attributes, such as fingerprint patterns, facial topology, hand geometry, or iris patterns.
Display Technologies & Output Metrics
- Display Technologies: Primary visual output hardware. Standards include Liquid Crystal Display (LCD), Light Emitting Diode (LED), Organic LED (OLED), Electronic Paper (E-paper), and specialized wearable/touchscreen arrays.
- Pixels: The foundational unit of display output, short for Picture Elements. Tiny controllable light points arranged in a rectangular grid matrix.
- Display Resolution: The total number of horizontal pixels multiplied by vertical pixels on a screen. For example, a high-definition display resolution measures pixels.
Printers & Audio Hardware
- Printer Hardware: Output devices that generate permanent hard-copy physical prints on paper or physical substrates.
- Performance Metrics:
- DPI (Dots Per Inch): Measures physical printing resolution and image clarity.
- PPM (Pages Per Minute): Measures physical print output speed.
- Printer Categories:
- Laser Printers: Utilize electrostatic drums, focused laser beams, and powdered toner to quickly print crisp documents in high-volume environments.
- Ink-Jet Printers: Spray micro-droplets of liquid ink through tiny nozzles directly onto paper; ideal for high-quality photo and low-volume printing.
- Specialized Printers: Includes dedicated photo printers, barcode label printers, portable battery-powered field printers, large-format engineering plotters, and additive manufacturing 3D Printers.
- Audio Peripherals: Convert digital audio signals into physical sound waves using integrated speakers, personal headphones, headsets, or wireless earbuds. Speech recognition hardware converts incoming audio into digital command text.
Questions & Discussion
Exercise 1: What sequence of events do you think would be required to move the contents of one memory cell in a computer to another memory cell?
- Step 1: The CPU issues an address on the Address Bus corresponding to the source memory cell location, along with a Read control signal sent over the Control Bus.
- Step 2: Main memory retrieves the data bit pattern stored inside that specified source cell and places it onto the Data Bus.
- Step 3: The CPU receives the byte value from the Data Bus and stores it temporarily inside an internal General-Purpose Register.
- Step 4: The CPU issues a new target address on the Address Bus corresponding to the destination memory cell location.
- Step 5: The CPU places the byte value stored in the internal register onto the Data Bus and issues a Write control signal on the Control Bus.
- Step 6: Main memory receives the data value from the Data Bus and overwrites the contents of the target memory cell with that new value.
Exercise 2: What information must the CPU supply to the main memory circuitry to write a value into a memory cell?
- Information Item 1: The exact memory cell location provided via the Address Bus.
- Information Item 2: The actual binary data payload value being transferred provided via the Data Bus.
- Information Item 3: An active Write signal provided via the Control Bus to initiate memory cell state changes.
Exercise 3: Mass storage, main memory, and general-purpose registers are all storage systems. What is the difference in their use?
- General-Purpose Registers: Located directly inside the CPU core logic array. They provide ultra-fast, single-cycle temporary storage used exclusively by the ALU to hold active data operands, addresses, and intermediate results currently being processed.
- Main Memory (RAM): Located outside the CPU die. It serves as a high-speed, volatile active working workspace holding operating system components, running program instruction sets, and active data buffers needed by the CPU in the immediate future.
- Mass Storage: Located remotely across interface buses. It provides high-capacity, nonvolatile long-term retention for files, programs, media, and operating system data, retaining information permanently across power-off cycles.