Skip to main content

Fundamentals of Computer Systems

Hardware Components

Central Processing Unit (CPU)

The CPU is the primary component that executes instructions. It consists of three main sub-components:

ComponentFunction
Arithmetic Logic Unit (ALU)Performs arithmetic (add, subtract, multiply, divide) and logical (AND, OR, NOT, XOR) operations
Control Unit (CU)Coordinates all activities: fetches instructions, decodes them, and signals other components to execute
RegistersSmall, extremely fast storage locations inside the CPU used for temporary data during processing

Registers

RegisterPurpose
Program Counter (PC)Holds the memory address of the next instruction to be fetched
Memory Address Register (MAR)Holds the address in memory to be read from or written to
Memory Data Register (MDR)Holds data that has been read from or is about to be written to memory
Accumulator (ACC)Stores the results of ALU operations
Instruction Register (IR)Holds the current instruction being decoded and executed
Status Register (Flags)Stores flags such as Zero, Carry, Negative, Overflow from ALU operations
info

Registers are the fastest memory in a computer system — orders of magnitude faster than RAM. A typical CPU has a small number of general-purpose registers (8--32 in most architectures).

Memory Types

TypeFull NameVolatile?Read/WriteSpeedTypical Use
RAMRandom Access MemoryYesBothFastMain memory, running programs
ROMRead Only MemoryNoRead onlySlower than RAMBoot-up instructions (BIOS/UEFI), firmware

RAM types:

  • SRAM (Static RAM): Uses flip-flop circuits. Faster, more expensive. Used for CPU cache (L1, L2, L3).
  • DRAM (Dynamic RAM): Uses capacitors. Slower, cheaper, needs refreshing. Used as main memory.

ROM types:

  • PROM: Programmable once by the user.
  • EPROM: Erasable using UV light, reprogrammable.
  • EEPROM: Electrically erasable and reprogrammable.

Secondary Storage

Storage TypeTechnologySpeedCapacityCostVolatility
HDDMagnetic platters spinning at 5400/7200/10000 RPM80--160 MB/s500 GB -- 20 TBLowNon-volatile
SSDNAND flash memory via SATA/NVMe500 MB/s -- 7 GB/s (NVMe)256 GB -- 4 TBMedium-HighNon-volatile
Flash MemoryNAND flash (USB drives, SD cards)10--300 MB/s1 GB -- 1 TBMediumNon-volatile

:::warning[Exam Tip] When comparing storage, consider all five criteria: speed, capacity, cost per GB, volatility, and durability. HDDs are cheaper per GB but slower and more fragile (moving parts). SSDs are faster with no moving parts but more expensive per GB. :::


Input Devices

DeviceInput TypeCommon Use Case
KeyboardText, commandsTyping documents, entering data
MousePointing, clickingGUI navigation, selecting objects
ScannerImage, document captureDigitising photos, OCR (Optical Character Recognition)
MicrophoneAudio/sound inputVoice recording, voice commands
Camera / WebcamImage, video captureVideo conferencing, photography
TouchscreenTouch gesturesMobile devices, kiosks, POS systems
Barcode ReaderLight reflection patternRetail checkout, inventory management
RFID ReaderRadio frequency signalAccess control, toll collection, tracking

Barcode Reader vs RFID:

FeatureBarcode ReaderRFID Reader
Line of sight requiredYesNo
Read rangeShort (contact to ~30 cm)Up to several metres
Data capacityLimited (typically a number)Can store more data
CostLowerHigher
Read multiple at onceNoYes

Output Devices

DeviceOutput TypeCommon Use Case
MonitorVisual displayPrimary output for desktops/laptops
PrinterHard copy (paper)Inkjet (photo quality), Laser (high volume, fast)
SpeakerAudio outputMusic, alerts, multimedia
ProjectorLarge visual displayPresentations, classrooms, cinemas

Inkjet vs Laser Printer:

FeatureInkjetLaser
SpeedSlowerFaster
Print quality (text)GoodExcellent
Print quality (photos)BetterGood
Cost per pageHigherLower
Initial costLowerHigher
MechanismSprays liquid inkUses toner powder, heat

