Skip to the worksheet
Revision Library
Choose a subject

Data Representation: Number Systems - Worksheets, Questions and Revision

15 original exam-style questions - 7 pages of questions with a full mark scheme - free printable PDF.

Grades 1-9

This topic is chapter 3 of GCSE Computer Science Topic Workbook 2 and chapter 13 of GCSE Computer Science 10-Minute Tests.

Revision Library
revisionlibrary.co.uk
GCSE · Data Representation

2.5 Data Representation: Number Systems

OCR J277 · Calculators not allowed · about 75 minutes
Total Marks
Name: _______________________________    Date: ____ / ____ / ______
Answer ALL questions. Show all your working.
1
Whole numbers can be converted between denary (base 10) and binary (base 2) using the binary place values 128, 64, 32, 16, 8, 4, 2 and 1.
(a)Convert the denary number 6 to a 4-bit binary number.(1)
(b)Convert the 4-bit binary number 1011 to denary.(1)
(c)Convert the denary number 250 to an 8-bit binary number. Show your working.(2)
(Total for Question 1 is 4 marks)
2
Hexadecimal (base 16) uses the digits 0-9 and the letters A-F, where A=10, B=11, C=12, D=13, E=14 and F=15.
(a)Convert the denary number 58 to hexadecimal. Show your working.(2)
(b)Convert the hexadecimal number 2F to denary. Show your working.(2)
(c)State the largest denary value that can be represented using a single hexadecimal digit.(1)
(Total for Question 2 is 5 marks)
3
Because 4 bits (a nibble) can represent exactly 16 different values (0-15), each hexadecimal digit maps directly onto one 4-bit nibble.
(a)Convert the 8-bit binary number 10110101 to hexadecimal by splitting it into nibbles. Show your working.(2)
(b)Convert the hexadecimal number E3 to an 8-bit binary number. Show your working.(2)
(Total for Question 3 is 4 marks)
4
Programmers often display memory addresses, error codes and colour values in hexadecimal rather than in binary or denary. Explain why programmers often use hexadecimal rather than binary or denary.
(Total for Question 4 is 3 marks)
5
Units of data storage are built up from the bit: 1 nibble = 4 bits, 1 byte = 8 bits, and larger units (kilobyte, megabyte, gigabyte) are each 1000 times the previous unit.
(a)Put these units in order of size, smallest first: byte, bit, kilobyte, nibble.(1)
(b)State the number of bits in one byte.(1)
(c)A downloaded document is 4 kilobytes (KB) in size. Using 1 KB = 1000 bytes, calculate the number of bits in the document. Show your working.(2)
(Total for Question 5 is 4 marks)
6
Show that the 8-bit binary number 11001001 represents the denary value 201.
(Total for Question 6 is 2 marks)
7
A colour in a graphics program is stored as the hexadecimal code #2F8C00, giving the Red, Green and Blue (RGB) intensities as three pairs of hex digits.
(a)Calculate the denary value of the Green component, given by the hex pair 8C. Show your working.(2)
(b)Give one everyday example, other than colour codes, where hexadecimal is used to represent data.(1)
(Total for Question 7 is 3 marks)
8
The table below shows the same three numbers written in denary, 8-bit binary and hexadecimal. Some values are missing.
DenaryBinary (8-bit)Hexadecimal
100??
?01011001?
??7D
Complete the table by filling in every missing value. Show your working for at least one conversion in each row.
(Total for Question 8 is 6 marks)
9
The number of different values that can be represented using a fixed number of bits, n, can be calculated using a simple formula.
(a)State, in the form 2n, the formula for the number of different values that can be represented using n bits.(1)
(b)Calculate the number of different values that can be represented using 5 bits. Show your working.(2)
(c)A games console stores each player's score as an unsigned 16-bit binary number. Calculate the maximum denary score that can be stored. Show your working.(2)
(Total for Question 9 is 5 marks)
10
A processor uses 8-bit registers to store unsigned binary numbers, so the largest value it can hold is 255.
(a)Add the binary numbers 11110101 (denary 245) and 00010000 (denary 16). Show your carries and give your answer as a 9-bit binary number.(2)
(b)State the 8-bit value that would actually be stored in the register, and explain why this is described as an overflow error.(2)
(Total for Question 10 is 4 marks)
11
A network technician reads the hexadecimal pair B4 from part of a device's MAC address and needs to check it against a filter rule written in binary.
(a)Convert the hexadecimal value B4 to an 8-bit binary number. Show your working.(2)
(b)Convert your answer to part (a) to denary. Show your working.(2)
(Total for Question 11 is 4 marks)
12
A digital camera stores the colour of each pixel using 24 bits, made up of 8 bits each for the red, green and blue components.
(a)Calculate the total number of different colours that can be represented using 24 bits. Give your answer both in the form 2n and as a denary value. Show your working.(2)
(b)Explain why increasing the number of bits used to store each pixel's colour increases the overall file size of an image.(2)
(Total for Question 12 is 4 marks)
13
A programmer wants to write an algorithm, using the OCR Exam Reference Language, that inputs two positive integers, num1 and num2, calculates their total, and outputs whether adding these two numbers together would cause an overflow if the result were stored in an 8-bit register (i.e. whether the total is greater than 255). Write this algorithm. Any correct logic will be credited; minor syntax errors will be ignored.
(Total for Question 13 is 4 marks)
14
Discuss the benefits of using hexadecimal, rather than binary or denary, when programmers need to work with large binary values such as memory addresses, error codes or colour values. In your answer, you should refer to the readability of the numbers, the length of the numbers, and how easily hexadecimal can be converted to and from binary.
(Total for Question 14 is 6 marks)
15
A microcontroller stores unsigned integers using 8-bit registers.
(a)A register holds the binary value 10101100. Convert this value to hexadecimal. Show your working.(2)
(b)The values 10101100 and 01100101 are added together in the register. Perform the binary addition, showing your carries, and state whether an overflow occurs, giving a reason.(3)
(c)State the 8-bit binary value that would actually be stored in the register once the overflow has occurred, and give this value in denary.(2)
(Total for Question 15 is 7 marks)
Mark scheme · 2.5 Data Representation: Number Systems

