Binary, Denary and Hex

Binary, denary and hex

In one line

They're three ways of writing the same numbers. Each one uses place value; only the number of digits changes.

SystemDigits it usesEach column is worth…
Denary (normal numbers)10 digits: 0 to 910 × the column to its right
Binary (what computers store)2 digits: 0, 12 × the column to its right
Hex (shorthand for binary)16 digits: 0 to 9, A to F16 × the column to its right
1

Place value, which you already use

Each column in a normal number is worth 10 times the column on its right. You do this in your head without noticing.

▶

Take a number apart

Try 9, 99 or 999, then press + 1.
?Why?

Why does 9 turn into 10? There's no digit after 9. The ones column runs out, resets to 0, and carries 1 into the next column.

2

Binary columns

Binary has only 2 digits, so each column is worth double the one on its right.

▶

Build the row yourself

Start at 1 on the right. Press the button to double it and add a new column on the left.

▶

Count in binary

Same as normal counting, but you run out of digits after 1. Watch the carries.

Denary0Binary0000
★Remember

128 · 64 · 32 · 16 · 8 · 4 · 2 · 1

Learn this row by heart. Almost every binary question uses it.

3

Binary → denary

For every column: if its bit is 1, count the column's value. If it's 0, skip it. Add up what you counted.

▶

Tap the bits

Answer

The formula box below follows your bits. You can also type bits into it.

?Why?

Why is 2⁰ = 1? Moving left doubles, so moving right halves. 2¹ = 2, and half of 2 is 1. That's 2⁰.

4

Denary → binary

Go through the columns from biggest to smallest. Ask one question each time: does this column's value fit into what's left? Yes = write 1 and take it away. No = write 0.

▶

One question at a time

5

Hexadecimal, and why it exists

Binary is hard for people to read: 1001110011110101. Hex is a shorthand for it.

?Why?

Why 16? 4 bits make 2⁴ = 16 patterns. So one hex digit stands for exactly 4 bits, and one byte (8 bits) is exactly 2 hex digits. Letters stand in for 10 to 15: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.

▶

Split a byte into two hex digits

HexDenary

Blue box = the left digit. Orange box = the right digit.

6

Adding in binary

Add right to left, one column at a time, like normal. The twist: 2 is written 10 in binary, and 3 is written 11.

0 + 0 = 0write 0, carry 0
0 + 1 = 1write 1, carry 0
1 + 1 = 10two: write 0, carry 1
1 + 1 + 1 = 11three: write 1, carry 1
▶

Add column by column

or tap the top two rows
7

Overflow

A byte only holds 0 to 255. If an answer needs a 9th column, there isn't one, so that carry is lost.

▶

A byte is like a clock

The byte stores

A clock goes round after 12. A byte goes round after 255, back to 0.

8

Binary shifts

Slide every bit one column to the left and the number doubles. Slide right and it halves. Like moving digits in denary: 35 → 350 multiplies by 10.

▶

Slide the bits

Value
9

Negative numbers (A-level bonus)

In two's complement, the leftmost column is worth −128 instead of +128. Everything else stays the same.

▶

Same bits, two meanings

e.g.Example

To write −5: write +5 (00000101), flip every bit (11111010), add 1 → 11111011.

✓

Check yourself

Endless practice questions. Pick the kinds you want. A wrong answer shows you the working, step by step.

0 of 0 right