02 The binary number system
The decimal system uses ten digits and weights 10⁰, 10¹, 10², ... For example 17 = 1 × 10¹ + 7 × 10⁰. The binary system has two digits (0 and 1) and weights 2⁰, 2¹, 2², 2³ ... For example:
- 3 = 1 × 2¹ + 1 × 2⁰ = 11₂
- 5 = 1 × 2² + 0 × 2¹ + 1 × 2⁰ = 101₂
- 13 = 8 + 4 + 0 + 1 = 1101₂
- 10110₂ = 16 + 0 + 4 + 2 + 0 = 22.
- With n binary digits (bits) we can represent 2ⁿ different values: 8 bits give 256 values.
- An analog-to-digital converter (ADC) encodes the natural signal into binary code; at the receiver a digital-to-analog converter (DAC) decodes it back.
- Pictures are divided into tiny elements called pixels and each is coded.