Computer Basics and Hardware Notes
Fundamentals of Computer Organization and Architecture
Computer Definition:
- A computer is an electronic device capable of performing calculations, processing data, and making logical decisions.
- Operates under the control of structured sets of instructions termed computer programs.
Core System Division:
- Hardware: Physical components that interpret and execute programs, store data and programs, and facilitate data transfer to and from external environments.
- Software: Sets of coded instructions that direct the physical hardware on what tasks to execute and how to perform them.
- Hardware is non-functional without software; software is operational only when executed on hardware.
Five Classic Hardware Components:
- Processor (CPU): Interprets and executes instructions.
- Memory: Stores both active programs and raw/processed data.
- Input Mechanism: Transfers data into the system from the outside world (e.g., keyboard, mouse).
- Output Mechanism: Displays or transmits processed data to the outside world (e.g., screen, printer).
- Storage/Transfer Devices: Manages persistent storage and data media (e.g., hard disks, CD-ROMs).

- Six Logical Units of Computer Systems:
- Input Unit: Receives raw information from input peripherals (keyboard, mouse).
- Output Unit: Conveys processed information to external devices (display screens, printers).
- Memory Unit: Provides rapid-access, low-capacity storage for input information and active program data.
- Arithmetic and Logic Unit (ALU): Performs mathematical operations and evaluates logical decisions.
- Central Processing Unit (CPU): Supervises, regulates, and coordinates the overall operations of all other system sections.
- Secondary Storage Unit: Provides non-volatile, high-capacity, low-cost long-term storage for inactive programs and persistent data.
System Unit Components and Motherboard Architecture
- System Unit Housing:
- Enclosed case constructed from metal or plastic designed to safeguard internal electronic components against physical damage.
- Universal component present in all computers, manufactured in a wide range of shapes and sizes.

- Primary Components within the System Unit:
- Processor (CPU): Interprets and executes basic computing instructions.
- Memory Modules: Temporarily holds data awaiting processing and instructions queued for execution.
- Motherboard (System Board): Main circuit board interconnecting processor chips, memory modules, and expansion cards.
- Adapter Cards (Expansion Slots): Circuit boards inserted into expansion slots to supply specialized functionality not built directly into the motherboard.
- Ports: Connection sockets for attaching external peripheral devices to the internal system.
- Drive Bays: Internal mounting structures that accommodate disk drives.
- Power Supply: Converts electrical power to supply internal components with operational current.
- Heat Sink: Thermal management structure mounted over high-temperature chips to dissipate thermal energy.

Data Representation and Coding Schemes
Binary Data Principles:
- Computers process data using a base-2 binary system consisting of two discrete digits: (representing off) and (representing on).
- Bit: The smallest individual unit of data a computer can manipulate.
- Byte: A grouped set of bits capable of representing alphanumeric characters, digits, or symbols.
Standardized Coding Schemes:
- Coding schemas define specific binary bit combinations used to translate numeric values into characters.
- ASCII (American Standard Code for Information Interchange): Standard 8-bit coding format.
- EBCDIC (Extended Binary Coded Decimal Interchange Code): IBM-developed 8-bit character encoding system.

- Binary Encoding Equivalence Reference:
- Symbol
'0': ASCII00110000| EBCDIC11110000 - Symbol
'1': ASCII00110001| EBCDIC11110001 - Symbol
'2': ASCII00110010| EBCDIC11110010 - Symbol
'3': ASCII00110011| EBCDIC11110011 - Symbol
'4': ASCII00110100| EBCDIC11110100 - Symbol
'5': ASCII00110101| EBCDIC11110101 - Symbol
'6': ASCII00110110| EBCDIC11110110 - Symbol
'7': ASCII00110111| EBCDIC11110111 - Symbol
'8': ASCII00111000| EBCDIC11111000 - Symbol
'9': ASCII00111001| EBCDIC11111001 - Symbol
'A': ASCII01000001| EBCDIC11000001 - Symbol
'B': ASCII01000010| EBCDIC11000010 - Symbol
'C': ASCII01000011| EBCDIC11000011 - Symbol
'D': ASCII01000100| EBCDIC11000100 - Symbol
'E': ASCII01000101| EBCDIC11000101
- Symbol
CPU Internal Structure and Machine Cycles
- Data Processing Loop:
- System operation involves continuously moving data from input/storage into CPU memory, processing it via the Control Unit and ALU, and directing outputs to storage or display devices.

- Four-Step Machine Cycle:
- Fetch: The Control Unit retrieves program instructions from main memory.
- Decode: The Control Unit interprets the fetched instruction into operational signals.
- Execute: The Arithmetic/Logic Unit executes the decoded mathematical or logical command.
- Store: Results generated during execution are written back into main memory registers.

