1.2.4a

Data Storage (Numbers)

The number systems and methods you need to know: denary, binary, and hexadecimal conversion, binary addition and overflow, most and least significant bits, and the effect of left and right shifts. Once the patterns are clear, these questions become very predictable.

8 exam questions 21 flashcards

What you need to know

  • Convert positive denary whole numbers to 8-bit binary and back again.
  • Add binary numbers and explain overflow errors.
  • Convert between denary, binary, and 2-digit hexadecimal.
  • Understand MSB and LSB and explain the effect of left and right shifts.

Big Picture

The three number systems you need

You need to move confidently between denary, binary, and hexadecimal.

  • Denary is the normal base 10 number system used in everyday life.
  • Binary is base 2 and uses only 0 and 1.
  • Hexadecimal is base 16 and uses 0 to 9 and A to F.
  • Hex is used because it is easier for humans to read than long binary strings.

Quick memory aid

Denary = 10 symbols, binary = 2 symbols, hexadecimal = 16 symbols.

Must Know

8-bit binary and place values

Every bit in an 8-bit number has a place value, just like columns in denary.

?

Try it — 8-bit place-value table

Slide the denary value or click bits to see binary and hex update together.

Denary57Binary00111001Hex39
128MSB
64
32
16
8
4
2
1LSB

Binary to denary means add the place values where you see a 1. Denary to binary means choose the biggest place values that fit.

From left to right, the place values are 128, 64, 32, 16, 8, 4, 2, and 1. To read a binary number, add the values of the columns that contain a 1.

The largest 8-bit value is 11111111, which equals 255. The smallest is 00000000, which equals 0.

  • 8-bit place values: 128, 64, 32, 16, 8, 4, 2, 1.
  • MSB means most significant bit, the leftmost bit.
  • LSB means least significant bit, the rightmost bit.
  • Leading zeros do not change the value.

Range

You usually work with positive numbers in the range 0 to 255 using up to 8 bits.

Core Method

Converting between denary and binary

These conversions are much easier when you stay calm and follow a method every time.

To convert binary to denary, add the place values where a 1 appears. For example, 00101111 is 32 + 8 + 4 + 2 + 1 = 47.

To convert denary to binary, start with the largest place value that fits into the number, write a 1 there, subtract it, and repeat. Put 0 in any column you do not use.

  • Binary to denary: add the values of the 1 columns.
  • Denary to binary: subtract the largest fitting place values.
  • Write answers as 8 bits when the question expects 8-bit form.

Simple rule

Binary to denary means add. Denary to binary means subtract the biggest columns that fit.

Exam Skill

Binary addition and overflow

Binary addition follows the same idea as denary addition, but you carry groups of 2 instead of groups of 10.

The key rules are: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 10, and 1 + 1 + 1 = 11. In the last two cases you write one bit and carry one to the next column.

Overflow happens when the true result needs more bits than the computer has available. In an 8-bit system, any result above 255 causes overflow.

  • 1 + 1 gives 0 and carry 1.
  • 1 + 1 + 1 gives 1 and carry 1.
  • Overflow means the result is too large to fit in the available bits.
  • In 8 bits, values above 255 overflow.

Common mistake

Overflow does not mean the calculation is wrong. It means the answer cannot be fully stored in the number of bits available.

Base 16

Hexadecimal and why it is useful

Hexadecimal is a shorter and more human-friendly way of showing binary data.

Each hexadecimal digit represents exactly 4 bits, which is one nibble. That means an 8-bit binary number can always be written as 2 hex digits.

The digits 0 to 9 work as normal, but A to F are used for the denary values 10 to 15. So the 2-digit hex range goes from 00 to FF.

  • A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
  • One hex digit = 4 binary bits.
  • Two hex digits = one 8-bit byte.
  • Hex is easier to read than long binary numbers.

Fast conversion trick

To convert binary to hex, split the 8 bits into two groups of 4 and convert each nibble separately.

Conversion

Converting between binary, denary, and hex

You may need to convert any number in the allowed ranges into another number base.

  • Binary to hex: split into nibbles and convert each nibble.
  • Hex to binary: turn each hex digit into a 4-bit nibble.
  • Denary to hex: divide by 16 to find the left digit and remainder.
  • Hex to denary: multiply the left digit by 16 and add the right digit.

Example pattern

A7 in hex means 10 groups of 16 plus 7, which is 167 in denary.

High-Value Exam Skill

Binary shifts

Shifts are one of the easiest places to gain marks if you learn the effect clearly.

A left shift moves every bit one place to the left and fills the new spaces with 0s. Each one-place left shift multiplies the number by 2.

A right shift moves every bit one place to the right and fills the new spaces with 0s. Each one-place right shift divides the number by 2.

  • Left shift by 1 means multiply by 2.
  • Left shift by 2 means multiply by 4.
  • Right shift by 1 means divide by 2.
  • Right shift by 3 means divide by 8.

Exam shortcut

If the question asks for the effect of a shift, you can often answer using powers of 2 without rewriting lots of text.

Key takeaways

  • Denary is base 10, binary is base 2, and hexadecimal is base 16.
  • An 8-bit binary number can represent values from 0 to 255.
  • Overflow happens when a result is too large to fit in the available bits.
  • A left shift multiplies by 2 for each place, while a right shift divides by 2 for each place.

Glossary

Denary
The base 10 number system used in everyday life.
Binary
The base 2 number system using only 0 and 1.
Hexadecimal
The base 16 number system using 0 to 9 and A to F.
MSB
Most Significant Bit, the leftmost bit in a binary number.
LSB
Least Significant Bit, the rightmost bit in a binary number.
Overflow
An error that happens when a result is too large to fit in the available bits.

Test yourself

Common questions