Revision Guide Coursebook
Revision Guide Coursebook
Information representation
Chapter
Revision objectives
By the end of the chapter you should be able to:
show understanding of the basis of different show understanding of how typical features found
number systems; use the binary, denary and in bitmapped and vector graphics software are
hexadecimal number systems; and convert a used in practice and are therefore appropriate for
number from one number system to another a given task
express a positive or negative integer in two’s show understanding of how sound is represented
complement form and encoded
show understanding of, and be able to represent, use the associated terminology: sampling, sampling
character data in its internal binary form rate, sampling resolution
express a denary number in binary coded show understanding of how ile sizes depend
decimal (BCD) and vice versa and describe on sampling rate and sampling resolution
practical applications where BCD is used show understanding of how typical features
show understanding of how data for a bitmapped found in sound-editing software are used in
image is encoded practice
use the terminology associated with bitmaps: show understanding of the characteristics of
pixel, ile header, image resolution, screen video streams: frame rate (frames/second);
resolution interlaced and progressive encoding; video
perform calculations estimating the ile size for interframe compression algorithms and
bitmapped images of different resolutions spatial and temporal redundancy; multimedia
container formats
show understanding of how data for a vector
graphic is represented and encoded show understanding of how digital data can
be compressed, using ‘lossless’ (including run-
use the terminology associated with vector
length encoding, RLE) or ‘lossy’ techniques.
graphics: drawing object, property and drawing list
• that digits in certain positions each have a place denary (decimal): numbering system using
value base 10 with possible digits 0, 1, 2, ..., 8 and 9
• the number of possible digits used is the base. binary: numbering system using base 2
Binary system
Intuitively we would read the denary number as “eight thousand, seven hundred and twenty six”.
Appreciate that it is based on the place-value concept that we have:
(8 x 1000) + (7 x 100) + (2 x 10) + 6 = 8726
Applying the same method to the binary pattern 10111, computes the pattern as binary number:
(1 x 16) + (0 x 8) + (1 x 4) + (1 x 2) + 1 = 23
Hexadecimal system
The base 16 numbering system can be summarised as shown in Table 1.02.
The Hexadecimal numbering system follows our three The number shown in Table 1.02 is:
basic rules.
(1 x 256) + (B x 16) + 5 = 256 + 176 + 5 = 437 denary
Since the ‘digits’ allowed in base 16 extend past 9 then
we need a way to represent 10, 11, 12, 13, 14 and 15. The
solution in hexadecimal is to use the characters A to F as Conversion between different
shown.
number presentations
If we did not do this, then the hexadecimal We can now convert from binary to denary and vice
TIP
representation 13, could either be versa and also from hexadecimal to denary and vice
interpreted as 13 denary or (1 x 16) + 3 = versa. What about conversion between binary and
19 denary. hexadecimal?
One approach would be to convert into denary irst –
but there is a more direct way.
Example:
Convert 0011110101010100 into hexadecimal
Divide the binary into groups of four binary digits:
0011 1101 0101 0100
Write the denary for each group
0011 1101 0101 0100
3 13 5 4
We can then convert each denary number to its hexadecimal equivalent:
3 D 5 4 = 3D54 hex
The method can be used in reverse to convert from hexadecimal to binary.
Example: Convert 4AE hex to a binary number stored as two bytes.
Hexadecimal: 4 A E
Denary: 4 10 14
Binary: 0100 1010 1110
‘Stored as two bytes’ means this number will be stored as 16-bit binary pattern as shown in Figure 1.01.
0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 0
Figure 1.01 A binary number stored as two bytes
Note the need to pack out the leftmost group of four bits
with zero bits. 3 What is the eight-bit binary representation for
these integers?
a 3 b 89 c 257
Numbers in the computer
4 Convert these hexadecimal numbers to denary:
All data in the computer must be represented in binary form. a 1A b 10B
Consider a single byte used to represent a positive 5 Convert these hexadecimal numbers to 12-bit
integer. binary representations:
• the most signiicant bit position has place value of 128 a 7D b 196 c AEC
• the least signiicant position has place value of a ‘unit’,
that is 0 or 1.
Two’s complement representation
Progress check 1.01 We need to be able to represent both positive and
1 What positive integer is this? negative integers.
One (simple) method would be to use the most signiicant
0 1 1 0 0 1 1 1 bit to act as a ‘sign’ bit (1 for a negative integer and 0 for a
positive integer) . This method is called ‘sign and magnitude’
2 A positive integer is represented using a single
but is not in our 9608 syllabus.
byte. What is the denary value?
We shall use a representation – two’s complement –
a 0100 0001 b 1010 1010 c 1111 1111
which has a negative place value for the most signiicant
bit. For a two’s complement presentation using a single Each digit of the denary number is represented in
Convert the following denary numbers to an eight-bit Early computers stored date and time values in
two’s complement binary number. the BIOS of the operating system using BCD
representation. Some later games consoles including
1 56 = 32 + 16 + 8 Atari and Sony PlayStation did likewise. However in
2010, the PlayStation software interpreted the inal
-128 64 32 16 8 4 2 u
two digits of the date ‘10’ (stored in BCD) as the
0 0 1 1 1 0 0 0 hexadecimal number 16. The resulting date of 2016
made the console inoperable!
2 -125 = -128 + 3 = -128 + (2 + 1)
-128 64 32 16 8 4 2 u
1 0 0 0 0 0 1 1 1.02 Images
3 -17 = -128 + 111 = -128 + (64 + 32 + 8 + 4 + 2 + 1) Bitmapped image
-128 64 32 16 8 4 2 u A bitmap graphic is a rectangular grid built up from a
1 1 1 0 1 1 1 1 number of pixels. A pixel is the smallest addressable
picture element which can be represented. The term
bitmap comes from the concept that the bit patterns
which make up the ile are ‘mapped’ to an area in the
Note the method for a negative number. If main memory. Each pixel will be a particular colour. Each
TIP
its negative, we must have the ‘1 lot of -128’ pixel’s colour will be represented as a binary pattern. The
– we then need to work out what positive contents of the bitmap ile will be this sequence of binary
number to add to it. colour codes.
TERMS
Representing characters
pixel: the smallest addressable picture
All data – including characters – must be represented in element which can be represented.
main memory, saved in the backing store and processed
by a program as a number value. A coding system such as
ASCII or Unicode will be used.
There are several types of encoding and ile formats for
bitmap images:
LOOK FORWARD ››
• Monochrome: black and white pixels only
ASCII and Unicode are discussed in Chapter 10, • 16 colour: 16 available colours for the pixels
section 10.01.
• 256 colour: 256 possible colours
• 24-bit colour (or true colour) where millions of
Binary-Coded Decimal (BCD) different colours are possible.
The encoding for each type can be worked out as shown The clarity with which a bitmap image is viewed on a
Chapter 1 Information representation
1.03 Sound The sound will be sampled at a set time interval and these
80
70
60
50
40
30
20
10
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Milliseconds
300 301 302 303 304 305 306 307 308 309
8 20 35 44 38 38 48 61 69 75
• If samples are taken more frequently, the quality of the A system which stores the data for an entire frame and
sound wave will increase. displays all the frame data at the same time is called
‘progressive encoding’. This means the frame rate will be
• If a larger number of bits is used to encode each the number of pictures displayed per second. Traditional
sample, the sound resolution will increase. ilm uses progressive encoding.
Sound editing software is used for the recording of:
• Spoken word using a microphone Interlaced encoding
• The ‘digitising’ of an analogue sound source. An The problem is that some devices, such as a television,
example could be the connection of a record turntable are not designed to display all the frame data at the
to the computer. The sound from a vinyl record is then same time. The data from a single frame is encoded
recorded using the sound recording software as two separate ields; one containing the data for the
even numbered rows and the second frame has the
Editing features of the software would include: data for the odd numbered rows. The term interlaced
• Cutting and pasting of sections of the recording comes from the concept that the image is rendered
by switching between the even ield and the odd ield.
• Filtering out certain sounds. For example the ‘clicks’ on
It follows that the rate of picture display is twice the
a scratched vinyl record
frame rate.
• Recording as a single (mono) channel or two channels
With increasing demand for the display of video content
(stereo)
through DVD players, set-top boxes and other home
• Normalising the recording level electronic devices there is still a need for interlaced
• Export of the sound recording to a variety of ile encoded video format iles.
formats. For example MP3. The picture frames that make up interlaced ields have a
correct order relative to each other:
• The spatial order shows which should be the odd or
1.04 Video even ield.
Video is in widespread use on computers for recreational • The temporal order refers to a ield or frame and
and educational use: which ield represents an earlier moment in time.
• YouTube is one of the most popular websites where If either one or both of these orders is incorrect the result
users can post their own video content. of the playback will appear as jerky motion or blurred
edges to content.
• Videos are an excellent medium for an explanation of
the working of a piece of equipment or to provide a
learning tutorial.
1.05 Compression techniques
A video is a sequence of still photographic images which
are displayed in sequence. The frequency with which they Both sound and video iles tend to have large ile size.
are displayed gives the appearance of continuous motion, Techniques used which encode the data in a way which
and what is contained on individual frames is not apparent. results in less bytes for the ile are highly desirable.
The frequency with which the frames are displayed is Compression is the technique of reducing the size of a ile
called the frame rate. A continuous effect to the human without a signiicant loss in the later quality in the use of
eye is achieved with a frame rate of 25 frames per the ile.
second or higher.
the pixel value followed by the number of occurrences of background. This will contain ‘runs’ when horizontal or
w w w w w w w w w b b w w b b b b g g g g w w w w w w w w w
w w w w g g g g g b b b b b r r r r r r r r w w w w w w w w
w w w w w w w w w w w w w w r r r r r r r r w w w w w w w w
w w w w w w w w w w w w w w w w w w w w w w w w w w w w w w
The irst row of pixels could be encoded: • An image which has a large background could encode
9w2b2w4b4g9w. the background pixels with a lower resolution.
Assuming each ‘run number’ is stored as a single byte, the • Colours such as blue, to which the human eye is less
irst line will be stored using 14 bytes (compared to the sensitive, could be encoded at a lower resolution.
original 30). This is a very effective compression.
The popular .jpeg ile format is lossy.
Video – which is a combination of moving pictures and • popularity: is the container format widely supported?
sound – requires its own industry standards. The detail This is the reason that the AVI format is still the most
about encoding methods used for this is outside the popular format.
scope of our syllabus. The key issue is that there is correct • overheads: This refers to the difference in ile size
synchronisation between the picture display and the between two iles with the same content in a different
accompanying sound commentary. container. For a two-hour ilm, an AVI ile may be up to
The current popular multimedia container formats include: 10 MB larger than a ile in Matroska format.
• AVI (standard Microsoft Windows container) • support for advanced codec functionality: Older
formats, such as AVI, do not support new codec
• MOV (standard QuickTime container) features, such as streaming media.
10
Exam-style questions
90 003C
How many bits are used for each main memory location? [1]
Cambridge International AS and A Level 9691 Paper 31, Q3 b & c (i) Nov 2013
11