3.1.1 · D3Boolean Algebra & Logic Gates

Worked examples — Binary number system and bit - byte concepts

1,829 words8 min readBack to topic

The scenario matrix

Every binary/byte question is really one of these case classes. We work at least one example of each.

Cell Case class What makes it tricky Covered by
A Small binary → decimal line up column weights Ex 1
B Full byte → decimal (all 1s) the max value Ex 2
C Zero / degenerate input and leading zeros Ex 3
D Decimal → binary (odd) remainders bottom-up Ex 4
E Decimal → binary (exact power of 2) a single lone Ex 5
F "How many bits fit this number?" , off-by-one Ex 6
G Real-world storage word problem KiB vs kB units Ex 7
H Exam twist: max-value trap vs Ex 8
Figure — Binary number system and bit - byte concepts

Keep that picture in your head — each bit is a switch, each column doubles. Every example below is just this ruler used forwards or backwards.


Cell A — small binary → decimal


Cell B — the full byte (all ones)


Cell C — zero and degenerate inputs


Cell D — decimal → binary, odd number


Cell E — decimal → binary, exact power of two


Cell F — "how many bits do I need?"


Cell G — real-world storage word problem


Cell H — the exam twist (max-value trap)


Case coverage check

Recall Did every matrix cell get worked?

A small→dec ::: Ex 1 () B all-ones byte ::: Ex 2 () C zero / leading zeros ::: Ex 3 (, ) D decimal→binary odd ::: Ex 4 () E exact power of two ::: Ex 5 () F bits needed ::: Ex 6 ( bits) G real-world units ::: Ex 7 ( MiB bits, photos) H max-value trap ::: Ex 8 (4 bits max )


Connections