100% found this document useful (1 vote)
948 views8 pages

Chapter 1 Answers

The document provides information about representing numbers in different numeral systems such as denary, binary, and hexadecimal. It includes examples of converting between these numeral systems, as well as discussing concepts like binary addition and data compression techniques. Worked problems are provided as examples to demonstrate various conversion methods and techniques.

Uploaded by

John Holt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
948 views8 pages

Chapter 1 Answers

The document provides information about representing numbers in different numeral systems such as denary, binary, and hexadecimal. It includes examples of converting between these numeral systems, as well as discussing concepts like binary addition and data compression techniques. Worked problems are provided as examples to demonstrate various conversion methods and techniques.

Uploaded by

John Holt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Chapter 1: Information representation:

Answers to coursebook questions and


tasks and to Worksheet questions
Syllabus sections covered: 1.1, 1.2 and 1.3

From the coursebook


Task 1.01
Denary 96 becomes hexadecimal 60
Denary 215 becomes hexadecimal D7
Denary 374 becomes hexadecimal 176
The following table shows the binary equivalent followed by the hexadecimal for the three denary values.
256 128 64 32 16 8 4 2 1

0 0 1 1 0 0 0 0 0
For 96
6 0

1 1 0 1 0 1 1 1
For 215
D 7

1 0 1 1 1 0 1 1 0
For 374
1 7 6

For 96, learners might recognise that 96 is 6 × 16 and so the conversion to the hexadecimal 60 can be done
immediately.
The slow but steady route can be illustrated for the conversion of 374. The initial conversion to binary uses
successive division by two, noting the remainder each time and then reversing the remainders.
The remainders are 0 1 1 0 1 1 1 0 1, which in reverse give the binary as 101110110. For conversion to
hexadecimal, groupings of four bits are converted starting at the least significant (RH) end. 0110 converts to 6 and
0111 to 7, so the hexadecimal representation is 176.
More confident learners might use a short cut. Noting that 374 is greater than 162, a three-digit hexadecimal
representation is expected. Calculating 374 – 256 leaves 118. This can be seen to consist of seven lots of 16s with
6 remaining, hence 176.
Hexadecimal B4 becomes denary 180
Hexadecimal FF becomes denary 255
Hexadecimal 3A2C becomes denary 14 892

© Cambridge University Press 2019


The conversion of B4 and FF by first converting each hexadecimal digit to a corresponding four-bit binary
representation is illustrated in the following table.

128 64 32 16 8 4 2 1

For B4 B 4
1 0 1 1 0 1 0 0

For FF F F
1 1 1 1 1 1 1 1

For B4, the binary then converts to 128 + 32 + 16 + 4


For FF, the binary then converts to 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1
For FF, learners might remember that the maximum value that can be stored in eight bits is 255, so the working
out is not needed.
The same approach could be used for converting 3A2C; an alternative is to use the equivalent of the method
illustrated in Worked Example 1.01. The calculation proceeds from left to right as follows:
3 × 16 = 48 then + 10 = 58 then × 16 = 928 then + 2 = 930 then × 16 = 14 880 then + 12 = 14 892.
It is unlikely that learners will need to convert to denary for more than two hexadecimal digits.

Question 1.01
Internally never: hexadecimal numbers are primarily used for representation of binary codes for a person to read.
A computer can, therefore, create hexadecimal representations for output. Alternatively, they could possibly be
used for input provided that they were to be converted immediately to binary.

Task 1.02
Table 1.08 in the coursebook shows the binary value for –7 to be 1001. (You may wish to note that there could
have been any number of leading bits set to 1 without the conversion being affected other than to produce
leading zeros in the final answer.) Using the method of retaining the least significant bit and switching the others
gives 0111, which is +7.

Task 1.03
1011 = –23 + 21 + 20 = –8 + 2 + 1 = –5
111011 = –25 + 24 + 23 + 21 + 20 = –32 + 16 + 8 + 2 + 1 = –5

Task 1.04
The method is to take the two’s complement of the binary value for 35 and to add this to the binary value for 67.
The binary equivalent of denary 35 is 00100011, and conversion to two’s complement gives 11011101. Binary for
67 is 01000011. Addition gives (1)00100000. Learners should note that there is a carry bit that cannot be stored in
the byte, but this does not matter because the result in the byte is the binary code for denary 32, which is the
correct answer.

