Computer System Fundamentals: CPU, Memory and Operating Systems
Computer system fundamentals tests the components of a computer, how instructions are executed, how memory and storage differ, and how the operating system manages resources. Expect ordering questions and performance comparisons.
CPU and the instruction cycle
The central processing unit contains the control unit (CU), arithmetic and logic unit (ALU) and registers. The CU fetches and decodes instructions and coordinates other units; the ALU performs arithmetic and Boolean logic. Key registers include the program counter (PC), memory address register (MAR), memory data register (MDR), current instruction register (CIR), accumulator and status flags. In the fetch–decode–execute cycle, the PC holds the next address; the address goes to the MAR; memory returns the instruction to the MDR; it is copied to the CIR; the CU decodes it; operands are fetched and the ALU executes; the PC is updated. Buses carry addresses, data and control signals.
Memory and storage
The hierarchy is registers → cache → main memory → secondary storage, trading speed for capacity and cost. Cache is small, fast SRAM holding recently or frequently used data; RAM is volatile working memory; ROM is non-volatile and holds firmware such as the bootstrap loader. Secondary storage (HDD, SSD, optical media, tape) is non-volatile. Virtual memory uses secondary storage as an extension of RAM; excessive paging causes thrashing.
Operating system
An OS manages processes, memory, files and devices through drivers, provides a user interface, enforces access control and may spool print jobs. Utility programs include backup, antivirus, compression and disk defragmentation-defragmentation benefits magnetic HDDs, not SSDs.
Worked example
A program makes 1,000 memory accesses: 950 hit cache in 1 ns, 50 miss and take 50 ns. Average = (950 × 1 + 50 × 50) ÷ 1,000 = (950 + 2,500) ÷ 1,000 = 3.45 ns. Raising the hit rate lowers average access time more than a small clock-speed increase.
Traps
Clock speed alone does not determine performance; more RAM helps multitasking but not a CPU-bound calculation; cache is smaller and volatile; ROM is not a general permanent store for all programs; defragmenting an SSD is unnecessary and adds wear.