Question 1

  • (a) 0110 caoB1
  • (a) Answer: 0110
  • (b) 11 caoB1
  • (b) Answer: 11
  • (c) correct place values identified, e.g. 128+64+32+16+8+2 = 250M1
  • (c) 11111010 caoA1
  • (c) Answer: 11111010

Question 2

  • (a) 58 divided by 16 to give 3 remainder 10 (i.e. 3 and A) shownM1
  • (a) 3A caoA1
  • (a) Answer: 3A
  • (b) 2x16 and F(=15)x1 identifiedM1
  • (b) 47 caoA1
  • (b) Answer: 47
  • (c) 15 (F) caoB1
  • (c) Answer: 15

Question 3

  • (a) binary correctly split into nibbles 1011 and 0101M1
  • (a) B5 caoA1
  • (a) Answer: B5
  • (b) E = 1110 and 3 = 0011 identifiedM1
  • (b) 11100011 caoA1
  • (b) Answer: 11100011

Question 4

  • hexadecimal numbers are much shorter/more compact than the equivalent binary number oeB1
  • long strings of binary digits are difficult for people to read/write accurately, so hexadecimal reduces the chance of transcription errors oeB1
  • each hexadecimal digit maps directly onto a 4-bit nibble, so converting between binary and hexadecimal is quick and does not need a calculator oeB1
  • Answer: Hexadecimal is much shorter than binary for the same value, so it is quicker and less error-prone for people to read and write. It also converts to and from binary very quickly, because each hex digit represents exactly one 4-bit nibble.

Question 5

  • (a) bit, nibble, byte, kilobyte cao (all four correct, in this order)B1
  • (a) Answer: bit, nibble, byte, kilobyte
  • (b) 8 caoB1
  • (b) Answer: 8
  • (c) 4 x 1000 x 8 shown, or equivalent staged workingM1
  • (c) 32000 caoA1
  • (c) Answer: 32000 bits

Question 6

  • correct place values identified: 128, 64, 8 and 1M1
  • 128+64+8+1 = 201 shown csoA1
  • Answer: 201 (given, cso)

Question 7

  • (a) 8x16 and C(=12)x1 identifiedM1
  • (a) 140 caoA1
  • (a) Answer: 140
  • (b) any valid example, e.g. MAC addresses, error/exception codes, memory addresses, or web page/URL character encoding oeB1
  • (b) Answer: MAC addresses (or memory addresses, or error codes)

Question 8

  • row 1 binary: 01100100 caoB1
  • row 1 hexadecimal: 64 cao (ft from their binary if consistent)B1
  • row 2 denary: 89 caoB1
  • row 2 hexadecimal: 59 cao (ft from the given binary)B1
  • row 3 denary: 125 caoB1
  • row 3 binary: 01111101 cao (ft from their denary if consistent)B1
  • Answer: Row 1: 100 = 01100100 = 64 (hex); Row 2: 01011001 = 89 = 59 (hex); Row 3: 125 = 01111101 = 7D (hex)

Question 9

  • (a) 2n caoB1
  • (a) Answer: 2n
  • (b) 25 shown, or doubling shown (2,4,8,16,32)M1
  • (b) 32 caoA1
  • (b) Answer: 32
  • (c) 216 identified or calculated as 65536M1
  • (c) 65535 caoA1
  • (c) Answer: 65535

Question 10

  • (a) correct column addition attempted with carries shown/propagated correctlyM1
  • (a) 100000101 caoA1
  • (a) Answer: 100000101
  • (b) 00000101 (5) stated as the stored 8-bit value, ft from their 9-bit answer to (a)B1
  • (b) the true result (261) is greater than the maximum value (255) that an 8-bit register can hold, so the extra (9th) bit is lost/discarded and the stored value is incorrect oeB1
  • (b) Answer: 00000101 (denary 5) would be stored; this is an overflow error because the true result, 261, is too large to fit in 8 bits (max 255), so the leading bit is lost and the stored value is wrong.