Von Neumann Architecture

The Von Neumann architecture defines a computer system with:

  1. Single shared memory for both instructions and data (stored-program concept).
  2. CPU consisting of ALU, CU, and registers.
  3. System bus connecting CPU, memory, and I/O devices.
+---------+
| CPU |
| +-----+ |
| | CU | |
| +-----+ |
| | ALU | |
| +-----+ |
| |Regs | |
| +-----+ |
+----+----+
|
System Bus
|
+----+----+
| Memory |
| (RAM + |
| ROM) |
+---------+
|
System Bus
|
+----+----+
| I/O |
| Devices |
+---------+

Key principles:

  • Instructions and data are stored in the same memory.
  • Memory is addressed linearly.
  • Instructions are executed sequentially unless a branch/jump instruction changes the flow.

Harvard Architecture (Comparison)

FeatureVon NeumannHarvard
Memory busSingle shared busSeparate instruction and data buses
MemoryOne memory for bothSeparate memories for instructions and data
Speed bottleneckYes (bus contention)No (parallel fetch)
ComplexitySimplerMore complex
Modern usageMost general-purpose CPUsDSPs, microcontrollers, CPU caches

The Von Neumann bottleneck arises because the CPU and memory share a single bus. The CPU is often much faster than memory, so it spends time waiting for instructions and data to be fetched. This is why modern CPUs use cache memory (L1, L2, L3) to reduce the impact of the bottleneck.

Cache memory is a small, fast memory between the CPU registers and main memory (RAM):

Cache LevelLocationSizeSpeed
L1Inside CPU core32--128 KBFastest (~1 cycle)
L2Inside CPU (per core or shared)256 KB -- 1 MBFast (~10 cycles)
L3Inside CPU (shared among all cores)2--64 MBModerate (~40 cycles)
RAMOutside CPU on motherboard4--128 GBSlowest (~100+ cycles)

When the CPU needs data, it checks L1 first, then L2, then L3, then RAM. If the data is found in cache, it is a cache hit; otherwise it is a cache miss and the CPU must wait for the slower memory.

:::warning[Exam Tip] The DSE syllabus focuses on Von Neumann. Know why it has a bottleneck (CPU waits for memory) and how Harvard architecture addresses this. Most modern CPUs use a modified Harvard architecture internally (separate L1 caches for instructions and data) while presenting a Von Neumann model externally. :::


The Fetch-Decode-Execute Cycle

This is the fundamental cycle by which the CPU processes every instruction.

Step-by-step

  1. Fetch:

    • PC holds the address of the next instruction.
    • Address is copied from PC to MAR.
    • Instruction is fetched from memory address in MAR into MDR.
    • PC is incremented to point to the next instruction.
    • Instruction in MDR is copied to IR.
  2. Decode:

    • CU decodes the instruction in IR.
    • The CU determines which operation to perform and which operands are needed.
  3. Execute:

    • The instruction is executed (ALU performs calculations, data is moved, etc.).
    • Results are stored in the accumulator or written back to memory.
    • Status flags are updated as needed.
    • Cycle repeats from step 1.

Example Trace

Given memory starting at address 100:

AddressInstruction
100LOAD 5
101ADD 3
102STORE 6

Execution trace:

StepActionPCMARMDRIRACC
FetchPC(100) -> MAR; Mem[MAR] -> MDR; PC = 101; MDR -> IR101100LOAD 5LOAD 5?
DecodeCU decodes LOAD 5101100LOAD 5LOAD 5?
ExecuteMem[5] -> ACC101100LOAD 5LOAD 5M[5]
FetchPC(101) -> MAR; Mem[MAR] -> MDR; PC = 102; MDR -> IR102101ADD 3ADD 3M[5]
DecodeCU decodes ADD 3102101ADD 3ADD 3M[5]
ExecuteACC = ACC + Mem[3]102101ADD 3ADD 3M[5]+M[3]
FetchPC(102) -> MAR; Mem[MAR] -> MDR; PC = 103; MDR -> IR103102STORE 6STORE 6M[5]+M[3]
DecodeCU decodes STORE 6103102STORE 6STORE 6M[5]+M[3]
ExecuteACC -> Mem[6]103102STORE 6STORE 6M[5]+M[3]

