OCR J277 GCSE Computer Science · 1.2 Memory and Storage

Stretch tasks Binary, Denary and Hexadecimal

Task 1

Quiz Challenge

A quiz game against four computer players, then short and long written answers.

  1. Quiz Blitz12 questions against the clock
  2. Quick Fire4 short answers
  3. Big Think2 long answers

About 20 minutes

Task 2

This or That

Pixel the cat asks 8 questions. Each has two answers: pick the right one.

  • Two answers to every question
  • A fish treat for every right answer
  • Streaks win Pixel shades, then a party hat

About 4 minutes

Task 3

Memory Match

Flip the cards two at a time to match each hex card to its denary card.

  • 12 cards: each hex has a denary
  • One peek at every card
  • Combo points for pairs found in a row

6 pairs, about 4 minutes

Task 4

Sort It

Sort each statement into the right box, like the tick-box tables in the exam.

  • 12 cards to sort into 3 boxes
  • Drag a card, tap a box or press its number
  • Combo points for cards sorted in a row

12 cards, about 4 minutes

The games need JavaScript. Every question is below, with the answers at the end.

Read the lesson: Binary, Denary and Hexadecimal

Binary, Denary and Hexadecimal: the questions

Quiz Challenge, round 1: Quiz Blitz

  1. Convert binary 10110010 to denary.

  2. Convert denary 200 to 8-bit binary.

  3. Convert binary 11010110 to hexadecimal.

  4. What is hex 3A in denary?

    • 310
    • 48
    • 60
    • 58
  5. Convert denary 93 to hexadecimal.

  6. Computers store data in hexadecimal to save space.

    • True
    • False
  7. 11010110 + 01001010 is worked out in 8 bits. What happens?

    • The answer is 255
    • The carry is kept in a 9th bit
    • Nothing unusual: the answer fits
    • Overflow: the answer needs 9 bits
  8. What does a logical shift left by 2 places do to an unsigned number?

    • Multiplies it by 2
    • Divides it by 4
    • Adds 2 to it
    • Multiplies it by 4
  9. Shift 00001101 right by 2 places. Give the 8-bit result.

  10. Which TWO are reasons hexadecimal is used?

    Tick 2.

    • It is shorter than binary, so easier to read
    • Errors are easier to spot
    • The CPU processes hex faster
    • Hex files take less storage
    • Hex can store negative numbers
  11. Order these values from smallest to largest.

    Number these 1 to 4.

    • Hex 1A
    • Denary 30
    • Hex 2F
    • Binary 00001111
  12. In binary addition, what is 1 + 1 + 1?

    • 1 carry 0
    • 11 carry 1
    • 1 carry 1
    • 0 carry 1

Quiz Challenge, round 2: Quick Fire

  1. Convert hexadecimal 2F to binary. Show your working. [2 marks]

  2. Describe what is meant by an overflow error. [2 marks]

  3. State the effect of a logical shift left by 3 places on an unsigned binary number. [2 marks]

  4. Explain why hexadecimal is used by programmers instead of binary. [2 marks]

Quiz Challenge, round 3: Big Think

  1. Add the binary numbers 00110101 and 00011011. Show your working and check your answer in denary. [4 marks]

  2. Explain the effect of shifting 00001101 two places to the right. Explain why the result is not exactly what you might expect. [4 marks]

This or That: tick the right answer

  1. What is hex B in denary?

    • 12
    • 11
  2. Where is the most significant bit of a binary number?

    • At the left
    • At the right
  3. A right shift of 3 places divides a number by...

    • 8
    • 3
  4. A 6-bit number is split into nibbles for hex. Which end do you group from?

    • The right
    • The left
  5. What is the largest number 8 unsigned bits can hold?

    • 255
    • 256
  6. Which sum overflows in 8 bits?

    • 200 + 100
    • 100 + 100
  7. What is 1 + 1 in binary?

    • 10
    • 11
  8. Where would you see hexadecimal?

    • On a shop receipt
    • In a MAC address

Memory Match: match each hex to its denary

HexDenary
A A1 125
B F2 10
C 1F3 58
D 3A4 255
E 7D5 15
F FF6 31

Sort It: tick one box in each row

Binary addition, binary shifts or hexadecimal?

StatementBinary additionBinary shiftsHexadecimal
1 + 1 = 0 carry 1
Used for colour codes such as #FF8800
Base 16
One digit stands for four bits
Uses the letters A to F for 10 to 15
Empty places are filled with 0
Overflow happens when the total is over 255 in 8 bits
Work from right to left, carrying into the next column
1 + 1 + 1 = 1 carry 1
Bits that fall off the end are lost
Moving left by 2 places multiplies by 4
Moving right by 1 place halves the value
Answers

