Digital circuits reliably distinguish two logic levels, represented as 0 and 1. Patterns of bits can encode numbers, text, images and sound.
The on/off switch picture is a simple model; actual logic levels correspond to defined voltage ranges.
Two logic states
Units
A bit is one binary digit; a nibble is four bits and a byte is eight.
Using decimal prefixes: kB = 1,000 bytes, MB = 1,000,000 bytes, and each larger SI prefix is a factor of 1,000. Binary prefixes KiB, MiB and GiB instead use factors of 1,024.
Place values (8-bit)
128, 64, 32, 16, 8, 4, 2, 1.
Reading unsigned 1011
Converting binary to denary
Add the place values where there is a 1. 1011 = 8 + 2 + 1 = 11. 11001010 = 128 + 64 + 8 + 2 = 202.
Converting denary to binary
Subtract place values or divide by 2. 13 = 8 + 4 + 1 = 1101. Pad with zeros to 8 bits: 00001101.
Range
n bits can store 2n different values: 8 bits → 256 (0 to 255); 16 bits → 65,536.
Patterns and unsigned range
Uses
Understanding binary is needed for storage, networking and data representation.
幻灯片
Sign up free to view the lesson slides
Step through every slide for this topic — plus flashcards and revision notes — with a free account.