Unit 1, 2016 QP
Unit 1, 2016 QP
COMPUTING
Unit 1 Problem Solving, Programming, Data Representation and
Practical Exercise
Instructions
l Type the information required on the front of your Electronic Answer Document.
l Enter your answers into the Electronic Answer Document.
l Answer all questions.
l You will need access to:
– a computer
– a printer
– appropriate software
– an electronic version of the Skeleton Program
– a hard copy of the Preliminary Material.
l Before the start of the examination make sure your Centre Number, Candidate Name and
Candidate Number are shown clearly in the footer of every page of your Electronic Answer
Document (not the front cover).
Information
l The marks for questions are shown in brackets.
l The maximum mark for this paper is 100.
l No extra time is allowed for printing and collating.
l The question paper is divided into four sections.
l You are advised to spend time on each section as follows:
Section A – 35 minutes
Section B – 15 minutes
Section C – 15 minutes
Section D – 55 minutes.
Warning
l It may not be possible to issue a result for this unit if your details are not on every page of the
Electronic Answer Document.
HB/210694/Jun16/E4 COMP1
2
Section A
Figure 1
1 0 1 1 0 1 0 0
0 1 What is the denary equivalent of the contents of this memory location if it represents
an unsigned binary integer?
Use the space below for rough working, then copy the answer to your Electronic
Answer Document.
[1 mark]
0 2 What is the denary equivalent of the contents of this memory location if it represents
an unsigned binary fixed point number, with 3 bits before and 5 bits after the binary
point?
Use the space below for rough working, then copy the answer to your Electronic
Answer Document.
[2 marks]
0 3 Why are bit patterns often displayed using hexadecimal instead of binary?
[1 mark]
HBJun16/COMP1
3
0 4 What is the hexadecimal equivalent of the contents of the memory location shown in
Figure 1?
Use the space below for rough working, then copy the answer to your Electronic
Answer Document.
[2 marks]
0 5 What is the denary equivalent of the contents of this memory location if it represents a
two’s complement binary integer?
Use the space below for rough working, then copy the answer to your Electronic
Answer Document.
[2 marks]
The ASCII system uses 7 bits to represent a character. The ASCII code in denary
for the numeric character '0' is 48; other numeric characters follow on from this in
sequence.
0 6 What character is being represented by the contents of the memory location shown in
Figure 1 if it represents a 7-bit ASCII code with the most significant bit being used as
an even parity bit?
[1 mark]
0 7 State two advantages of using Hamming code instead of a single parity bit.
[2 marks]
0 8 If the memory location contains a bit pattern that is being transmitted using Hamming
code, how many of the bits shown in Figure 1 have been used as parity bits?
[1 mark]
Turn over U
HBJun16/COMP1
4
Question 2 Images are often represented in a computer’s memory using bitmapped graphics.
1 0 How many colours can a bitmapped graphic image with a colour depth of 4 bits
contain?
[1 mark]
Use the space below for rough working then copy the answer, and your working,
to your Electronic Answer Document. You may get some marks for your working
even if your answer is incorrect if you include the working in your Electronic Answer
Document.
[3 marks]
HBJun16/COMP1
5
Turn over U
HBJun16/COMP1
6
Question 3 Figure 2 shows the state transition diagram of a finite state machine (FSM) used to
control a vending machine.
The vending machine dispenses a drink when a customer has inserted exactly
50 pence. A transaction is cancelled and coins returned to the customer if more than
50 pence is inserted or the reject button (R) is pressed. The vending machine accepts
10, 20 and 50 pence coins. Only one type of drink is available.
Figure 2
R, 20, 50
10
R,
50
R,
50
20
50
R,
Copy the contents of all unshaded cells in Table 1 into the Electronic Answer
Document.
Table 1
[2 marks]
HBJun16/COMP1
7
1 4 The vending machine is to be adapted so that it also accepts 5p coins. What is the
minimum number of states that will need to be added to the FSM shown in Figure 2
so that 5p coins are also accepted?
[1 mark]
Figure 3 shows three samples stored in a computer’s memory that have been taken
from an analogue signal as part of the recording process. The highest frequency in
the original speech is 800Hz (Hertz).
Figure 3
1 6 What is the minimum sampling rate (in Hz) that should be used to ensure that there is
no noticeable loss in quality when the original analogue signal has been represented
in digital form?
[1 mark]
1 7 If the original analogue signal lasts 20 seconds, how many bytes of storage will be
required to store all the samples taken in the recording process with no noticeable loss
in quality?
Use the space below for rough working then copy the answer, and your working,
to your Electronic Answer Document. You may get some marks for your working
even if your answer is incorrect if you include the working in your Electronic Answer
Document.
[3 marks]
1 8 Define what an analogue signal is and explain how it differs from a digital signal.
[3 marks]
Turn over U
HBJun16/COMP1
8
Section B
The question in this section asks you to write program code starting from a new
program/project/file.
The algorithm, represented using pseudo-code in Figure 4, and the variable table,
Table 2, describe a program that outputs an estimate for a particular calculation.
Figure 4
Table 2
HBJun16/COMP1
9
Test the program by conducting the tests Test 1 and Test 2, below.
Test 1
Test that your program works correctly by entering the number 0.1
Test 2
Test that your program works correctly by entering the number 4.1
Turn over U
HBJun16/COMP1
10
Section C
These questions refer to the Preliminary Material and require you to load the Skeleton Program,
but do not require any additional programming.
Refer either to the Preliminary Material issued with this question paper or your electronic copy.
HBJun16/COMP1
11
You should assume that all the statements after the End If in Figure 5 (which are
represented by '...') are correct.
Figure 5
3 2 Describe the errors that have been made in the pseudo-code shown in Figure 5.
[4 marks]
Explain why the CheckIfMoveIsValid subroutine would not always work correctly
after this change, even if the Board array had been correctly modified so that a board
size of 10x10 could be represented.
[2 marks]
Turn over U
HBJun16/COMP1
12
Section D
These questions require you to load the Skeleton Program and make programming changes to it.
HBJun16/COMP1
13
The game is to be adapted so that a player is only allowed to make a move if the
square they have chosen is within the boundaries of the board.
Adapt the Skeleton Program so that the new definition of a valid move is implemented.
You should pass an additional parameter to the CheckIfMoveIsValid subroutine
indicating the size of the board.
3 8 SCREEN CAPTURE(S) showing the requested test. You must make sure
that evidence for all parts of the requested test is provided in the SCREEN
CAPTURE(S).
[2 marks]
Turn over U
HBJun16/COMP1
14
Question 9 This question will further extend the functionality of the Skeleton Program and refers
to the SetUpGameBoard subroutine.
When a new game is started the human player is to be offered a choice of two
different start configurations. In the first, the four pieces on the board will be placed in
the middle as is currently the case. In the second, the pieces will be placed in the four
corner squares of the board.
When the four corner squares option is chosen the human player will start with pieces
in the top-left and bottom-right corner squares, and the computer will start with pieces
in the top-right and bottom-left corner squares.
Figure 6 shows what the board looks like at the start of a new game if the human
player chooses the four corner squares option on a 9x9 size board.
Figure 6
H C
C H
Figure 7 shows what the board looks like at the start of a new game if the human
player chooses the four corner squares option on a 4x4 size board.
Figure 7
H C
C H
Adapt the SetUpGameBoard subroutine so that the human player is asked which
of the two starting configurations they wish to choose (pieces in middle or pieces in
corner).
If the four centre squares initial setup is chosen then the game should start with the
four pieces in the middle of the board, as is currently the case.
HBJun16/COMP1
15
If the four corner squares initial setup is chosen then the game should start with
the board displayed as shown in Figure 6 and Figure 7. To get full marks for this
question your program code will need to work correctly for any allowed board size.
After writing your program code you will need to carry out the following tests.
Test 1
Test that the changes you have made work:
Test 2
Test that the changes you have made work:
Test 3
Test that the changes you have made work:
Turn over U
HBJun16/COMP1
16
Question 10 This question will further extend the functionality of the Skeleton Program.
The game is to be adapted so that before the human player is asked to enter their
move, the message Choosing one of the following squares will
mean you flip some pieces: is displayed. After this message, the program
should display a list of all of the squares that the player could choose that would result in
some of the computer’s pieces being flipped.
Task 1
Create a subroutine called GetFlipSquares which takes two parameters (the board
and the board size) and displays a list of all the squares where the human player could
place a piece that would result in some of the computer’s pieces being flipped.
You might find it easier to answer this question if you make subroutine calls to the
CheckIfThereArePiecesToFlip subroutine from within your new subroutine
GetFlipSquares.
You are likely to get some marks for this task even if your subroutine is only partially
working.
Task 2
Adapt the PlayGame subroutine so that there is a call to the subroutine
GetFlipSquares. This call should be after the board is displayed and before the
player is asked to enter their move. This call should happen every time it is the human
player’s move but not when it is the computer’s move.
Task 3
Test that your program works by conducting the following test:
END OF QUESTIONS
Copyright information
For confidentiality purposes, from the November 2015 examination series, acknowledgements of third party copyright material will be published in a separate
booklet rather than including them on the examination paper or support materials. This booklet is published after each examination series and is available for
free download from www.aqa.org.uk after the live examination series.
Permission to reproduce all copyright material has been applied for. In some cases, efforts to contact copyright-holders may have been unsuccessful and
AQA will be happy to rectify any omissions of acknowledgements. If you have any queries please contact the Copyright Team, AQA, Stag Hill House,
Guildford, GU2 7XJ.
HBJun16/COMP1