Software Types

System Software

Software that manages and controls hardware and provides a platform for application software.

TypeDescriptionExamples
Operating System (OS)Manages all hardware and software resourcesWindows, macOS, Linux, Android, iOS
Utility ProgramsPerform specific maintenance tasksDisk defragmenter, antivirus, file manager, backup tool

Application Software

Software designed for end-users to perform specific tasks.

TypeDescriptionExamples
General-purposeWidely used across many domainsWord processors, spreadsheets, web browsers
Special-purposeDesigned for a specific fieldAccounting software, CAD, medical imaging
Custom/bespokeWritten for a specific organisationA company's payroll system

Operating System Functions

FunctionDescription
Memory ManagementAllocates and deallocates memory space, uses virtual memory (swap space on disk to extend RAM), manages paging and segmentation
Process ManagementSchedules CPU time among processes, handles multitasking (time-sharing), manages process creation and termination
File ManagementOrganises files in directories/folders, handles file naming, access control, and storage allocation
User InterfaceProvides CLI (Command Line Interface) or GUI (Graphical User Interface) for user interaction
Device ManagementUses device drivers to communicate with hardware, manages I/O operations
SecurityUser authentication, access control, firewall integration

Types of User Interfaces

Command Line Interface (CLI):

  • User types commands using a keyboard.
  • Requires memorisation of commands and syntax.
  • Efficient for experienced users; supports scripting and automation.
  • Examples: Windows Command Prompt, Linux bash, macOS Terminal.

Graphical User Interface (GUI):

  • Users interact with visual elements (windows, icons, menus, buttons).
  • Intuitive and easy to learn; does not require memorising commands.
  • Uses pointing devices (mouse, touchscreen).
  • Consumes more system resources than CLI.
  • Examples: Windows Explorer, macOS Finder, Android/iOS home screens.

Menu-Driven Interface:

  • User selects options from a predefined list of menus.
  • Common in ATMs, self-service kiosks, and embedded systems.
  • Limited flexibility but very easy to use for specific tasks.

Virtual Memory

Virtual memory is a memory management technique that uses secondary storage (hard disk/SSD) as an extension of RAM. When physical RAM is full, the operating system moves less frequently used pages (data blocks, typically 4 KB) from RAM to a designated area on disk called the swap space or page file. When those pages are needed again, they are swapped back into RAM.

AspectAdvantageDisadvantage
CapacityAllows running more/larger programs than physical RAM aloneDisk access is much slower than RAM (thousands of times slower)
CostEffectively increases memory without buying more RAMExcessive swapping (thrashing) severely degrades performance
ImplementationTransparent to the user and applicationsRequires disk space to be reserved

Thrashing occurs when the system spends more time swapping pages in and out of memory than executing actual instructions. This happens when the system is overloaded with too many processes competing for insufficient RAM.


Number Systems

Binary (Base 2)

Digits: 0, 1. Each digit is a bit. 8 bits = 1 byte.

DecimalBinary
00000 0000
10000 0001
20000 0010
50000 0101
100000 1010
2551111 1111

Hexadecimal (Base 16)

Digits: 0--9, A(10), B(11), C(12), D(13), E(14), F(15). Each hex digit represents exactly 4 bits.

HexBinaryDecimal
000000
100011
910019
A101010
F111115
100001 000016
FF1111 1111255
1000001 0000 0000256

Binary-Coded Decimal (BCD)

Each decimal digit (0--9) is represented by its 4-bit binary equivalent.

DecimalBCD
00000
91001
150001 0101
1270001 0010 0111

:::warning[Exam Tip] BCD is different from pure binary. The decimal number 15 in pure binary is 1111, but in BCD it is 0001 0101 (each decimal digit encoded separately). BCD wastes some bit patterns (1010--1111 are invalid) but is useful for displays and financial calculations where each decimal digit must be preserved exactly. :::

Conversions

Decimal to Binary: Repeatedly divide by 2, record remainders from bottom to top.