CPU Primary Sub-units:
- Datapath: Consists of the ALU and temporary internal storage units (registers) interconnected by an internal data bus linked directly to main memory.
- Control Unit: Oversees operational sequencing, instruction flow, and precise timing of data transfers across CPU components.
Arithmetic/Logic Unit (ALU) Operations:
- Arithmetic Operations: Standard arithmetic tasks including addition, subtraction, multiplication, and division.
- Logical Comparisons:
- Equal-to condition: Evaluates if two values are identical.
- Less-than condition: Evaluates if a target value is smaller than a baseline value.
- Greater-than condition: Evaluates if a target value exceeds a baseline value.
Register Organization within the CPU
Register Characteristics:
- Internal, high-speed temporary storage cells situated directly within the CPU structure.
- Function outside standard system memory to deliver maximum data access speeds under direct control of the Control Unit.
General Purpose Registers:
- User-visible registers accessible by assembly/machine instructions to store intermediate operation results.
- Examples in Intel Microprocessors include four standard registers:
AX,BX,CX, andDX.
Special Purpose Registers:
- User-invisible hardware registers managed automatically by internal CPU logic:
- PC (Program Counter): Stores the memory address of the next sequential instruction queued for execution.
- MAR (Memory Address Register): Holds the active memory address currently being read from or written to via the Address Bus.
- MDR / MBR (Memory Data Register / Memory Buffer Register): Serves as the operational gate between external memory buses and internal CPU components. All incoming or outgoing data must pass through the MDR.
- IR (Instruction Register): Stores the binary representation of the instruction currently being executed after retrieval from memory.

System Communication: Buses, Clocks, and Interrupts
- Bus Interconnects:
- A bus consists of parallel electrical conductor lines carrying individual data bits simultaneously across system modules.

Primary Bus Types:
- Processor-Memory Bus: Short, ultra-high-speed dedicated bus optimized to match memory timing and maximize throughput bandwidth.
- I/O Bus: Extended-length bus designed to accommodate diverse peripheral devices operating across varied bandwidth speeds.
- Backplane Bus: System-wide structural bus integrating CPU, main memory modules, and peripheral interface slots onto a unified interface.
System Clock Mechanics:
- Master clock circuit generating precise pulses to synchronize internal operations across system components.
- Every operation requires a fixed number of clock cycles to complete.
- Clock frequency is expressed in Megahertz () or Gigahertz ().
- Clock Cycle Duration Equation:
- Example: A system operating with an clock frequency has a calculated cycle time of:
- Raw clock speed must not be evaluated as the sole indicator of overall CPU system performance.
Interrupt Handling:
- Hardware mechanism causing the processor to suspend normal program execution to address higher-priority external or internal events.
- Nonmaskable Interrupts: Urgent hardware events that cannot be delayed or ignored by CPU control logic.
- Maskable Interrupts: Standard priority interrupts that can be temporarily disabled or postponed via software registers.
- Primary Triggers for Interrupt Signals:
- Peripheral I/O service requests.
- Arithmetic errors (e.g., division by zero).
- Arithmetic underflow or overflow conditions.
- Critical hardware malfunctions.
- Software execution breakpoints set during program debugging.
- Invalid instruction execution codes stemming from memory pointer faults.
Memory Organization, Capacity, and Addressing
- Memory Architecture Principles:
- Linear array of addressable storage cells structured as bit matrices where each row length corresponds to machine word size.
- Memory locations possess unique sequential numerical addresses starting at index zero ().

