Codes and signals

People send messages over long distances with light, sound and electricity. The message travels as a signal, and a code turns the message into a pattern that the signal can carry.

Key facts

  • A signal is something that carries a message from one place to another: a whistle, a drum beat, a flashing light or a waving flag.
  • Sound and light both carry signals. Light travels much faster than sound, so you see a flash of lightning before you hear the thunder.
  • A code is a set of patterns that stand for letters or words. Morse code uses short and long signals: dots (·) and dashes (–).
  • In Morse code S is · · · and O is – – –, so SOS, a call for help, is · · · – – – · · ·. It can be sent with flashes of light, beeps or taps.
  • A picture can be sent as a code too: split it into a grid of small squares (pixels) and send whether each square is black or white. More, smaller squares give a sharper picture.
  • An analog signal changes smoothly and can take any value, like the voltage from a microphone. A digital signal has only two values, 0 and 1.
  • Every signal picks up noise on the way. A digital receiver only has to tell 0 from 1, so small noise does not change the message; noise on an analog signal stays in it. This makes digital signals more reliable.
  • Each 0 or 1 in a digital signal is called a bit.
  • 8 bits make 1 byte. With n bits there are 2ⁿ different patterns: 1 bit gives 2, 2 bits give 4, 8 bits give 256.
  • Digital information is easy to store, to copy with no loss, to compress and to send far. But it can be deleted, damaged or stolen, so people keep backups and encrypt it.

Worked examples

Example 1

Morse code: T = –, E = ·, N = – ·. Which word is sent: – / · / – · ?

  1. The slashes split the signal into letters: –, then ·, then – ·.
  2. – is T, · is E and – · is N.
  3. The word is TEN.

Answer: TEN

Example 2

A message is sent with 3 bits. How many different patterns can it send?

  1. Each bit is 0 or 1: 2 choices.
  2. 3 bits: 2 × 2 × 2 = 8 patterns (000, 001, 010, 011, 100, 101, 110, 111).

Answer: 8