ZIMSEC O Level · Computer Science · Form 2, Form 3
Computers store all data as binary digits (bits): 0 or 1.
Units
8 bits = 1 byte; 1 kilobyte (KB) = 1 024 bytes; 1 MB = 1 024 KB; 1 GB = 1 024 MB; 1 TB = 1 024 GB.
Binary numbers
Place values in an 8-bit byte: 128, 64, 32, 16, 8, 4, 2, 1.
Worked example: Convert 01011010 to denary.
64 + 16 + 8 + 2 = 90
Worked example: Convert 45 to 8-bit binary.
45 = 32 + 8 + 4 + 1 → 00101101
Hexadecimal
Base 16: digits 0–9 and A–F (A = 10 … F = 15). Each hex digit stands for 4 bits, so hex is a short way to write binary (used for colour codes and memory addresses).
Worked example: Convert 1011 1110 to hexadecimal.
1011 = 11 = B and 1110 = 14 = E → BE
Text, images and sound
- Text: each character has a code (ASCII uses 7 or 8 bits; Unicode covers all world languages).
- Images: made of pixels; more pixels (resolution) and more colours (colour depth) mean larger files.
- Sound: sampled many times per second; higher sample rate means better quality and larger files.
Compression
Lossless (no data lost, e.g. ZIP) and lossy (some detail removed, e.g. JPEG, MP3) reduce file size.
Check yourself
- Convert 11001000 to denary.
- Convert 3F (hex) to denary.
- How many bytes are in 2 KB?
Show answers
- 128 + 64 + 8 = 200
- 3 × 16 + 15 = 63
- 2 048 bytes
Questions about this topic (0)
No questions about this topic yet.
Sign in or create a free account to join in.