Addressing and Chip Specifications:
- Systems are designed as byte-addressable or word-addressable (e.g., half-word addressable at 16 bits).
- Memory chip configurations are specified as .
- Example: A RAM chip architecture provides of addressable 16-bit storage locations.
Standardized Capacity Scale Values:
- Kilobyte (KB / K): Approximate count = bytes () | Exact count = bytes ().
- Megabyte (MB): Approximate count = bytes () | Exact count = bytes ().
- Gigabyte (GB): Approximate count = bytes () | Exact count = bytes ().
- Terabyte (TB): Approximate count = bytes () | Exact count = bytes ().
Memory Technologies: RAM vs. ROM Systems
Random Access Memory (RAM):
- Function: Serves as main system memory to store active code and real-time execution data.
- Volatility: Highly volatile; completely loses all stored data when electrical power is disconnected.
- DRAM (Dynamic RAM):
- Made of micro-capacitors that continuously lose electrical charge over time.
- Requires periodic refresh cycles every few milliseconds to prevent data loss.
- Lower manufacturing cost, high component density (storing many bits per chip), low power draw, low thermal generation.
- Variations include: Multibank DRAM (MDRAM), Fast-Page Mode (FPM) DRAM, Extended Data Out (EDO) DRAM, Burst EDO DRAM (BEDO DRAM), Synchronous Dynamic RAM (SDRAM), Synchronous-Link (SL) DRAM, Double Data Rate (DDR) SDRAM, Direct Rambus (DR) DRAM.
- SRAM (Static RAM):
- Transistor-based logic circuit that retains data without requiring refresh cycles.
- Exceptionally fast operational speed, but significantly more expensive, less dense, and generates higher thermal output.
- Primary application: Used to construct high-speed processor Cache memory.
- Variations include: Asynchronous SRAM, Synchronous SRAM, and Pipeline Burst SRAM.
Read-Only Memory (ROM):
- Function: Stores non-volatile permanent or semi-permanent system instructions (e.g., BIOS, startup routines) that persist across power cycles.
- Applications: Toys, automobile engine control modules, calculators, laser printers.
- ROM Variants:
- Standard ROM: Factory hardwired during manufacturing; unalterable.
- PROM (Programmable ROM): Field-programmable once by users using specialized programmer equipment; permanently locked post-programming.
- EPROM (Erasable PROM): Reprogrammable semiconductor memory. Requires high-intensity ultraviolet (UV) light exposure to completely clear contents before rewrite.
- EEPROM (Electrically Erasable PROM): Electronically erasable memory using targeted electric fields without special tools. Allows selective byte-by-byte erasure and editing.
- Flash Memory: Advanced form of EEPROM supporting block-level reading, writing, and erasing, overcoming single-byte editing bottlenecks.
Memory Hierarchy Pyramid and Cache Systems
- Memory Hierarchy Concept:
- System design trade-off balancing operational speed, storage capacity, and financial cost.
- High-speed memory costs significantly more per bit and is placed closest to the CPU in smaller capacities; lower-speed storage is positioned further away in massive capacities.

Hierarchical Storage Tiers:
- Registers:
- Access Latency:
- Domain: System Level | Relative Cost: Highest
- Level 1 (L1) Cache:
- Access Latency:
- Domain: System Level | Capacity: Typical size to ; built directly on the CPU silicon chip.
- Level 2 (L2) Cache:
- Access Latency:
- Domain: System Level | Capacity: Typical size to ; positioned between the CPU core and Main Memory.
- Main Memory (RAM):
- Access Latency:
- Domain: Online Level
- Fixed Rigid Disk (Hard Drive):
- Access Latency:
- Domain: Online / Near Line Level
- Optical Disk (Jukeboxes):
- Access Latency: (when volume is mounted)
- Domain: Near Line / Offline Level
- Magnetic Tape (Robotic Libraries):
- Access Latency: (when volume is mounted)
- Domain: Offline Level | Relative Cost: Lowest
Cache Memory Operational Principles:
- Cache functions as Content Addressable Memory (CAM), searched directly by binary data content rather than memory address indexes.
- Stores copies of recently accessed data blocks to eliminate main memory access delays.
- Search latency increases with cache volume; hence, multi-tier split caches (L1 vs L2) are used to maintain high hit rates.
- Data Request Pipeline: CPU queries L1 Cache queries L2 Cache queries Main Memory queries Secondary Rigid Disk. When data is found, it is copied into cache alongside adjacent memory elements.
Peripheral Input/Output Devices and Secondary Storage
Input/Output (I/O) Architecture:
- Peripherals allow human-machine interaction and data movement between internal memory and external hardware.
- Input Devices: Keyboards, computer mice, card readers, image scanners, voice recognition hardware, touch screens.
- Output Devices: Display screens/monitors, paper printers, plotters, audio speakers.
Device Interface Components:
- Peripherals do not connect directly to internal CPU buses; specialized controller interfaces bridge signal conversions.
- Example: Graphics Processing Units (GPUs) translate system bus streams into output formats for displays.
I/O Register Communication Methods:
- Memory-Mapped I/O: Peripheral device control registers are assigned addresses within the standard main memory map. The CPU executes I/O tasks using regular memory instructions.
- Instruction-Based I/O: The CPU uses dedicated hardware control lines and specialized machine instructions reserved specifically for peripheral read/write operations.
Secondary Storage Systems:
- Physical media providing non-volatile retention of data, applications, and operating system software for future reuse.
- Storage media formats: Internal hard disks, floppy diskettes, Zip disks, optical CDs/DVDs, magnetic tapes, PC Cards, flash memory storage cards, USB flash drives, microfilm units.