Decimal to Hexadecimal: Repeatedly divide by 16, record remainders.

Binary to Hexadecimal: Group bits in groups of 4 from the right, convert each group.

Hexadecimal to Binary: Replace each hex digit with its 4-bit binary equivalent.

Decimal to BCD: Replace each decimal digit with its 4-bit binary equivalent.

Worked Example: Decimal 185 to Binary, Hex, and BCD

To binary:

185÷2=92185 \div 2 = 92 R 11 92÷2=4692 \div 2 = 46 R 00 46÷2=2346 \div 2 = 23 R 00 23÷2=1123 \div 2 = 11 R 11 11÷2=511 \div 2 = 5 R 11 5÷2=25 \div 2 = 2 R 11 2÷2=12 \div 2 = 1 R 00 1÷2=01 \div 2 = 0 R 11

Reading remainders from bottom to top: 18510=101110012185_{10} = 10111001_2

To hexadecimal:

185÷16=11185 \div 16 = 11 R 99. 11=B11 = B. So 18510=B916185_{10} = B9_{16}

To BCD:

1851850001 1000 0101185 \to 1 \to 8 \to 5 \to 0001\ 1000\ 0101

18510=000110000101BCD185_{10} = 000110000101_{BCD}


Data Representation

Text Representation

ASCII (American Standard Code for Information Interchange)

  • 7-bit code, extended to 8-bit (Extended ASCII).
  • Represents 128 characters (0--127): uppercase letters (65--90), lowercase letters (97--122), digits (48--57), control characters (0--31), symbols.
  • Each character stored as 1 byte (8 bits) with the MSB unused or used for parity.
CharacterASCII (decimal)ASCII (binary)
'A'650100 0001
'Z'900101 1010
'a'970110 0001
'0'480011 0000
Space320010 0000

Unicode

  • Supports characters from all languages, symbols, and emoji.
  • UTF-8 encoding: variable-length (1--4 bytes). Backward-compatible with ASCII (first 128 characters identical).
  • UTF-16: 2 or 4 bytes per character.
  • UTF-32: fixed 4 bytes per character.
info

Key difference: ASCII uses 1 byte per character and covers only English and basic symbols. Unicode covers all writing systems but uses more storage. UTF-8 is the most widely used encoding on the internet.

Image Representation

A bitmap image is a grid of pixels (picture elements). Each pixel is assigned a colour value.

Image resolution: Width ×\times Height in pixels (e.g., 1920×10801920 \times 1080).

Colour depth: Number of bits used to represent each pixel's colour.

Colour DepthNumber of ColoursCalculation
1 bit2 (black and white)212^1
8 bits256282^8
16 bits65 536 (High Colour)2162^{16}
24 bits16 777 216 (True Colour)2242^{24}

Image file size (uncompressed):

FileSize(bits)=Width×Height×ColourDepth\mathrm{File Size (bits)} = \mathrm{Width} \times \mathrm{Height} \times \mathrm{Colour Depth}

In bytes:

FileSize(bytes)=Width×Height×ColourDepth8\mathrm{File Size (bytes)} = \frac{\mathrm{Width} \times \mathrm{Height} \times \mathrm{Colour Depth}}{8}
Worked Example: Image File Size Calculation

A 1024×7681024 \times 768 image with 24-bit colour depth.

Size(bits)=1024×768×24=18874368bits\mathrm{Size (bits)} = 1024 \times 768 \times 24 = 18874368 \mathrm{ bits}Size(bytes)=188743688=2359296bytes\mathrm{Size (bytes)} = \frac{18874368}{8} = 2359296 \mathrm{ bytes}Size(KB)=23592961024=2304KB\mathrm{Size (KB)} = \frac{2359296}{1024} = 2304 \mathrm{ KB}Size(MB)=23041024=2.25MB\mathrm{Size (MB)} = \frac{2304}{1024} = 2.25 \mathrm{ MB}

Bitmap vs Vector Graphics:

FeatureBitmapVector
Storage methodGrid of pixelsMathematical descriptions of shapes
ScalabilityLoses quality when enlargedScales without quality loss
File size for diagramsLargerSmaller
Suitability for photosExcellentNot suitable
Suitability for logos/diagramsDepends on resolutionIdeal
ExamplesJPEG, PNG, BMPSVG, EPS
EditingPixel-level editingShape and path editing

Image compression:

TypeMethodQuality LossExample
LosslessReduces redundancy without discarding dataNonePNG, GIF, BMP
LossyDiscards data that is less perceptible to the human eyeYes (irreversible)JPEG, WebP

JPEG compression works by dividing the image into 8×88 \times 8 pixel blocks, applying a Discrete Cosine Transform (DCT), and then quantising (rounding) the frequency coefficients. Higher compression ratios discard more high-frequency detail, resulting in smaller files with visible artefacts (blockiness, blurring).

Sound Representation

Sound is an analogue wave that must be converted to digital form via sampling.

Steps in sound digitisation:

  1. Sampling: Measure the amplitude of the sound wave at regular intervals (sampling rate).
  2. Quantisation: Map each sampled amplitude to the nearest value in a set of discrete levels.
  3. Encoding: Convert each quantised value to binary.

Sampling rate: Number of samples per second, measured in Hz. CD quality = 44 100 Hz (44.1 kHz).

Bit depth: Number of bits per sample. CD quality = 16 bits per sample. Higher bit depth = more accurate representation of the analogue signal. Common values: 8-bit (telephone quality), 16-bit (CD), 24-bit (studio recording).

Nyquist theorem: To accurately capture a sound with maximum frequency fmaxf_{\max}, the sampling rate must be at least 2fmax2f_{\max}. Since human hearing ranges up to approximately 20kHz20\mathrm{ kHz}, the CD sampling rate of 44100Hz44\,100\mathrm{ Hz} is sufficient (Nyquist frequency = 22050Hz22\,050\mathrm{ Hz}).

File size calculation:

FileSize(bits)=SamplingRate×BitDepth×Duration(s)×Channels\mathrm{File Size (bits)} = \mathrm{Sampling Rate} \times \mathrm{Bit Depth} \times \mathrm{Duration (s)} \times \mathrm{Channels}
  • Mono: 1 channel. Stereo: 2 channels.
Worked Example: Sound File Size Calculation

A 3-minute stereo recording at CD quality (44 100 Hz, 16-bit).

Duration=3×60=180seconds\mathrm{Duration} = 3 \times 60 = 180 \mathrm{ seconds}Size(bits)=44100×16×180×2=254016000bits\mathrm{Size (bits)} = 44100 \times 16 \times 180 \times 2 = 254016000 \mathrm{ bits}Size(bytes)=2540160008=31752000bytes\mathrm{Size (bytes)} = \frac{254016000}{8} = 31752000 \mathrm{ bytes}Size(MB)=317520001024×102430.28MB\mathrm{Size (MB)} = \frac{31752000}{1024 \times 1024} \approx 30.28 \mathrm{ MB}

Common Pitfalls

  1. Confusing RAM and ROM: RAM is volatile (loses data on power off) and read-write. ROM is non-volatile and read-only (or mostly read-only).

  2. Fetch-decode-execute order: The PC is incremented during the fetch phase, not after execution. The order matters for exam questions.

  3. Binary vs BCD: 15 in binary is 1111; 15 in BCD is 0001 0101. They are different representations.

  4. Colour depth and number of colours: 24-bit colour gives 224=16 777 2162^{24} = 16\ 777\ 216 colours, not 24 colours.

  5. Image file size formula: Do not forget to divide by 8 to convert bits to bytes, and by 1024 for KB/MB.

  6. Sound file size: Remember to multiply by the number of channels (2 for stereo). Forgetting this halves the file size.

  7. ASCII range: Uppercase 'A' is 65, lowercase 'a' is 97. The difference is 32. Digits '0'--'9' are 48--57. These values are frequently tested.

  8. Volatility: "Volatile" means data is lost when power is removed. RAM is volatile; ROM, HDD, SSD, and flash memory are non-volatile.

  9. SSD vs Flash: An SSD is a type of flash memory device. All SSDs use flash memory, but not all flash memory devices are SSDs (e.g., USB drives, SD cards).

  10. ALU vs CU: The ALU performs calculations; the CU coordinates and controls operations. Do not mix them up.