Question 11

  • (a) B = 1011 and 4 = 0100 identifiedM1
  • (a) 10110100 caoA1
  • (a) Answer: 10110100
  • (b) correct place values identified, e.g. 128+32+16+4M1
  • (b) 180 cao (ft from their answer to (a))A1
  • (b) Answer: 180

Question 12

  • (a) 224 identifiedM1
  • (a) 16777216 caoA1
  • (a) Answer: 224 = 16777216 colours
  • (b) more bits are needed to store the colour of each individual pixel oeB1
  • (b) since the total file size is (bits per pixel x number of pixels), increasing the bits per pixel increases the total number of bits needed for the whole image oeB1
  • (b) Answer: Each pixel needs more bits to store its colour, and since total file size = bits per pixel x number of pixels, increasing the bits per pixel increases the total size of the file.

Question 13

  • inputs num1 and num2 and converts them to integers, e.g. using input() and int() oeB1
  • calculates the total, e.g. total = num1 + num2 oeB1
  • uses selection to compare total against 255, e.g. if total > 255 then ... else ... endif oeB1
  • outputs an appropriate message for both the overflow branch and the no-overflow branch oeB1
  • Answer:num1 = input("Enter the first number: ")
    num2 = input("Enter the second number: ")
    num1 = int(num1)
    num2 = int(num2)
    total = num1 + num2
    if total > 255 then
        print("Overflow: the result cannot be stored in an 8-bit register")
    else
        print("No overflow. Result = " + str(total))
    endif

Question 14

  • Level 1 Basic, isolated point(s) with little or no development, e.g. a simple unsupported statement that hexadecimal is shorter than binary. Answer may be a simple, undeveloped list.1-2
  • Level 2 A reasonable discussion covering at least two relevant points (e.g. length, readability, conversion), with some development but limited linkage between ideas or minor inaccuracies.3-4
  • Level 3 A detailed, coherent discussion covering multiple relevant points, clearly linked to why they matter for programmers (e.g. reduced transcription errors, quick conversion via nibbles), with logically structured reasoning throughout.5-6
  • Indicative content:
    • Hexadecimal numbers are much shorter/more compact than the equivalent binary number (e.g. an 8-bit binary number needs only 2 hex digits), making them quicker to read and write.
    • Long strings of binary digits are difficult for humans to read accurately and are more likely to lead to transcription/typing errors; hexadecimal reduces this risk.
    • Each hexadecimal digit corresponds exactly to a 4-bit nibble, so conversion between binary and hexadecimal is quick and does not require a calculator or long division.
    • Hexadecimal is still closely related to the underlying binary representation (unlike denary), so it remains meaningful to programmers working with bit patterns, memory addresses and colour codes.
    • Converting between denary and binary requires more complex division/remainder calculations and is less directly linked to the bit pattern actually stored by the computer.
    • A balanced answer might note that hexadecimal is still less immediately meaningful to non-programmers than denary, so it is a trade-off between compactness/accuracy for programmers and general readability.

Question 15

  • (a) binary split into nibbles 1010 and 1100M1
  • (a) AC caoA1
  • (a) Answer: AC
  • (b) correct column addition attempted with carries shown/propagated correctlyM1
  • (b) 100010001 cao (9-bit result)A1
  • (b) overflow occurs, because a carry is generated out of the most significant (8th) bit / because the true total, 273, is greater than the maximum 8-bit value of 255 oeB1
  • (b) Answer: 100010001; overflow occurs because the true sum, 273, is greater than 255, so a carry is generated out of the register's most significant bit
  • (c) 00010001 stated (ft from their 9-bit answer to (b), dropping the leading bit)B1
  • (c) 17 cao (ft from their binary answer)B1
  • (c) Answer: 00010001 = 17

Mark your answers

Check answers without an account. Some answers can be checked automatically; use the mark scheme to mark the rest.

Question 1

4 marks
Did your answer earn the marks?

Question 2

5 marks
Did your answer earn the marks?

Question 3

4 marks
Did your answer earn the marks?

Question 4

3 marks
Did your answer earn the marks?

Question 5

4 marks
Did your answer earn the marks?

Question 6

2 marks

Question 7

3 marks
Did your answer earn the marks?

Question 8

6 marks
Did your answer earn the marks?

Question 9

5 marks
Did your answer earn the marks?

Question 10

4 marks
Did your answer earn the marks?

Question 11

4 marks
Did your answer earn the marks?

Question 12

4 marks
Did your answer earn the marks?

Question 13

4 marks
Did your answer earn the marks?

Question 14

6 marks
Did your answer earn the marks?

Question 15

7 marks
Did your answer earn the marks?
Mark my answers

Worksheets are written for Revision Library and come with a full mark scheme; a few English packs quote an out-of-copyright text, and name it on the page. Exam board names and specification codes say which qualification a pack suits: we are not affiliated with, endorsed by or approved by any exam board, and no past-paper question is reproduced here. Rights queries: hello@revisionlibrary.co.uk