Programming foundations

Stage 3 · Lesson 1 of 9

Binary, bits and bytes

How computers run your code

Computers store everything as , ones and zeros. Bits are grouped into bytes of 8 bits, so a byte has 256 possible values, 0 to 255. Binary is counting in base 2, where each place is worth double the one to its right.

So 1011 is 8 + 0 + 2 + 1 = 11. Hexadecimal, or base 16, is a shorthand for binary, because each hex digit is exactly 4 bits. That is why colours look like #FF8800 and look like 0x7ffe.

Learn to convert small numbers between decimal, binary and hex by hand. The point is not arithmetic for its own sake. The same bits can mean a number, a letter or a pixel, depending on how a program reads them, and that idea runs through the rest of this stage.

A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it

Resources for this stage

Start with· follow one of these

Keep handy

  • Quick explanations of OS basics like processes and memory when a lecture skips a step

Also worth your time

  • Everything from a key press to a rendered page; read it after this stage

Mark this stage as not done?