TopMyGrade

GCSE/Computer Science/OCR

1.2.4Number representations: denary, binary and hexadecimal; converting between them; binary addition and binary shifts

Notes

Number representations: binary, denary and hexadecimal

OCR J277 is one of the few GCSE subjects with guaranteed calculation questions. Binary/hex conversions and binary arithmetic appear on virtually every Paper 1. Mastering these is important — they are easy marks if practised.

Denary (base 10)

The number system we use every day. Uses digits 0–9. Each position is a power of 10.

Binary (base 2)

Uses only digits 0 and 1 (bits). Each position is a power of 2:

Bit position1286432168421
(2^n)2⁷2⁶2⁵2⁴2⁰

Binary to denary

Add up the values of all positions where the bit is 1. Example: 10110101 = 128+32+16+4+1 = 181.

Denary to binary

Repeatedly divide by 2, record the remainder, read remainders bottom-up. Example: 181 ÷ 2 = 90 r1; 90÷2=45 r0; 45÷2=22 r1; 22÷2=11 r0; 11÷2=5 r1; 5÷2=2 r1; 2÷2=1 r0; 1÷2=0 r1. Read up: 10110101

Binary addition

Rules: 0+0=0; 0+1=1; 1+1=10 (write 0, carry 1); 1+1+1=11 (write 1, carry 1).

Example: 01101010

  • 00110111 = 10100001

Overflow occurs if the result is too large to fit in the number of bits. E.g. adding two 8-bit numbers that produce a 9-bit result — the 9th bit is lost, giving a wrong answer.

Binary shifts

Logical left shift (multiply)

Shift all bits left by n positions; fill vacated right positions with 0; bits shifted off the left are lost.

  • Left shift by 1 = multiply by 2¹ = 2.
  • Left shift by 2 = multiply by 2² = 4. Example: 00000110 (6) left shift 1 → 00001100 (12).

Logical right shift (divide)

Shift all bits right by n positions; fill vacated left positions with 0; bits shifted off the right are lost.

  • Right shift by 1 = divide by 2 (any remainder is discarded). Example: 00001100 (12) right shift 1 → 00000110 (6).

⚠ Right shift discards the remainder — 00001101 (13) right shift 1 → 00000110 (6), not 6.5.

Hexadecimal (base 16)

Uses digits 0–9 and A–F (A=10, B=11, C=12, D=13, E=14, F=15). Each hex digit represents exactly 4 bits (a nibble).

Why use hexadecimal?

  • More compact than binary (4 bits → 1 hex digit).
  • Used in: MAC addresses, IP addresses, colour codes (HTML), memory addresses, error codes.
  • Human-readable shorthand for binary.

Binary to hex

Split binary into groups of 4 (from the right); convert each nibble to its hex digit. Example: 10110101 → 1011 | 0101 → B | 5 → B5.

Hex to binary

Replace each hex digit with its 4-bit binary equivalent. Example: 3F → 3=0011, F=1111 → 00111111.

Hex to denary

Multiply each digit by its positional value (powers of 16). Example: B5 = (11 × 16) + (5 × 1) = 176 + 5 = 181.

Common OCR exam mistakes

  1. Forgetting to pad binary to 8 bits when converting to hex (must group into nibbles of exactly 4 bits).
  2. Writing A=10 but then treating hex incorrectly in arithmetic — always convert to denary for arithmetic, then back.
  3. Overflow: forgetting that the carry bit is lost — the question often asks what the result is AND whether overflow occurred.
  4. Right shift: forgetting that any remainder/fractional result is discarded (it's integer division).

AI-generated · claude-opus-4-7 · v3-ocr-computer-science

Practice questions

Try each before peeking at the worked solution.

  1. Question 12 marks

    Binary to denary conversion

    Convert the binary number 10101100 to denary. Show your working. [2 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

  2. Question 23 marks

    Denary to binary conversion

    Convert the denary number 217 to an 8-bit binary number. Show your working. [3 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

  3. Question 34 marks

    Binary addition with overflow

    Add the following 8-bit binary numbers. State whether overflow has occurred and explain why.

    10110010

    • 01100111

    [4 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

  4. Question 43 marks

    Binary shift

    The binary number 00001010 is logically left-shifted by 2 places.

    (a) Write the resulting binary number. [1]
    (b) State the denary value before and after the shift and explain the effect. [2]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

  5. Question 52 marks

    Binary to hexadecimal

    Convert the binary number 11001110 to hexadecimal. Show your method. [2 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

  6. Question 62 marks

    Why is hex used?

    Give two reasons why hexadecimal is used in computing instead of binary. [2 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

Flashcards

1.2.4 — Number representations: denary, binary and hexadecimal; converting between them; binary addition and binary shifts

10-card SR deck for OCR Computer Science (J277) topic 1.2.4

10 cards · spaced repetition (SM-2)