A1.2.2
Explain how binary is used to store data
Binary uses only two digits: 0 and 1 . These digits are bits . A group of 8 bits = a byte . Binary suits computers because electronic components reliably…
- Binary uses only two digits:
0and1. - These digits are bits. A group of 8 bits = a byte.
- Binary suits computers because electronic components reliably represent two states:
- off/on
- low/high voltage
- false/true
- Each bit has a place value based on powers of 2.
| Bit position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Binary can store:
- numbers as binary place values
- text as character codes (ASCII, Unicode)
- images as binary colour values per pixel
- audio as binary sample values
- instructions as binary machine code
Number of values
- With
nbits →2^ncombinations.- 3 bits →
2^3 = 8values. - 8 bits →
2^8 = 256values.
- 3 bits →
Unsigned vs Signed binary
- Unsigned: only non-negative values. 8 bits →
0to255. - Signed: positive and negative values; often uses two’s complement. 8 bits →
-128to127.