The smallest unit of information is the bit. Eight bits form a byte. Larger quantities are expressed with either:
Quick‑Reference Box – Bit‑level values
| Prefix (type) | Symbol | Bits | Bytes |
|---|---|---|---|
| kilo (decimal) | k | 10³ = 1 000 | 10³ = 1 000 |
| kibi (binary) | Ki | 2¹⁰ = 1 024 | 2¹⁰ = 1 024 |
| mega (decimal) | M | 10⁶ = 1 000 000 | 10⁶ = 1 000 000 |
| mebi (binary) | Mi | 2²⁰ = 1 048 576 | 2²⁰ = 1 048 576 |
| giga (decimal) | G | 10⁹ = 1 000 000 000 | 10⁹ = 1 000 000 000 |
| gibi (binary) | Gi | 2³⁰ = 1 073 741 824 | 2³⁰ = 1 073 741 824 |
| tera (decimal) | T | 10¹² = 1 000 000 000 000 | 10¹² = 1 000 000 000 000 |
| tebi (binary) | Ti | 2⁴⁰ = 1 099 511 627 776 | 2⁴⁰ = 1 099 511 627 776 |
\[
\begin{aligned}
500\ \text{GB (decimal)} &= 500\times10^{9}\ \text{bytes}\\
&= \frac{500\times10^{9}}{2^{30}}\ \text{GiB}\\
&\approx 465\ \text{GiB (binary)}.
\end{aligned}
\]
To convert binary → decimal, multiply each bit by \(2^{n}\) where \(n\) counts from 0 at the right‑most position, then sum.
Example: \(101101_2\)
\[
1\cdot2^{5}+0\cdot2^{4}+1\cdot2^{3}+1\cdot2^{2}+0\cdot2^{1}+1\cdot2^{0}=45_{10}.
\]
Decimal → binary is performed by successive division by 2, recording the remainders (or by using known powers of 2).
Hexadecimal (base 16) uses digits 0‑9 and letters A‑F. Group binary digits in sets of four (starting from the right) and replace each quartet with its hex equivalent.
Example: Convert \(0b1101101_2\) to hexadecimal.
BCD stores each decimal digit as a separate 4‑bit binary nibble.
0100 0101₂.0111 0011₂.| 10110101₂ | + | 01101011₂ |
| ↓ | ||
| 1 001 000 000₂ (9 bits) | ||
The left‑most “1” is a carry‑out. In an 8‑bit unsigned operation this carry is discarded, leaving 0010 0000₂ = 32₁₀. Because a carry‑out occurred, an overflow flag would be set in hardware.
To compute \(A - B\) (both 8‑bit signed numbers):
Example: \(A = 01001100₂\) (76₁₀) and \(B = 00110101₂\) (53₁₀).
11001010₂.11001011₂ (add 1).01001100₂
+ 11001011₂
= 1 00010111₂
00010111₂ = 23₁₀, which matches \(76-53\).| Operation | Carry‑out | Overflow (signed) | Interpretation |
|---|---|---|---|
| Unsigned addition | Yes → result wraps modulo 2ⁿ | N/A | Carry‑out indicates loss of the most‑significant bit. |
| Signed addition (two’s complement) | May occur without error | Yes if the carry into the sign‑bit ≠ carry out of the sign‑bit | Overflow means the mathematical result cannot be represented in the given bit‑width. |
Add 10110101₂ and 01101011₂. State whether overflow occurs for unsigned and for signed 8‑bit numbers.
ASCII defines 128 characters (0‑127). The most common printable characters are shown below.
| Char | Decimal | Hex | Binary |
|---|---|---|---|
| A | 65 | 0x41 | 0100 0001₂ |
| a | 97 | 0x61 | 0110 0001₂ |
| 0 | 48 | 0x30 | 0011 0000₂ |
| Space | 32 | 0x20 | 0010 0000₂ |
Uses the high‑order bit to add another 128 characters (e.g., accented letters, box‑drawing symbols). The exact set depends on the code page (ISO‑8859‑1, Windows‑1252, etc.). Example (ISO‑8859‑1): € = 0x80 = 1000 0000₂.
Unicode assigns a unique code point (U+0000 … U+10FFFF) to every character. UTF‑8 is a variable‑length encoding that uses 1–4 bytes:
110xxxxx 10xxxxxx.1110xxxx 10xxxxxx 10xxxxxx.11110xxx 10xxxxxx 10xxxxxx 10xxxxxx.All continuation bytes start with 10, which makes UTF‑8 self‑synchronising.
43 61 6D (same as ASCII because all code points are ≤ 0x7F).
Binary pattern 11000011 10101001 → hex C3 A9.
Encode the following characters:
0x2F → binary → decimal → BCD.Bar chart (not displayed) comparing the magnitude of each prefix up to tera‑level. Use blue bars for decimal prefixes (k, M, G, T) and green bars for binary prefixes (Ki, Mi, Gi, Ti). Include a small inset showing the “missing” space when a 500 GB drive is displayed as ~465 GiB.
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.