Year 8 · Representations · Part A: Storing information

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

See place value in denary, then use the same idea with 2 digits (binary) and 16 digits (hex).

2

Convert binary ↔ denary ↔ hex by hand, one column at a time.

3

Add in binary, spot overflow, and use shifts to multiply and divide by 2.

4

Bonus: store negative numbers with two's complement.

DenaryBase 10. Our everyday numbers.
BinaryBase 2. Digits 0 and 1.
HexadecimalBase 16. 0–9 then A–F.
OverflowThe answer needs more bits than there are.

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.

Binary columns

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

Start at 1 on the right. Every step left is × 2. Eight columns = one byte.
▶

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.

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⁰.

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

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.

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

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.

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

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.

Common mix-ups

The mistakes nearly everyone makes the first time. Read the left, then the right.

People think

Binary 10 means ten.

Actually

Binary 10 is one 2 and no 1s = 2. Read it "one-zero", not "ten".

People think

The leftmost bit is the 1s column.

Actually

The rightmost bit is the 1s column, just like the ones column in denary.

People think

Hex is a different kind of data.

Actually

Hex is only a shorter way to write binary for people. The computer still stores bits.

People think

Hex F = 16.

Actually

F = 15. The 16 digits are 0 to 15, because 0 counts.

People think

Shifting right always halves exactly.

Actually

Odd numbers lose their last 1: 7 → 3. It rounds down.

Check yourself

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

0 of 0 right