Real World Maths Busters

The Maths Behind Everyday Life

The story, the formula and a worked example — see exactly where this maths shows up in the world around you.

Back to all stories
Technology 3 min read

Turning Human Code Into Machine Code

A compiler translates thousands of lines into millions of instructions.

When you write code, a compiler translates each high-level instruction into many machine instructions. A 1,000-line program might compile to 50,000+ machine instructions.

Instruction Expansion

A typical high-level statement expands to 5–50 machine instructions. A simple assignment like x = a + b × c might become: load a, load b, load c, multiply, add, store.

1,000-line program

  1. 1

    Average expansion

    About 20 machine instructions per line

  2. 2

    Total machine instructions

    1000×20=20,0001000 \times 20 = 20{,}000
  3. 3

    At 3 GHz

    20,0003×109≈6.7×10−6 s\frac{20{,}000}{3 \times 10^9} \approx 6.7 \times 10^{-6} \text{ s}
Answer

20,000 instructions — executed in under 7 microseconds

The takeaway

Compilers multiply your code into a cascade of simple instructions — and modern CPUs eat them in microseconds.

Back to all stories