OCR J277 GCSE Computer Science · 1.2 Memory and Storage
Stretch tasks Binary, Denary and Hexadecimal
Quiz Challenge
A quiz game against four computer players, then short and long written answers.
- Quiz Blitz12 questions against the clock
- Quick Fire4 short answers
- Big Think2 long answers
About 20 minutes
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
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
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
Convert binary 10110010 to denary.
Convert denary 200 to 8-bit binary.
Convert binary 11010110 to hexadecimal.
What is hex 3A in denary?
- 310
- 48
- 60
- 58
Convert denary 93 to hexadecimal.
Computers store data in hexadecimal to save space.
- True
- False
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
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
Shift 00001101 right by 2 places. Give the 8-bit result.
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
Order these values from smallest to largest.
Number these 1 to 4.
- Hex 1A
- Denary 30
- Hex 2F
- Binary 00001111
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
Convert hexadecimal 2F to binary. Show your working. [2 marks]
Describe what is meant by an overflow error. [2 marks]
State the effect of a logical shift left by 3 places on an unsigned binary number. [2 marks]
Explain why hexadecimal is used by programmers instead of binary. [2 marks]
Quiz Challenge, round 3: Big Think
Add the binary numbers 00110101 and 00011011. Show your working and check your answer in denary. [4 marks]
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
What is hex B in denary?
- 12
- 11
Where is the most significant bit of a binary number?
- At the left
- At the right
A right shift of 3 places divides a number by...
- 8
- 3
A 6-bit number is split into nibbles for hex. Which end do you group from?
- The right
- The left
What is the largest number 8 unsigned bits can hold?
- 255
- 256
Which sum overflows in 8 bits?
- 200 + 100
- 100 + 100
What is 1 + 1 in binary?
- 10
- 11
Where would you see hexadecimal?
- On a shop receipt
- In a MAC address
Memory Match: match each hex to its denary
| Hex | Denary |
|---|---|
A A | 1 125 |
B F | 2 10 |
C 1F | 3 58 |
D 3A | 4 255 |
E 7D | 5 15 |
F FF | 6 31 |
Sort It: tick one box in each row
Binary addition, binary shifts or hexadecimal?
| Statement | Binary addition | Binary shifts | Hexadecimal |
|---|---|---|---|
| 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
- 178 128 + 32 + 16 + 2 = 178. Write the place values above the digits first.
- 11001000 128 fits, leaving 72. 64 fits, leaving 8. 8 fits. So 11001000.
- D6 Split into nibbles: 1101 is 13, which is D, and 0110 is 6. So D6.
- 58 (3 x 16) + 10 = 48 + 10 = 58. A is 10.
- 5D 93 divided by 16 is 5 remainder 13, and 13 is D. So 5D.
- False Computers only ever store binary. Hex is a shorthand for people.
- Overflow: the answer needs 9 bits 214 + 74 = 288, which is more than 255, so the carry out of the top bit is lost.
- Multiplies it by 4 Each place left doubles the value, so 2 places multiply by 2 x 2 = 4.
- 00000011 13 becomes 3. The two 1s that fall off the right-hand end are lost.
- It is shorter than binary, so easier to read; Errors are easier to spot Hex helps people. The computer still stores and processes binary.
- Binary 00001111 → Hex 1A → Denary 30 → Hex 2F In denary they are 15, 26, 30 and 47.
- 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 answer2 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 answerAn 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 answerIt 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 answerOne 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 answerWorking 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 answerShifting 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
- 11 A is 10, so B is 11.
- At the left The leftmost bit has the biggest place value. The rightmost has a place value of 1.
- 8 Each place right halves the number, so 3 places divide by 2 x 2 x 2 = 8.
- The right Group from the right, so the short group ends up on the left, where leading zeros can pad it.
- 255 11111111 is 255. There are 256 values, but they start at 0.
- 200 + 100 200 + 100 = 300, which is over 255. 100 + 100 = 200 fits.
- 10 1 + 1 is 2, which is 10 in binary: write 0 and carry 1.
- 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
- Binary addition 1 + 1 = 0 carry 1 That is one of the four rules of binary addition.
- Hexadecimal Used for colour codes such as #FF8800 Two hex digits for each of red, green and blue.
- Hexadecimal Base 16 Hexadecimal is base 16.
- Hexadecimal One digit stands for four bits One hex digit replaces one nibble.
- Hexadecimal Uses the letters A to F for 10 to 15 Base 16 needs sixteen digits, so it borrows six letters.
- Binary shifts Empty places are filled with 0 A logical shift fills the vacated positions with zeros.
- 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.
- Binary addition Work from right to left, carrying into the next column Binary addition works like column addition in denary.
- Binary addition 1 + 1 + 1 = 1 carry 1 Three 1s in a column make 3, which is 11 in binary.
- Binary shifts Bits that fall off the end are lost That is why a right shift can lose a fraction.
- Binary shifts Moving left by 2 places multiplies by 4 A left shift of n places multiplies by 2 to the power n.
- Binary shifts Moving right by 1 place halves the value A right shift of n places divides by 2 to the power n.