Practice Problems

Question 1: Storage Comparison

A school needs to store 500 GB of student records. They are considering an HDD vs SSD solution.

(a) Calculate how many 1 TB HDDs would be needed to store 500 GB of data.

(b) Give two advantages and two disadvantages of using SSDs instead of HDDs for this purpose.

Answer:

(a) 500GB=0.5TB500 \mathrm{ GB} = 0.5 \mathrm{ TB}. One 1 TB HDD is sufficient.

(b) Advantages of SSD: Faster read/write speeds, no moving parts (more durable, less prone to mechanical failure), quieter operation, lower power consumption.

Disadvantages of SSD: Higher cost per GB, limited write cycles (though modern SSDs mitigate this with wear levelling).

Question 2: Fetch-Decode-Execute Trace

Given the following program in memory:

AddressInstruction
200LOAD 10
201ADD 11
202SUB 12
203STORE 13

Memory values: M[10] = 25, M[11] = 17, M[12] = 8, M[13] = 0.

Trace the fetch-decode-execute cycle for the first two instructions, showing the state of PC, MAR, MDR, IR, and ACC after each phase.

Answer:

Instruction 1: LOAD 10

PhasePCMARMDRIRACC
Fetch201200LOAD 10LOAD 10?
Decode201200LOAD 10LOAD 10?
Execute201200LOAD 10LOAD 1025

Instruction 2: ADD 11

PhasePCMARMDRIRACC
Fetch202201ADD 11ADD 1125
Decode202201ADD 11ADD 1125
Execute202201ADD 11ADD 1142

ACC = 25 + 17 = 42.

Question 3: Number Conversions

(a) Convert 11010110211010110_2 to decimal.

(b) Convert 23410234_{10} to binary and hexadecimal.

(c) Convert the decimal number 593 to BCD.

Answer:

(a) 1×128+1×64+0×32+1×16+0×8+1×4+1×2+0×1=128+64+16+4+2=214101 \times 128 + 1 \times 64 + 0 \times 32 + 1 \times 16 + 0 \times 8 + 1 \times 4 + 1 \times 2 + 0 \times 1 = 128 + 64 + 16 + 4 + 2 = 214_{10}

(b) To binary: 234÷2=117234 \div 2 = 117 R 00 117÷2=58117 \div 2 = 58 R 11 58÷2=2958 \div 2 = 29 R 00 29÷2=1429 \div 2 = 14 R 11 14÷2=714 \div 2 = 7 R 00 7÷2=37 \div 2 = 3 R 11 3÷2=13 \div 2 = 1 R 11 1÷2=01 \div 2 = 0 R 11

23410=111010102234_{10} = 11101010_2

To hexadecimal: 234÷16=14234 \div 16 = 14 R 1010. 14=E14 = E, 10=A10 = A. So 23410=EA16234_{10} = EA_{16}

(c) 5935930101 1001 0011BCD593 \to 5 \to 9 \to 3 \to 0101\ 1001\ 0011_{BCD}

Question 4: Image Representation

A digital camera produces images of 4000×30004000 \times 3000 pixels with 32-bit colour depth.

(a) Calculate the uncompressed file size of one image in MB.

(b) If the camera has a 16 GB storage card, how many such images can it store?

Answer:

(a)

Size(bits)=4000×3000×32=384000000bits\mathrm{Size (bits)} = 4000 \times 3000 \times 32 = 384000000 \mathrm{ bits}Size(bytes)=3840000008=48000000bytes\mathrm{Size (bytes)} = \frac{384000000}{8} = 48000000 \mathrm{ bytes}Size(MB)=480000001024×102445.77MB\mathrm{Size (MB)} = \frac{48000000}{1024 \times 1024} \approx 45.77 \mathrm{ MB}

(b)

