Denary, binary and hexadecimal

Robusta Study

Revision videos, vocabulary practice and written questions for IGCSE.

Denary, binary and hexadecimal

Place values, converting denary to binary and back, and why hex is used for bytes.

Transcript

Computers store everything as binary, using only zeros and ones. Each zero or one is a bit, and eight bits make a byte.

We count in denary, base ten, where each place is worth ten times more. Binary is base two, so each place is worth two times more.

In a byte the place values are one hundred and twenty eight, sixty four, thirty two, sixteen, eight, four, two, and one.

To change denary into binary, write the place values, then ask: does each one fit into the number? Let's convert one hundred and fifty.

One hundred and twenty eight fits, so write a one, and twenty two is left over. Sixty four and thirty two don't fit, so those are zeros.

Sixteen fits, leaving six. Eight doesn't fit. Four fits, two fits, and nothing is left. One is a zero. The answer is one zero zero one zero one one zero.

To go back, add up the place values that have a one. One twenty eight, sixteen, four and two make one hundred and fifty.

Binary numbers get long and hard to read. Hexadecimal is base sixteen. It uses the digits zero to nine, then the letters A to F for ten to fifteen.

To convert, split the byte into two nibbles of four bits. Each nibble becomes one hex digit. One zero zero one is nine, and zero one one zero is six. So one hundred and fifty is nine six in hex.

Hex is used for colour codes, M A C addresses, memory addresses and error messages. It is shorter, easier to read, and less error prone.

Binary is base two, denary is base ten, and hex is base sixteen. Three ways to write the same number.

More in this series