Why computers use binary
- Computers are made of switches (transistors) that are either on or off, so data is stored as 1s and 0s called bits.
- 4 bits = 1 nibble. 8 bits = 1 byte.
Binary place values
- For 8 bits the place values are 128, 64, 32, 16, 8, 4, 2, 1.
- 1011 0101 = 128 + 32 + 16 + 4 + 1 = 181.
- The largest 8-bit number is 255, so 8 bits can store 256 different values (0 to 255).
Denary to binary
- Start with the largest place value that fits, subtract it, and repeat.
- 100 = 64 + 32 + 4, so 100 = 0110 0100.
Hexadecimal
- Hexadecimal is base 16. It uses 0–9 and A–F (A = 10, B = 11 … F = 15).
- Each hex digit represents one nibble: 1010 1111 = AF.
- Hex is easier for people to read and write than long binary numbers, with fewer mistakes.
Units of data
- bit → nibble (4 bits) → byte (8 bits) → kilobyte (1000 bytes) → megabyte → gigabyte → terabyte → petabyte, each ×1000.
Key terms
- Bit
- A single binary digit: 0 or 1.
- Nibble
- 4 bits.
- Byte
- 8 bits.
- Binary
- Base 2: numbers written using only 0 and 1.
- Denary
- Base 10: the everyday number system.
- Hexadecimal
- Base 16, using 0–9 and A–F.
- Overflow
- When a calculation's result needs more bits than are available.
Quick questions on Binary, denary and hexadecimal
- How many bits are there in a byte?
- 8: A byte is 8 bits.
- What is binary 1010 in denary?
- 10: 8 + 2 = 10.
- What is 1111 1111 in denary?
- 255: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255.
- What is denary 9 in 4-bit binary?
- 1001: 8 + 1 = 9, so 1001.
- Which hex digit represents 12?
- C: A = 10, B = 11, C = 12.
- What is hex F in binary?
- 1111: F = 15 = 8 + 4 + 2 + 1.
- Why do computers use binary?
- Their switches only have two states: on and off: Transistors are either on (1) or off (0).
- What is hex 2F in denary?
- 47: 2 × 16 + 15 = 47.
Binary, denary and hexadecimal: questions and answers
- How many different values can 8 bits store?
- 2⁸ = 256 values (0 to 255).
- What is denary 100 in 8-bit binary?
- 0110 0100. 64 + 32 + 4 = 100.
- Why do programmers use hexadecimal?
- It's easier to read than long binary numbers. Hex is a shorthand for binary that people can read more easily.