© Cambridge University Press 2019


Question 1.02
Six bits only allows 64 codes. Including both upper case and lower case letters would use up 52 of these. Thus,
only upper case letters were coded.

Task 1.05
Suitable examples would be:
Circle: centre coordinates, radius, outline colour, outline style, fill colour.
Rectangle: coordinates of the bottom left corner, coordinates of bottom right corner, length, outline colour,
outline style, fill colour.

Extension Question 1.01


For each of the example formats list whether the compression is lossless or lossy.

Exam-style Questions
1 a i 38 195 from 215 + 212, and so on. (1 + 1)
ii 9533 from four-bit groupings. (1 + 1)
b Any example involving presentation of a hexadecimal representation of a binary code to make it easier for
someone to read. (1)
c i 10010101 because the most significant LHS bit is 1. (1)
ii –107 from –27 + 24 and so on, and 51 from 25 + 24 and so on. (1 + 1)
d Only one representation of zero. Allows simple computation for addition and subtraction. (1 + 1)
e Some possible answers are given below. (1 each, max 3)
 BCD values: either two per byte or just one per byte using just four bits.
 Two ASCII characters: either using seven bits from each byte or using the full byte including a parity bit.
 One Unicode character: using the two bytes.
 Bitmap code with any variation: from 16 single-bit pixels for black and white, through two pixels with
each byte representing one of 256 colour codes, to the two bytes representing a colour depth of 16.
 Values for sampled sound: sensibly using four bits, one byte or two bytes to represent one sampled value.
 A machine code instruction using the two bytes.
 A memory address using both bytes.
 A floating-point representation (not covered in coursebook).

© Cambridge University Press 2019


2 a i There are many possible answers such as drawing list, individual objects, properties, attributes,
geometric data or by example. (1 each, max 2)
ii ‘Uses a matrix of pixels’ is a sufficient answer but learners may also state that a pixel has a colour and
a position. (1 for pixel + 1 added comment)
iii Vector graphic. This should be justified by saying there is a re-calculation for the magnified image; one
justification would be that a bitmap becomes pixelated on magnification or that a vector graphic does
not. (1 for vector graphic + 1 for reason)
b i 640 × 480 = 307 200 pixels; each pixel has 16 bits which is two bytes. The best continuation is to divide
2 × 307 200 by 1024 to get 600 KiB. An alternative correct calculation is to divide by 1000 to get
614.4 kB. (1 for value + 1 for units)
ii A bitmap file has a header metadata that defines the colour depth and the dimensions of the image
matrix. (1)
c i Run-length encoding, which replaces a consecutive series of identical codes by one code value plus a
value for the number of repetitions. (1 for approach + 1 for explanation)
ii One possibility is to reduce the colour depth by changing each pixel code to an approximation stored
with fewer bits. An alternative is to identify regions of the image where colour changes are small and
to use just one code for all pixels in that region so that run-time encoding can then be applied. (1 for
approach + 1 for explanation)
3 a i Sound is transmitted as a continuous waveform and is, therefore, an analogue phenomenon. Current
best practice is to store a representation of the sound in digital form. The ADC is used to convert the
analogue signal to a digital representation. (1 for analogue sound + 1 for digital storage)
ii The sampling rate is simply the number of samples of the sound intensity taken per unit time (1). The
rate chosen should be in accordance with Nyquist’s theorem (1). The sound intensity is measured
when a sample is taken. The value obtained has to be stored as a digital value (1). The number of bits
used for this defines the sampling resolution (1). If more bits are used the values that can be stored
are more closely spaced, so the approximation to the actual intensity value is more accurate (1).
b i A band-limiting filter. (1)
ii To remove higher frequency components that the human ear would not be able to hear (1) and that
would have such a high frequency that Nyquist’s theorem would not be satisfied with any sensible
sampling rate used. (1)
4 This is Question 1 in 9608 Paper 13 June 2015. At the time of writing the published mark scheme is available
on the Cambridge International School Support Hub (requires registration). The Examiners Report for the June
2015 series is also available there and this may contain comments specific to this question.
The following are what the author of this chapter in the Teacher Resource would suggest as reasonable
answers, with alternatives suggested where appropriate. Where a suggested answer includes bullet points,
each bullet point would be worth one mark up to the maximum mark allocation for the question.
a i 124 is represented by 01111100 in two’s complement binary and -77 is represented by 10110011 in
two’s complement binary.
a ii 124 is represented by 7C in hexadecimal and -77 is represented by B3 in hexadecimal.
b i 359 is represented by 0011 0101 1001 in BCD.
ii A description is required, examples of what could be included are:
 used as a code when a denary digit is to be displayed
 in a digital clock or watch display