16GB=16×1024MB=16384MB16 \mathrm{ GB} = 16 \times 1024 \mathrm{ MB} = 16384 \mathrm{ MB}Numberofimages=1638445.77=358images\mathrm{Number of images} = \left\lfloor \frac{16384}{45.77} \right\rfloor = 358 \mathrm{ images}
Question 5: Sound Representation

A 2-minute mono audio recording is digitised at a sampling rate of 22 050 Hz with 8-bit resolution.

(a) Calculate the file size in MB.

(b) Explain the effect on file size and sound quality if the sampling rate is doubled to 44 100 Hz.

Answer:

(a)

Duration=2×60=120seconds\mathrm{Duration} = 2 \times 60 = 120 \mathrm{ seconds}Size(bits)=22050×8×120×1=21168000bits\mathrm{Size (bits)} = 22050 \times 8 \times 120 \times 1 = 21168000 \mathrm{ bits}Size(bytes)=211680008=2646000bytes\mathrm{Size (bytes)} = \frac{21168000}{8} = 2646000 \mathrm{ bytes}Size(MB)=26460001024×10242.52MB\mathrm{Size (MB)} = \frac{2646000}{1024 \times 1024} \approx 2.52 \mathrm{ MB}

(b) Doubling the sampling rate doubles the file size to approximately 5.05 MB. Sound quality improves because more samples per second capture the original waveform more accurately, reducing aliasing and better reproducing higher frequencies (the Nyquist frequency doubles from ~11 kHz to ~22 kHz).

Question 6: ASCII and Character Encoding

(a) The ASCII code for 'H' is 72. What is the ASCII code for 'h'?

(b) A text file contains 1000 characters, all ASCII. What is the file size in KB?

(c) Explain why Unicode is preferred over ASCII for international applications.

Answer:

(a) 'h' = 72 + 32 = 104. (Lowercase letters are 32 positions after their uppercase counterparts.)

(b) Each ASCII character is 1 byte. 1000bytes/1024=0.98KB1000 \mathrm{ bytes} / 1024 = 0.98 \mathrm{ KB}.

(c) ASCII only supports 128 characters (English alphabet, digits, basic symbols). Unicode supports over 149 000 characters covering all major writing systems, symbols, and emoji. This makes Unicode essential for applications serving users who speak different languages or need special characters.

Question 7: Operating System Functions

(a) Explain the difference between memory management and process management in an operating system.

(b) Describe what virtual memory is and why it is used.

(c) Give an example of a utility program and explain its purpose.

Answer:

(a) Memory management allocates and deallocates RAM among running programs, ensuring each process has sufficient memory and that processes do not interfere with each other's memory space. Process management schedules CPU time among processes, handles creation/termination of processes, and enables multitasking.

(b) Virtual memory uses a portion of the hard disk as an extension of RAM. When RAM is full, the OS moves less frequently used data (pages) from RAM to disk (swapping/paging). This allows the system to run more programs than would fit in physical RAM, at the cost of slower access to swapped data.

(c) Disk defragmenter: Rearranges fragmented file data on an HDD so that related data blocks are stored contiguously. This improves read/write performance by reducing disk head movement. (Note: defragmentation is not needed for SSDs.)

Question 8: Software Types

Classify each of the following as system software or application software, and explain your reasoning:

(a) Microsoft Word (b) Windows Defender (c) Linux (d) Adobe Photoshop

Answer:

(a) Application software -- it is a general-purpose word processor designed for end-user tasks.

(b) System software (utility program) -- it is an antivirus utility that protects the system by detecting and removing malware. It performs a maintenance/security task for the system.

(c) System software (operating system) -- it manages all hardware resources, provides memory/process/file management, and serves as a platform for other software.

(d) Application software -- it is a special-purpose image editing program designed for end-users.

Question 9: Data Representation -- Extended

(a) Convert 3F163F_{16} to decimal.

(b) Convert 11001100211001100_2 to hexadecimal.

(c) A bitmap image has dimensions 800×600800 \times 600 and uses 16-bit colour. Calculate the file size in KB. If the image is compressed using a lossless technique with a 3:2 compression ratio, what is the compressed file size?

Answer:

(a) 3×16+15=48+15=63103 \times 16 + 15 = 48 + 15 = 63_{10}

