Trace Tables and Binary/Hex Conversions - Worksheets, Questions and Revision

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

Download PDFJump to mark scheme (page 13)
« Previous: SQL and Data Handling
Revision Library
revisionlibrary.co.uk
GCSE · Data Representation and Algorithms

P2.9 Trace Tables and Binary/Hex Conversions

OCR J277 · Calculators not allowed · about 100 minutes
Total Marks
Name: _______________________________    Date: ____ / ____ / ______
Answer ALL questions. Show all your working.
1
Convert each of the following 8 bit binary numbers to denary.
(a)Convert 01011010 to denary. Show your working.(2)
(b)Convert 11000011 to denary. Show your working.(2)
(Total for Question 1 is 4 marks)
2
Convert each of the following denary numbers to an 8 bit binary number.
(a)Convert 122 to an 8 bit binary number. Show your working.(2)
(b)Convert 201 to an 8 bit binary number. Show your working.(2)
(Total for Question 2 is 4 marks)
3
Computers store all data using binary (only 0s and 1s) rather than denary.
(a)State two reasons why computers use binary to represent data, rather than denary.(2)
(Total for Question 3 is 2 marks)
4
Convert each of the following 8 bit binary numbers to a two digit hexadecimal number.
(a)Convert 10110101 to hexadecimal. Show your working.(2)
(b)Convert 01111110 to hexadecimal. Show your working.(2)
(Total for Question 4 is 4 marks)
5
Convert each of the following two digit hexadecimal numbers to an 8 bit binary number.
(a)Convert 3A to an 8 bit binary number. Show your working.(2)
(b)Convert F4 to an 8 bit binary number. Show your working.(2)
(Total for Question 5 is 4 marks)
6
Programmers often write memory addresses and colour codes in hexadecimal rather than binary.
(a)State two reasons why hexadecimal is often used instead of binary, and give one real-world example of where hexadecimal is used.(3)
(Total for Question 6 is 3 marks)
7
Convert between hexadecimal and denary as follows.
(a)Convert the hexadecimal number 2F to denary. Show your working.(2)
(b)Convert the denary number 200 to a two digit hexadecimal number. Show your working.(2)
(Total for Question 7 is 4 marks)
8
Add the following two 8 bit binary numbers together: 01010101 and 00101010.
(a)Calculate the 8 bit binary result of the addition, showing your carries. State whether an overflow occurs.(3)
(Total for Question 8 is 3 marks)
9
An 8 bit register is used to add the binary numbers 10110110 and 01010101.
(a)Calculate the 8 bit binary result stored in the register, showing your carries.(2)
(b)Explain why overflow has occurred and state what happens to the bit that cannot be stored.(2)
(Total for Question 9 is 4 marks)
10
The 8 bit binary number 00001101 is shifted left by 2 places.
(a)Calculate the 8 bit binary result of the shift.(2)
(b)State the denary value before and after the shift, and hence state the general effect of a left shift of n places on the value of a binary number.(2)
(Total for Question 10 is 4 marks)
11
The 8 bit binary number 11010000 is shifted right by 3 places.
(a)Calculate the 8 bit binary result of the shift.(2)
(b)State the denary value before and after the shift, and hence state the general effect of a right shift of n places on the value of a binary number.(2)
(Total for Question 11 is 4 marks)
12
An 8 bit register uses two's complement to represent signed integers.
(a)Convert the denary number -77 to an 8 bit two's complement binary number. Show your working.(3)
(Total for Question 12 is 3 marks)
13
An 8 bit two's complement register stores the value 11101001.
(a)Convert 11101001 to its denary value. Show your working.(3)
(Total for Question 13 is 3 marks)
14
Two 8 bit two's complement numbers, representing -23 and +40, are to be added together in a register.
(a)Calculate the 8 bit two's complement binary result of adding -23 and +40, showing your working.(3)
(b)Verify your answer by converting the binary result back to denary and comparing it to -23 + 40.(1)
(Total for Question 14 is 4 marks)
15
A simple character set assigns the letter 'A' the ASCII decimal code 65, with the remaining capital letters following on in alphabetical order.
(a)Calculate the ASCII decimal code for the capital letter 'M'.(2)
(b)The word 'REVISE' is stored using 8 bit ASCII, with one byte used per character. Calculate the total number of bits needed to store the word.(2)
(Total for Question 15 is 4 marks)
16
Some software needs to store characters from many different alphabets, including Mandarin and Arabic characters, as well as emoji.
(a)Explain why Unicode, rather than standard 7 bit ASCII, is used to represent these characters.(2)
(b)16 bit Unicode is used instead of standard 7 bit ASCII. Calculate how many more bits per character 16 bit Unicode uses compared to 7 bit ASCII.(2)
(Total for Question 16 is 4 marks)
17
The algorithm below uses OCR reference language pseudocode:
total <- 0
FOR count <- 1 TO 5
    total <- total + (count * 2)