© Cambridge University Press 2019


 in a calculator display
 accurate representation of denary numbers containing decimal fractions
 for currency values.
Cambridge International AS & A Level Computer Science 9608 paper 13 Q1 June 2015
5 This is Question 4 in 9608 Paper 12 November 2015. At the time of writing the published mark scheme is
available on the Cambridge International School Support Hub (requires registration). The Examiners Report
for the June 2015 series is also available there and this may contain comments specific to this question.
The following are what the author of this chapter in the Teacher Resource would suggest as reasonable
answers, with alternatives suggested where appropriate. Where a suggested answer includes bullet points,
each bullet point would be worth one mark up to the maximum mark allocation for the question.
a  The explanation is best started with the definition of sampling resolution being the number of bits
used to store the sampled sound value. An alternative is to state that the sampling resolution defines
the number of values that are available for choosing the one that is closest to the measured analogue
value.
 The sampling process involves quantisation because only a limited number of digital values are
available for matching the measured analogue value.
 More bits means a higher sampling resolution and therefore a better match between the digital value
chosen and the analogue value measured.
 This leads to a more accurate representation of the sound.
 The definition of sampling rate is the number of samples taken per second.
 Increasing the sampling rate improves the accuracy of the representation of the sound.
44100  16  2
b i  176400
8
4  60  176400
ii
1024  1024

c  The fundamental fact is that the human ear is an imperfect hearing device.
 Therefore, lossless compression is not essential; lossy compression can be used.
 The MP3 format can make use of the following facts:
 some sounds cannot be heard by the human ear
 some sounds are less well heard than others
 a softer sound in the presence of a louder sound will not be heard well.
Cambridge International AS & A Level Computer Science 9608 paper 12 Q4 November 2015

© Cambridge University Press 2019


Worksheet 1.1: for testing basic understanding
1 C and E
2 C
Note that 145 could be the representation for an unsigned integer, 91 could be the representation for two BCD
digits (packed), and –111 could be the representation for a two’s complement integer.
3 a 27 26 25 24 23 22 21 20
128s 64s 32s 16s 8s 4s 2s 1s
1 0 1 0 0 1 1 0
b Even. The total denary equivalent is obtained by adding together the denary equivalent for each bit
position. The value of each bit, either 0 or 1, shows whether the denary equivalent (2 raised to a power) is
included in the number. The least significant bit represents 2 raised to the power 0. All even numbers,
therefore, have a 0 as the least significant bit; all odd numbers have a 1.
c 128 + 32 + 4 + 2 = 166
d Negative because it starts with a 1 for the most significant bit.
e –128 + 32 +4 + 2 = –90
4 Nine, because 373 is greater than 255 but less than 511. Eight bits can store the 28 different values 0–255.
Nine bits can store 0–511.
5 a 60 to reach 00000 then a further 230 gives 60 + 230 = 290 in total.
b You just get a negative number as an answer.
c 99 940 converts to 00 059 in nine’s complement then converts to 00 060 in ten’s complement. We then
get the same addition as when using common sense: 00 060 + 00 230 = 00 290.
6 Bitmap size is the number of pixels multiplied by the number of bits used to represent one pixel (the colour
depth). Size is normally specified in bytes not bits, so the calculation for the size in bytes is 1024 × 768 × 1
= 786 432.
Sound file size is length of time multiplied by the sampling rate multiplied by the number of bits used to store
one sample (the sampling resolution). So, the calculation for the number of bytes is 5 × 60 × 100 × 2 = 60 000.
The bitmap file is the larger of the two.
7 Lossy compression is useful for media files such as sound, bitmap image or video. This is because the user
might be happy with a slightly inferior quality. Sometimes, the human senses cannot detect the difference in
quality. In other cases, the benefits of a smaller file size outweigh the disadvantages of the loss in quality.
Lossless compression is essential for a document containing text. It is essential that the content and the
information conveyed are unaltered.