Round 1: Quiz Blitz

  1. 178 128 + 32 + 16 + 2 = 178. Write the place values above the digits first.
  2. 11001000 128 fits, leaving 72. 64 fits, leaving 8. 8 fits. So 11001000.
  3. D6 Split into nibbles: 1101 is 13, which is D, and 0110 is 6. So D6.
  4. 58 (3 x 16) + 10 = 48 + 10 = 58. A is 10.
  5. 5D 93 divided by 16 is 5 remainder 13, and 13 is D. So 5D.
  6. False Computers only ever store binary. Hex is a shorthand for people.
  7. Overflow: the answer needs 9 bits 214 + 74 = 288, which is more than 255, so the carry out of the top bit is lost.
  8. Multiplies it by 4 Each place left doubles the value, so 2 places multiply by 2 x 2 = 4.
  9. 00000011 13 becomes 3. The two 1s that fall off the right-hand end are lost.
  10. It is shorter than binary, so easier to read; Errors are easier to spot Hex helps people. The computer still stores and processes binary.
  11. Binary 00001111 → Hex 1A → Denary 30 → Hex 2F In denary they are 15, 26, 30 and 47.
  12. 1 carry 1 1 + 1 + 1 is 3, which is 11 in binary: write 1 and carry 1.

Round 2: Quick Fire

    • 2 becomes the nibble 0010
    • F is 15, which becomes 1111, so 2F is 00101111
    Model answer

    2 becomes 0010, and F, which is 15, becomes 1111. So 2F is 00101111.

    • The result of a calculation needs more bits than are available
    • The carry out of the most significant bit is lost, so the stored result is wrong
    Model answer

    An overflow error happens when the result of a calculation needs more bits than are available. The carry out of the most significant bit is lost, so the stored result is wrong.

    • It multiplies the number by 8
    • Bits shifted off the left-hand end are lost and the gaps fill with zeros
    Model answer

    It multiplies the number by 8, because 2 to the power 3 is 8. Bits shifted off the left-hand end are lost, and the empty places on the right are filled with zeros.

    • It is shorter: one hex digit stands for four bits
    • So it is easier to read and remember, with fewer mistakes
    Model answer

    One hex digit stands for four bits, so values are a quarter of the length of binary. That makes them easier to read, write and remember, with fewer mistakes.

Round 3: Big Think

    • Works from right to left, carrying 1s
    • The answer is 01010000
    • The two numbers are 53 and 27
    • The answer is 80 in denary, which checks out
    Model answer

    Working from right to left with carries: 00110101 + 00011011 = 01010000. Check: 00110101 is 53 and 00011011 is 27, and 53 + 27 = 80. 01010000 is 64 + 16 = 80, so the answer is correct.

    • A right shift of two places divides by 4
    • The result is 00000011
    • 13 becomes 3
    • 13 / 4 is 3.25: the bits that fall off are lost, so the fraction is lost
    Model answer

    Shifting right two places divides the number by 4. 00001101 is 13, and the result is 00000011, which is 3. But 13 divided by 4 is 3.25: the two bits shifted off the right-hand end are lost, so the fraction cannot be stored and the answer is rounded down.

This or That

  1. 11 A is 10, so B is 11.
  2. At the left The leftmost bit has the biggest place value. The rightmost has a place value of 1.
  3. 8 Each place right halves the number, so 3 places divide by 2 x 2 x 2 = 8.
  4. The right Group from the right, so the short group ends up on the left, where leading zeros can pad it.
  5. 255 11111111 is 255. There are 256 values, but they start at 0.
  6. 200 + 100 200 + 100 = 300, which is over 255. 100 + 100 = 200 fits.
  7. 10 1 + 1 is 2, which is 10 in binary: write 0 and carry 1.
  8. In a MAC address Hex appears in MAC addresses, colour codes, memory addresses and error codes.

Memory Match

  • A 2 A: 10
  • B 5 F: 15
  • C 6 1F: 31
  • D 3 3A: 58
  • E 1 7D: 125
  • F 4 FF: 255

Sort It

  1. Binary addition 1 + 1 = 0 carry 1 That is one of the four rules of binary addition.
  2. Hexadecimal Used for colour codes such as #FF8800 Two hex digits for each of red, green and blue.
  3. Hexadecimal Base 16 Hexadecimal is base 16.
  4. Hexadecimal One digit stands for four bits One hex digit replaces one nibble.
  5. Hexadecimal Uses the letters A to F for 10 to 15 Base 16 needs sixteen digits, so it borrows six letters.
  6. Binary shifts Empty places are filled with 0 A logical shift fills the vacated positions with zeros.
  7. Binary addition Overflow happens when the total is over 255 in 8 bits A total that needs a ninth bit overflows, and the carry is lost.
  8. Binary addition Work from right to left, carrying into the next column Binary addition works like column addition in denary.
  9. Binary addition 1 + 1 + 1 = 1 carry 1 Three 1s in a column make 3, which is 11 in binary.
  10. Binary shifts Bits that fall off the end are lost That is why a right shift can lose a fraction.
  11. Binary shifts Moving left by 2 places multiplies by 4 A left shift of n places multiplies by 2 to the power n.
  12. Binary shifts Moving right by 1 place halves the value A right shift of n places divides by 2 to the power n.