NEXT count
OUTPUT total
(a)Complete the trace table below to show the value of total after each pass of the loop, and state the value that is output.
counttotal
(start)0
1
2
3
4
5
OUTPUT =
(6)
(Total for Question 17 is 6 marks)
18
The algorithm below uses OCR reference language pseudocode:
numbers <- [4, 9, 2, 7, 5]
largest <- numbers[0]
FOR index <- 1 TO 4
    IF numbers[index] > largest THEN
        largest <- numbers[index]
    ENDIF
NEXT index
OUTPUT largest
(a)Complete the trace table below to show the value of largest after each pass of the loop, and state the value that is output.
indexnumbers[index]largest
(start)-4
1
2
3
4
OUTPUT =
(6)
(Total for Question 18 is 6 marks)
19
The algorithm below uses OCR reference language pseudocode:
word <- "COMPUTER"
vowelCount <- 0
FOR position <- 1 TO LEN(word)
    letter <- MID(word, position, 1)
    IF letter = "A" OR letter = "E" OR letter = "I" OR letter = "O" OR letter = "U" THEN
        vowelCount <- vowelCount + 1
    ENDIF
NEXT position
OUTPUT vowelCount
(a)Complete the trace table below to show the value of letter and vowelCount at each position, and state the value that is output.
positionlettervowelCount
(start)-0
1
2
3
4
5
6
7
8
OUTPUT =
(8)
(Total for Question 19 is 8 marks)
20
The algorithm below uses OCR reference language pseudocode:
number <- 100
count <- 0
WHILE number > 1
    number <- number DIV 2
    count <- count + 1
ENDWHILE
OUTPUT count
(a)Complete the trace table below to show the values of number and count after each pass of the loop, and state the value that is output.
numbercount
100 (start)0
|
|
|
|
|
OUTPUT =
(7)
(Total for Question 20 is 7 marks)
21
The algorithm below uses OCR reference language pseudocode to convert a denary number to binary:
number <- 44
binaryDigits <- ""
WHILE number > 0
    remainder <- number MOD 2
    binaryDigits <- STR(remainder) + binaryDigits
    number <- number DIV 2
ENDWHILE
OUTPUT binaryDigits
(a)Complete the trace table below to show the values of remainder, binaryDigits and number after each pass of the loop, and state the string that is output. Then verify your answer by converting it back to denary.
remainderbinaryDigitsnumber
-""44 (start)
OUTPUT =
(9)
(Total for Question 21 is 9 marks)
22
Computers can represent negative integers using two's complement, or using a simpler sign-magnitude approach, where the leftmost bit only ever indicates whether the number is positive or negative and the rest of the bits store the size of the number.
(a)Explain why two's complement is used by computers to represent negative integers, rather than a sign-magnitude approach.(6)
(Total for Question 22 is 6 marks)
23
A control system for a school greenhouse's ventilation stores the number of degrees the vent has opened as an 8 bit unsigned binary number in a register. Each time the vent opens further, 15 is added to the stored value. After several additions, the true total exceeds 255, which is more than 8 bits can store.
(a)Explain what happens to the stored value when this overflow occurs, and state one consequence this could have for the greenhouse control system.(3)
(Total for Question 23 is 3 marks)
Mark scheme · P2.9 Trace Tables and Binary/Hex Conversions

Question 1

Question 2

Question 3

Question 4

Question 5

Question 6

Question 7

Question 8

Question 9

Question 10

Question 11

Question 12

Question 13

Question 14

Question 15

Question 16

Question 17

Question 18

Question 19

Question 20

Question 21

Question 22

Question 23