(b) Group into nibbles: 1100 11001100\ 1100. CC and CC. So 110011002=CC1611001100_2 = CC_{16}

(c)

Uncompressed(bits)=800×600×16=7680000bits\mathrm{Uncompressed (bits)} = 800 \times 600 \times 16 = 7680000 \mathrm{ bits}Uncompressed(bytes)=76800008=960000bytes\mathrm{Uncompressed (bytes)} = \frac{7680000}{8} = 960000 \mathrm{ bytes}Uncompressed(KB)=9600001024=937.5KB\mathrm{Uncompressed (KB)} = \frac{960000}{1024} = 937.5 \mathrm{ KB}Compressed(KB)=937.53×2=625KB\mathrm{Compressed (KB)} = \frac{937.5}{3} \times 2 = 625 \mathrm{ KB}
Question 10: Input/Output Devices -- Scenario

A library wants to automate its book checkout system. For each scenario, recommend the most appropriate input or output device and justify your choice.

(a) Identifying a book when it is checked out. (b) Identifying a library member. (c) Printing a receipt for the member. (d) Displaying the library catalogue to members on a self-service kiosk.

Answer:

(a) Barcode reader: Each book has a barcode on the cover containing a unique identifier. Scanning is fast and accurate.

(b) RFID reader / barcode reader: Library cards often have barcodes or RFID chips. RFID allows contactless scanning without removing the card from a wallet.

(c) Laser printer: Fast, low cost per page, suitable for printing simple text receipts in high volume.

(d) Touchscreen monitor: Allows members to interact directly with the catalogue. Combines input (touch) and output (display) in one device, ideal for self-service kiosks.

Question 11: Comparing CPU Components

(a) Describe the role of the Control Unit (CU) in the fetch-decode-execute cycle.

(b) Describe the role of the Arithmetic Logic Unit (ALU).

(c) Explain why registers are necessary in a CPU. Why can the CPU not operate using only RAM?

Answer:

(a) The CU coordinates and controls all operations during the fetch-decode-execute cycle. During the fetch phase, it sends control signals to copy the PC value to the MAR and trigger a memory read. During decode, it interprets the instruction in the IR and determines which operation to perform. During execute, it sends the appropriate control signals to the ALU, registers, or memory to carry out the instruction.

(b) The ALU performs all arithmetic calculations (addition, subtraction, multiplication, division) and logical operations (AND, OR, NOT, XOR, comparisons). It receives operands from registers, performs the operation as directed by the CU, and stores the result in the accumulator or a specified register.

(c) Registers are necessary because they provide the fastest possible storage access (1 clock cycle), whereas RAM access takes many clock cycles (100+ cycles for L3 cache, even more for RAM). If the CPU had to fetch every operand from RAM for every instruction, processing would be impractically slow. Registers allow the CPU to keep frequently used data (current instruction, memory addresses, intermediate results) immediately accessible, maximising throughput.

Question 12: System Performance Factors

A student claims that a computer with a faster CPU clock speed will always perform better than one with a slower clock speed. Evaluate this claim by considering at least three other factors that affect system performance.

Answer:

The claim is not always correct. While CPU clock speed is one factor affecting performance, the following factors are also critical:

  1. Number of CPU cores: A 2.0 GHz quad-core processor can outperform a 3.0 GHz dual-core processor for multitasking and parallel workloads, since it can execute more instructions simultaneously.

  2. Cache size: Larger caches reduce the frequency of cache misses, meaning the CPU spends less time waiting for data from RAM. A CPU with a large L3 cache may outperform a faster CPU with a small cache.

  3. RAM capacity and speed: Insufficient RAM causes the system to rely heavily on virtual memory (swapping to disk), which is extremely slow. A system with adequate fast RAM will outperform one with insufficient RAM regardless of CPU speed.

  4. Storage type: An SSD is orders of magnitude faster than an HDD for boot times, application loading, and file operations. A system with an SSD but slower CPU may feel more responsive than one with a fast CPU and HDD.

  5. Bus speed and width: The speed of the system bus (front-side bus) affects how quickly data can transfer between the CPU, RAM, and other components.