© Cambridge University Press 2019


Worksheet 1.2: more challenging questions
1 a 1 0 0 1 0 1 1 1 0 1 0 1

0 1 1 1 0 1 1 0 1 0 0 0
Because a currency value only has two digits to represent the fractional part, these two numbers in BCD
can occupy one byte. The implied decimal point is between this byte and the byte representing the whole
number value.
There are several points to note. With just two bytes, the range of possible values is very small. In any real
system, there would be an agreed number of bytes to represent a value, always with just one byte
representing the fractional part. The use of the term ‘decimal point’ is valid here because BCD is a
character code for the decimal digits 0–9. The term ‘binary point’ should only be used when the
representation is of a binary number value.
b 17.43
c 1 0 0 1 0 1 1 1 0 1 0 1
+ 0 1 1 1 0 1 1 0 1 0 0 0
= 1 0 0 0 0 1 1 0 1 1 1 0 1
When you add the fractional parts, the result is a sequence of binary digits that is not recognisable as a
BCD value.
The addition of the whole number parts has suffered overflow.
d 0 1 0 1
+ 1 0 0 0
= 1 1 0 1
+ 0 1 1 0
= 1 0 0 1 1
+ 1 1 0 1
+ 0 1 1 0
= 1 0 1 0 0
+ 1 0 0 0 0
+ 0 1 1 0
= 0 0 0 1 0 1 1 1
Note how the calculation starts with the codes for the second decimal place BCD values, then moves on
successively through the higher value BCD codes. At each stage, the initial result has 0110 added to it. At
each stage after the first one, any carry digit is included in the calculation. The final answer shows the
four BCD codes correctly representing the value 17.43.
However, note that the correction factor is only used when an individual addition has produced either an
unrecognisable non-BCD character or there has been an overflow. In the example above, it had to be
used three times.
e Four bits provide 16 distinct combinations. Six of these are not BCD codes; only codes 0000 to 1001 are
needed to represent decimal digits. Because 0110 is binary for decimal 6, this, used as a correction factor,
converts an unrecognisable combination into one that is a BCD code. For example, if an addition had
produced 1010 initially (for example, by adding 0111 to 0011) the corrected answer would be 0001 0000.
f In any binary value, each bit represents a power of two. For the fractional part of a number, this still
applies. An exact value can only exist if the fractional part is a combination of 1/2, 1/4, 1/8, 1/16, and so
on. Decimal .75 is a combination of 1/2 and 1/4. The binary equivalent is .11, giving an exact conversion.

© Cambridge University Press 2019


For 7.68, the ‘multiplication by two and record whole number parts’ method (as illustrated in Worked
Example 16.01 of the coursebook) can be used to convert the .68 fractional part. This converts to
.1010111 as a close approximation.
2 A True, B False, C False
3 All are false.
A picture element or pixel is the smallest identifiable component of a bitmap image. The number of bits per
pixel is sometimes referred to as the colour depth. A drawing list contains a command for each object
included in the image where each command has a list of attributes that define the properties of the object.
The resolution of a bitmapped image is the product of the number of pixels per row multiplied by the number
of rows.
4 a At each branch point, the left-hand branch is used for a 0 and the right-hand branch for a 1.
b

c No. To understand why, it is necessary to consider the implication of the prefix property. For two binary
digits, there are four combinations. Here, 10 and 01 have been used to represent letters; 00 and 11 have
been carried forward to form part of three-digit codes. For three digits, there are eight combinations but
four of these cannot be used to code letters because they begin with 01 or 10. In this scheme, 110 and
111 have been used to code letters; 000 and 001 have been carried forward for four-digit codes.
Crucially, the scheme uses 0000, 0001, 0010 and 0011 to code letters, leaving none to be carried forward.
Another way of seeing this is to look at the tree and note that the lowest level has no free spaces.
d The scheme should use two of the four codes with four digits to code letters. The remaining two four-
digit codes can be used to provide four distinct five-digit codes. Two of the original four-digit codes have
been lost but four new five-digit codes have been created so, overall, two more letters are coded.

© Cambridge University Press 2019

You might also like