Data Representation and Theory of Computation - Worksheets, Questions and Revision

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

Download PDFJump to mark scheme (page 6)
« Previous: Networking and the Internet
Revision Library
revisionlibrary.co.uk
A-Level · AQA

A2.9 Data Representation and Theory of Computation

AQA 7517 · Calculators not allowed · about 150 minutes
Total Marks
Name: _______________________________    Date: ____ / ____ / ______
Answer ALL questions. Show all your working.

Data representation and the theory of computation

Original questions written for Revision Library.

This worksheet covers three related strands of the AQA A-Level Computer Science specification. Questions 1 to 6 cover how computers represent numbers: unsigned binary and hexadecimal, two's complement for negative integers, fixed-point binary, and floating-point representation (normalisation, range and precision). Questions 7 to 9 cover how computers represent other kinds of data: characters (ASCII and Unicode), sound (sampling rate and bit depth) and bitmap images (resolution, colour depth and compression). Questions 10 and 11 cover Boolean algebra: the laws used to simplify logic expressions, and deriving a simplified expression directly from a truth table. Questions 12 to 14 cover finite state machines (FSMs) as a model of computation, including tracing, constructing and evaluating them.

1
Number systems are used throughout computer systems to represent data in different, equivalent forms.
(a)Convert the denary integer 187 to 8-bit unsigned binary, showing your method.(2)
(b)Convert the 8-bit unsigned binary number 01011110 to denary, showing your method.(2)
(c)Convert the 8-bit binary number from part (b), 01011110, to hexadecimal, showing your method (split into nibbles).(2)
(d)Convert the hexadecimal value A9 to an 8-bit binary number, and state its denary value.(2)
(Total for Question 1 is 8 marks)
2
A microcontroller stores values in an 8-bit unsigned binary register, so it can only hold values from 0 to 255.
(a)Add the two unsigned 8-bit binary numbers 01101011 and 00111001, showing your working column by column (including any carries), and give the 8-bit result.(3)
(b)State, with a reason, whether an overflow has occurred in part (a).(2)
(c)Add the two unsigned 8-bit binary numbers 11001101 and 01101011, showing your working, and state whether overflow occurs this time, explaining your reasoning.(3)
(Total for Question 2 is 8 marks)
3
An 8-bit register instead stores signed integers using two's complement.
(a)State the range of denary values that can be represented in 8-bit two's complement, and give the two's complement representation of -58, showing your method.(3)
(b)Convert the 8-bit two's complement number 11101010 to denary, showing your method.(2)
(c)Add the two 8-bit two's complement numbers from parts (a) and (b), 11000110 (-58) and 11101010 (-22), showing your binary working. State the 8-bit result, interpret it in denary, and state whether overflow has occurred, giving a reason.(5)
(Total for Question 3 is 10 marks)
4
An embedded sensor stores fractional readings using an 8-bit fixed-point binary format, with 4 bits for the integer part and 4 bits for the fractional part (format IIII.FFFF, unsigned).
(a)Convert the fixed-point binary number 0101.1100 to denary, showing your method.(2)
(b)Convert the denary value 9.375 to this 8-bit fixed-point binary format (IIII.FFFF), showing your method for both the integer and fractional parts.(3)
(c)State the largest positive denary value that can be represented in this 8-bit format, showing your working. Then explain why increasing the number of fractional bits (keeping the total word length at 8 bits) would improve precision but reduce the range of values that can be represented.(3)
(Total for Question 4 is 8 marks)
5
A simplified floating-point format uses 12 bits in total: an 8-bit mantissa (1 sign bit followed by 7 fractional bits, with the binary point immediately after the sign bit) and a 4-bit exponent. Both the mantissa and exponent are stored in two's complement, and a floating-point value equals mantissa x 2exponent.
(a)State what is meant by a normalised floating-point mantissa, and state the condition for a positive mantissa to be normalised in this format.(2)
(b)A floating-point number in this format has mantissa 01010000 and exponent 0011. State whether the mantissa is normalised, explaining your answer, then calculate the denary value represented.(4)
(c)A different floating-point number has mantissa 00010000 and exponent 0101. State whether this mantissa is normalised. If it is not, normalise it (adjusting the exponent accordingly), and show that both the original and the normalised forms represent the same denary value.(4)
(Total for Question 5 is 10 marks)
6
Question 6 continues to use the 12-bit floating-point format from Question 5 (8-bit mantissa, 4-bit exponent, both two's complement, binary point after the sign bit).
(a)Calculate the maximum positive denary value that can be represented in this format, using a normalised mantissa, showing your working.(3)
(b)A systems designer proposes two changes to this 12-bit format, each keeping the total word length at 14 bits: (i) increasing the mantissa to 10 bits (exponent stays at 4 bits), or (ii) increasing the exponent to 6 bits (mantissa stays at 8 bits). Explain the effect of each change on the precision and the range of numbers that can be represented.(4)
(c)A student claims that floating-point representation can represent any real number exactly, given enough bits. Give one reason why this claim is incorrect.(2)
(Total for Question 6 is 9 marks)
7
A text file's character encoding is being reviewed for compatibility with different languages.
(a)State the number of bits used to represent one character in 7-bit ASCII, and calculate how many different characters can be represented in this scheme.(2)
(b)A student states that 7-bit ASCII cannot represent the character e with a circumflex (as used in French), or emoji such as a smiley face. Explain why Unicode was developed to address this limitation, and state one advantage Unicode has over extended (8-bit) ASCII.(3)
(c)A document contains 3,200 characters. Calculate the file size, in bytes, needed to store this document using: (i) 7-bit ASCII, with each character stored in a full byte, and (ii) UTF-32 encoding, with each character stored using 32 bits.(3)
(Total for Question 7 is 8 marks)
8
A recording studio in Manchester is digitising an analogue sound recording.
(a)State what is meant by 'sampling rate' and 'bit depth' when digitising analogue sound.(2)
(b)A recording is sampled at 44,100 Hz with a bit depth of 16 bits, in stereo (2 channels), for a duration of 30 seconds. Calculate the uncompressed file size, in bytes, showing your working.(4)
(c)The engineer wants to increase the audio quality. Explain the effect of increasing the bit depth from 16 bits to 24 bits on (i) the audio quality and (ii) the file size, and state why increasing the sampling rate beyond twice the highest frequency present in the original sound (the Nyquist rate) does not further improve the audio quality that can be perceived.(4)
(Total for Question 8 is 10 marks)
9
A digital photograph is being prepared for a school website.
(a)State what is meant by 'resolution' and 'colour depth' for a bitmap image.(2)
(b)A bitmap image has a resolution of 1920 x 1080 pixels and a colour depth of 24 bits per pixel. Calculate the file size of this uncompressed image in bytes, and then in megabytes (using 1 MB = 1,048,576 bytes), showing your working.(4)
(c)The image is compressed using a lossy compression algorithm (such as JPEG), resulting in a file of 850 KB (using 1 KB = 1,024 bytes). Calculate the compression ratio achieved (uncompressed size : compressed size), giving your answer to 2 significant figures. State one disadvantage of using lossy compression, rather than lossless compression, for this image.(4)
(Total for Question 9 is 10 marks)
10
Boolean algebra laws can be used to simplify logic expressions before they are implemented as circuits, reducing the number of gates required.
(a)State the Boolean identity known as De Morgan's first law, and the identity known as De Morgan's second law (for two variables A and B, where ' denotes NOT).(2)
(b)Simplify the Boolean expression X = A.B + A.B' + A'.B, showing each Boolean algebra law you use at each step. Give your final simplified expression.(4)
(c)A different expression is Y = (A+B).(A+B'). Simplify this expression using Boolean algebra laws, showing your working. Confirm your answer by drawing a full truth table for both Y and your simplified expression, for all combinations of A and B.(4)
(Total for Question 10 is 10 marks)
11
A school's 3D-printer enclosure uses three independent temperature sensors, giving fault signals X, Y and Z (each equal to 1 if that sensor detects an over-temperature fault, 0 otherwise). To avoid a single faulty sensor triggering a false alarm, the enclosure's alarm output A uses majority voting: A = 1 only when at least two of the three sensors (X, Y, Z) report a fault.
(a)Complete the truth table for the alarm output A, for all 8 combinations of X, Y and Z.(3)
(b)Write the Boolean expression for A in sum-of-products (SOP) form, directly from the truth table (one AND term for each row where A=1, combined with OR).(3)
(c)Simplify this Boolean expression using Boolean algebra laws (or otherwise), showing your working, to show that A = X.Y + Y.Z + X.Z.(4)
(Total for Question 11 is 10 marks)
12
A leisure centre's turnstile is modelled as a finite state machine (FSM) with two states, LOCKED (the start state) and UNLOCKED, and two inputs, COIN (a coin is inserted) and PUSH (someone pushes the turnstile arm). From LOCKED: COIN leads to UNLOCKED; PUSH leaves it in LOCKED (nothing happens). From UNLOCKED: PUSH leads to LOCKED; COIN leaves it in UNLOCKED (a second coin has no further effect).
(a)Complete the state transition table for this FSM, showing the next state for each combination of current state and input.(4)
(b)Starting in the LOCKED state, trace the sequence of states visited for the input string: COIN, PUSH, PUSH, COIN, COIN, PUSH. State the final state reached.(3)
(c)Explain why this FSM is deterministic, in terms of the transitions defined in the transition table.(2)
(Total for Question 12 is 9 marks)
13
A vending machine's control logic is to be designed as a finite state machine (FSM) that accepts only input strings (sequences of button presses, each either A or B) ending in 'AB', i.e. whose last two symbols, in order, are A followed by B. For example, AB, BAB and AAB should be accepted, but A, B, BA and ABA should not.
(a)Draw a state transition diagram (or an equivalent transition table) for a deterministic finite state machine (DFA) with three states, S0, S1 and S2, that accepts exactly the strings ending in 'AB'. Label the start state, the accepting (final) state, and every transition.(6)
(b)Use your FSM from part (a) to trace the input string BABAB, stating whether it is accepted or rejected, and explaining your reasoning by reference to the states visited.(3)
(c)State one difference between a deterministic finite state machine (DFA) and a non-deterministic finite state machine (NFA), and explain why every NFA can always be converted into an equivalent DFA.(3)
(Total for Question 13 is 12 marks)
14
A software engineer is deciding whether to model a new lift (elevator) control system as a finite state machine. Discuss the benefits and limitations of using a finite state machine to model a real-world system such as this, and identify one feature of a real lift control system that a simple finite state machine (as used in Questions 12 and 13) might struggle to capture.
(Total for Question 14 is 6 marks)
Mark scheme · A2.9 Data Representation and Theory of Computation

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