Chapter recap
Units: 1 B = 8 b; rates decimal (k = 10³), sizes binary (K = 2¹⁰) unless the question says otherwise; time to push out = bits ÷ bit/s. Binary/hex: place values 1, 2, 4…; one hex digit = 4 bits; k bits → 2ᵏ values (max 2ᵏ − 1). Bit operations: XOR marks differences and is carry-free addition; 1's-complement addition wraps the carry around; modulo-2 division XORs at each leading 1 and leaves a remainder one bit shorter than the divisor. Logs and probability: bits for N values = ⌈log₂ N⌉; exactly one of n = n·p·(1 − p)ⁿ⁻¹; (1 − 1/n)ⁿ → 1/e.
Merged rule card
From 0.2.1 Bits, bytes and prefixes: powers of 10 for rates, powers of 2 for sizes
- 1 B = 8 b. Lower-case b = bit, upper-case B = byte.
- Rates: k = 10³, M = 10⁶, G = 10⁹ (bps).
- Sizes: K = 2¹⁰, M = 2²⁰, G = 2³⁰ (bytes) — unless the question says 1000.
- Time to push out = (size in bits) ÷ (rate in bit/s).
- ms = 10⁻³ s, µs = 10⁻⁶ s, ns = 10⁻⁹ s.
From 0.2.2 Binary, decimal and hex; powers of 2
- Binary places: 1, 2, 4, 8, 16, 32, 64, 128, …; MSB left, LSB right.
- Hex: one digit = 4 bits; A–F = 10–15; group from the right.
- k bits → 2ᵏ values, 0 … 2ᵏ − 1.
- Bits needed for N values = smallest k with 2ᵏ ≥ N.
- 2¹⁰ = 1024 · 2¹⁶ = 65,536 · 2²⁰ ≈ 1.05 M · 2³² ≈ 4.29 × 10⁹.
From 0.2.3 XOR, 1's complement addition and modulo-2 division
- AND (mask), OR, NOT (flip), XOR (1 where bits differ).
- a ⊕ a = 0, a ⊕ 0 = a, (a ⊕ k) ⊕ k = a.
- 1's complement = flip all bits; 1's-complement addition wraps the end carry back in.
- Modulo-2: + = − = XOR, no carries; bits ↔ polynomial.
- Mod-2 division: leading 1 → XOR divisor; leading 0 → XOR zeros; remainder = (divisor length − 1) bits.
From 0.2.4 Exponents, logarithms and basic probability
- 2ᵃ·2ᵇ = 2ᵃ⁺ᵇ; 2¹⁰ ≈ 10³ (estimates only).
- log₂ x = power of 2 giving x; bits for N values = ⌈log₂ N⌉.
- P(none) = (1−p)ⁿ · P(≥ 1) = 1 − (1−p)ⁿ · P(exactly 1) = n·p·(1−p)ⁿ⁻¹.
- (1 − 1/n)ⁿ → 1/e ≈ 0.368; 1/(2e) ≈ 0.184.
- 1 + 2 + … + 2ᵏ⁻¹ = 2ᵏ − 1; expected tries = 1/p.
Practice questions
- NAT · 2 marks
A 3 MB file (MB = 2²⁰ B) is pushed out at 24 Mbps. Time in seconds (3 decimals)?
Write your answer before opening the key.
- MCQ · 1 mark
Which value is 0x7F?
- 127
- 128
- 255
- 112
- NAT · 1 mark
16-bit 1's-complement sum of 0xFFFF and 0x0002, in decimal?
Write your answer before opening the key.
- MCQ · 2 marks
Remainder of 100100000 ÷ 1101 (modulo-2)?
- 001
- 101
- 011
- 000
- MSQ · 1 mark
Which are equal to 2¹⁶?
- 65,536
- 0x10000
- 64 × 1024
- 10⁵ approximately within 1 %
- NAT · 1 mark
8 stations each send with p = 0.125. P(none sends)? (4 decimals)
Write your answer before opening the key.
- MCQ · 1 mark
Minimum bits to number 0 to 1023?
- 9
- 10
- 11
- 1023
- MCQ · 1 mark
100 Mbps expressed in bytes per second is:
- 12.5 × 10⁶
- 12.5 × 2²⁰
- 800 × 10⁶
- 100 × 2²⁰
- NAT · 1 mark
n = 4, p = 1/4: P(exactly one) to 4 decimals?
Write your answer before opening the key.
Answer key
Try the questions first. Open when you are ready to check.
- 1.04..1.06 — 3 × 2²⁰ × 8 = 25,165,824 bits ÷ 2.4 × 10⁷ = 1.048576 s.
- A — 7 × 16 + 15 = 127.
- B: 128 = 0x80.
- C: 255 = 0xFF.
- D: 112 = 0x70.
- 2 — 65535 + 2 = 65537 = 0x10001 → wrap: 0x0001 + 1 = 0x0002 = 2.
- A — Long division with XOR gives remainder 001.
- B: Arithmetic slip; recheck each XOR.
- C: Arithmetic slip; recheck each XOR.
- D: The divisor does not divide exactly.
- ABC — 2¹⁶ = 65,536 = 0x10000 = 64 × 1024.
- D: 65,536 is 34 % off 10⁵.
- 0.343..0.344 — 0.875⁸ ≈ 0.3436.
- B — 1024 values = 2¹⁰ → 10 bits.
- A: 9 bits give only 512 values.
- C: More than needed.
- D: That is the largest value, not a bit count.
- A — Divide bits by 8; the rate stays decimal: 12.5 × 10⁶ B/s.
- B: A rate is never converted with 2²⁰.
- C: Multiplying by 8 goes the wrong way.
- D: Neither divided by 8 nor decimal.
- 0.4218..0.4219 — 0.75³ = 0.421875.