Computer Science Coursebook-9-24
Computer Science Coursebook-9-24
Computer Science Coursebook-9-24
Learning objectives
By the end of this chapter you should be able to:
• show understanding of the basis of different number • show understanding of how sound is represented and
systems encoded
• show understanding of, and be able to represent, • show understanding of the characteristics of video streams
character data in its internal binary form • show understanding of how digital data can be
• show understanding of how data for a bitmapped or compressed.
vector graphic image is encoded
-
A little later we learn that the rep resentation of a number has the least significant digit at the
right-hand end. For examp le, writing a denary number as 346 has the meaning:
All computer technology is engineered with components that represent or recognise only
two states. For this reason, familiarity with the binary number system is essential for an
understanding of computing systems. Th e binary number system is a base-2 system wh ich
uses just two symbols, 0 and 1. These binary digits are usually referred to as 'bit s'.
All data inside a computer system are stored and manipulated using a binary code. However,
if there is ever a need to document some of this binary code outside of the computer system
it is not helpful to use the interna l code.
Hexadecima l numbers are in the base-16 system and therefore require 16 individua l symbols
to represent a number. The symbols chosen are 0-9 supplemented with A- F. A few examp les
of the hexadecimal representation of binary numbers represented by eight bits are shown in
Table 1.01.
Table 1.01 Hexadecimal representations of binary numbers and the denary values
Note that each grouping of four bits is represe nted by one hexadecima l symbo l. Also note
that it is common practice to include leading zeros in a hexadecimal number when used in
this way.
Question 1.01
Does a computer ever use hexadecimal numbers?
Position values 24 = 16 23 = 8 22 = 4 21 = 2 2° = 1
Binary digits l~ --1- -~ -1- ~ -- o -~ -- o- ~ - -1- ~
Starting from the least significant bit, the denary equ ivalent is 1 + 0 + 0 + 8 + 16 = 25.
An alternat ive method is to use the fact t hat 1 x 16 is equal to 2 x 8 and so on. To carry out
the convers ion you start at the most significant bit and successively multiply by two and add
the resu lt to the next digit:
1 X 2 = 2
add 2 to 1, then 2 x 3 = 6
add 6 to 0, t hen 2 x 6 = 12
add 12 to 0, then 2 x 12 = 24
add 24 to 1 to give 25.
When converting a de nary number to binary the procedure is success_ive division by t wo
with the remainder noted at each stage. The conve rted number is then given as t he set of
rema inders in reve rse order.
To convert a bina ry number to hexa decimal you start with the four least significant bits
and convert t hem to one hexadecimal digit. You then proceed upwa rds towards the most
significant bit, successively tak ing groupings of four bits and conve rt ing each grouping to the
correspond ing hexadeci mal digit.
It is possible to conve rt a denary number direc t ly to hexa decimal but it is easier to convert
first to binary before co mplet ing the convers ion.
TASKl.01
Convert the denary number 374 info a hexadecimal number.
Convert the hexadecima l number 3A2C to a denary number.
- -
r • • -
It is convenient at this po int to emphasise that the coding used in a computer system is
almost exclusively based on bits being grouped together with eight bits representing a byte.
A byte, or a group of bytes, might represent a binary value but equally might represent a
code . For either case, the right-hand bit is referred to as the least significant and the left-hand
bit as the most significant or top bit. Furthermore, the bits in a byte are numbered right to left
starting at bit Oand ending at bit 7.
An unsigned integer can be sto red simply as a binary number. The only decision to be made
•
is how many bytes should be used. If the choice is to use two bytes (16 bits) then the range of
values that can be represented is Oto 216 - 1 which is Oto 65535.
If a signed integer is to be represented, the obvious choice is to use one bit to represent
the+ or - sign . The remaining bits then represent the value. This is referred to as 'sign and
magnitude representation'. However, there are a number of disadvantages in using this
format.
The approach generally used is to store signed integers in two's comple ment form. Here we
t need two definitions. The one's comp lement of a binary number is defined as the binary
I number obtained if each binary digit is individually subtracted from 1 which, in practice,
means that each O is switched to 1 and each 1 switched to 0. The two's complement is
defined as the binary number obtained if 1 is added to the one's complement number.
I
I
I
One's complement: the binary number obtained by subtracting each digit in a binary number from 1
Two's complement: the one's complement of a binary number plus 1
If you need to convert a binary number to its two's complement form you can use the
method indicated by the definition but there is a quicker method. For this you start at the
least significant bit and move left ignoring any zeros up to the first 1 which is also ignored.
Any remaining bits are then changed from Oto 1 or from 1 to 0.
For examp le, expressing the number 10100100 in two's complement form leaves the right-
hand 100 unchanged then the remaining 10100 changes to 01011 so the result is 01011100.
The differences between a sign and magnitude representation and a two's complement
rep resentation are illustrated in Table 1.02. For simplicity we consider only the values that
can be stored in four bits (referred to as a 'nibble').
t
- --- - - - - - - --- - - - - - -
There are several points to note here. The first is that sign and magnitud e representation has
a positive and a negative zero which cou ld cause a problem if compa rin g values . The second,
somewhat trivia l, point is that there is an extra negative value represen ted in t wo's comp lement.
The third and most important point is that the representations in two's complement are
such that startin g from the lowest negative value each successive hi gher value is obta ined by
adding 1 to t he binary code. In particular, when all digits are 1 the next step is to roll over to
an all-zero code. Thi s is the same as any digital display would do when each digit has reached
its maximum value.
It can be seen t hat the codes for positive va lues in the two's co mplement fo rm are the same
as the sign and magnitude codes. However, this fact rather hides the truth that the two's
co mplemen t code is self-comp lementary. If a negative number is in two's comp lement form
then t he binary code for the correspond in g positive number can be obtained by taking the
two's complement of the bina ry code representing the negative number.
TASKl.02
Take the two's complemen t of the binary code for -5 and show that you get the code for +5.
Method 1. Convert to the corresponding positive binary number then find the denary
value
Converting to t wo's complement leaves unchanged the 1 in the least significa nt bit
position then changes all of the rema ining bit s to produce 01001111_
' ~ - - -- - - --- - - -- - - - -
i.
\
Chapter 1: Information Representation
Now using the 'successive multiplication by two' method we get (ignoring the O in the
most significant bit position):
2 X 1 2
add 2 to 0, then 2 X 2 = 4
add 4 to 0, then 2 X 4 8
add 8 to 1, then 2 X 9 18
add 18 to 1, then 2 X 19 38
add 38 to 1, then 2 X 39 78
add 78 to 1 to give 79
Method 2. Sum the individual position values but treat the most significant bit as a
negative value
From the original binary number 10110001 th is produces the following:
-2 7 + 0 + 25 + 24 + 0 + 0 + 0 + 1 =
-128 + 0 + 32 + 16 + 0 + 0 + 0 + 1 = - 79.
Discussion Point:
What is the two's complement of the binary value 10007 Are you surprised by this?
•
One final point to make here is that t he reason for using two's complement representations
is to sim pl ify the processes for arith metic ca lcu lations. The most important examp le of t his is
thatthe process used for subt racting one signed integer from anot her is to conve rt the num ber
being subtracted to its two's complement form and then to add this to the other number.
TASKl.03
Using a byte to represent each value, carry out the subtraction of denary 35 from denary 67
using binary arithmetic with two's complement representa tions.
If a denary number w ith more than one digit is to be converted to BCD there has to be a
group of four bits for each denary digit. There ar~, however, two options for BCD; the first is
to st o re o ne BCD code in one byte leaving four bits unused . The other option is packed BCD
where two 4-bit codes are stored in one byte. Thus, for example, the denary d igits 8503 could
be represented by eithe r of the codes shown in Figure 1.02.
I
One BCD digit per byte ...._0_0_0_01_0_0_0__.__00_0_0_0_10_1____,_o_o_oo_o_o_oo_.__0_0_0_00_0_1_1__.
Figure 1.02 Alternative BCD rep resentations of the denary digits 8503
'i- - - -- --
Cambridge International AS and A level Computer Science
There are a number of applications where BCD can be used. The obvious type of application
is where denary digits are to be displayed, for instance on the screen of a calculator or in a
digital time display. A somewhat unexpected application is for the representation of currency
values. When a currency value is written in a format such as $300.25 it is as a fixed-point
decimal number (ignoring the dollar sign). It might be expected that such values would be
stored as real numbers but this cannot be done accurately (thi;, type of problem is discussed
in more detail in Chapter 16 (Section 16.03). One solution to the problem is to store each
denary digit in a BCD code.
In the first decimal place posit ion, the 2 has been added to the 8 to get 10 but the BCD
scheme only recognises binary codes for a single-digit de nary number so the addition has
failed . The same problem has occurred in the addition for t he second decimal place values .
The result shown is 'point ten eleven', which is meaningless in denary numbers. The 'carry' of
a digit from one decima l place to the next has been ignored .
Starting w ith the least significant ni bb le Add correction to least significant nibble OllO
The result has a carry bit 1 0001
(see Figure 1.04), adding OllO to lOll
gives 10001 which is a fou r-bit va lue plus
Add correction plus carry to next nibble Olll 0001
a carry bit. The carry bit has to be added
The result has a carry bit 1 00010001
to the next nibble as well as add ing the
OllO to correct t he error. Adding 1 to 1010
and then adding OllO gives 10001. Again
Add carry to next nibble to get l.ll I 0000 0001 I 0001 0001
The scheme wh ich has been used for the longest time is the ASC II (American Standard Code
for Information Interchange) coding scheme. This is an internationally agreed standard.
There are some variations on ASCII cod ing schemes but the maj or one is the 7-bit code. It is
customary to present the codes in a table for which a number of different designs have been
used.
Table 1.03 shows an edited version with j ust a few of t he codes . The first column contains
t he binary code which would be stored in one byte, with the most significant bit set to
zero and the remaining bits representing the character code . The second column presents
the hexadecimal equivalen t as an il lustration of when it can be useful to use such a
representation .
•
00000001 01 SOH Start of heading
00000010 02 STX Sta rt of tex t
00100000 20 Space
00100001 21 ! Exclamation mark
0010 0100 24 $ Dollar
00101011 2B + Plus
00101111 - 2F I Forward slash
00110000 30 0 Zero
00110001 31 1 One
00110010 32 2 Two
01000001 41 A Uppercase A
01000010 42 B Uppercase B
01000011 43 C Uppercase C
01100001 61 a Lowercase a
01100010 62 b Lowercase b
01100011 63 C Lowercase c
The full t ab le shows the 27 (128) different codes available for a 7-bit code. You should not try
to re member any of the ind ividua l codes but the re are cert ain aspects of the coding scheme
wh ich you need to understand.
Firstly, you can see t hat the maj ority of the codes are for printing or graphic characters.
However, the first few codes represent non-printing or control characters. These were
introduced to assist in data transmission or in entering data at a compute r term inal. It is fair
to say that these codes have very lim ited use in the modern compu ter world so th ey need no
further consideration.
ti
r
----- -- - - -- - - -- -- ~-
Secondly, it can be seen that the obvious types of character that could be expected to be
used in a text based on the English language have been included. Specifica lly there are
upper- and lower-case letters, punctuation symbols, numera ls and arithmetic symbo ls in the
coding tables .
It is wo rth emphasising here that t hese codes for numbers are exclusive ly fo r use in the
context of stored, displayed or printed text. All of the other coding schemes for numbers are
for internal use in a computer system and wou ld not be used in a text.
There are some specia l features that make the coding scheme easy to use in certain
circumstances. The first is that the codes for numbers and for letters are in sequence in each
case so that, for example, if 1 is added to the code for seven the code for eight is prod uced .
The second is that the codes for the upper-case letters differ from the codes fo r the
corresponding lower-case letters on ly in the value of bit 5. Thi s makes conversion of upper
case to lower case, or the reverse, a si mple operation.
Unicode
Despite still be ing wide ly used, the ASC II codes are far from adequate for many purposes.
For this reason new coding schemes have been developed and continue to be developed
further. The d iscussion here describes the Unicode schemes but it shou ld be not ed that
t hese have been deve loped in tandem with the Unive rsa l Character Set (UCS) scheme;
the only differences between these schemes are the identifying names given to them. The
ai m of Unicode is to be able to rep resent any possible text in code form. In particular t hi s
inclu des all languages in t he world. However, Unicode is designed so that once a coding set
has been defined it is never changed. In particu lar, the fi rst 128 characters in Un icode are
the ASCI I codes.
Unicode has its own specia l terminology. For exa mple, a character co de is referred to as
a 'code point'. In any documentation there is a special way of identifying a code point. An
example is U+0041 which is the code point correspond ing to t he alphabetic cha racter A. The
0041 are hexadecim al characters representing two bytes. The interesting point is that in a
text where the cod ing has been identified as Un icode it is only necessary to use a one-byte
represen t ation for the 128 codes co rresp onding to ASCII. To ensure suc h a code cannot be
misinterpreted, the codes where more than one byte is needed have restrictions appl ied.
Figure L OS shows the format used fo r a two-byte code .
11?????? 10??????
Figure 1.05 Unicode two-byte code format
The most sign ifi cant bit for an ASC II code is always Oso neither of the two-byte
representations here can cause confusion .
1.04 Images
Im ages can be stored in a com puter system for the eventua l purpose of displaying the ima ge
on a screen or for presenting it on pa per, usually as a component of a document. Such an
im age ca n be created by using an appropriate drawing package. Alternati vely, when an image
already exists independently of the computer system, the image can be captured by using
photography or by scanning.
~-- - - - - - - - - --- ~ -- - - - - - - - -
Vector graphics
It is normal for an image that is created by a drawing package or a computer-a id ed design
(CAD) package to consist of a number of geometric objects. The outcome is then usually for
the image to be stored as a vector graphic file.
Vector graphic: a graphic consisting of components defined by geometric formulae and associated
properties, such as line colour and style
Th e most important property of a vector graphic image is that the dimensions of the obj ects
are not defined explicitly but instead are defined relative to an imaginary drawing canvas . In
other words, the image is sca lable. Whenever the image is to be displayed the file is read, the
appropriate ca lcu lations are made and the objects are drawn to a suitable scale. If the user
then request s that the image is redrawn at a larger scale the file is read again and another set
of calculations are made before the image is displayed. This process cannot of itself cause
•
distortion of the im age.
TASKl.04
Construct a partia l drawing list for the graphic shown in Figure 1.06. You can take
measurements from the image and use th e bottom left corner of the box as the origin of a
C<;)Ordinate system . You can invent your own format for the drawing list.
A vector graphic file ca n only be displayed directly on a graph plotter, which is an expensive
specialised piece of hardware. Otherwise the file has to be converted to a bitmap before
present ation .
Bitmaps
Most images do not consist of geometrically defined shapes so a vector graphic
representation is in appropriate. Th e general purpose approach is to store an image as a
bitmap. Typica l uses are when capturing an existi ng image by scanning or perhaps by t aking
a screen -shot. Alternati vely, an image can be created by using a simple drawing package.
Th e fu ndamental concept underlying the creation of a bitmap fil e is that the picture
element (pixel) is the smal lest identifiable componen t of a bitmap im age. Th e image is
stored as a two-dimensional matrix of pixels. The pixel itself is a very sim ple construct; it has
a position in the matrix and it has a co lour.
- - - - - - -- - -- -- -- -- --
Cambridge International AS and A level Computer Science
Picture element (pixel) : the smallest identifiable component of a bitmap image, defined by just two
properties: its position in the bitmap matrix and its colour
The other decision that has to be made concerns the resolution of the image wh ich can be
represented as the product of the number of pixels per row times the number of rows. When
considering resolution it is important to distinguish between the reso lution of a stored image
and the resolution of a mon itor screen that might be used to display the image. Both of these
have to be considered if a screen display is being designed.
From t he above discussion it can be seen that a bitmap file does not define t he physical
size of a pixel or of the whole image. The image is therefore scalable but when the image
is scaled the number of pixels in it does not change. If a we ll-designed image is presented
on a suitable screen the human eye cannot distinguish the individual pixels. Howeve r, if
the image is magnified too far the qua lity of the display will deteriorate and t he individual
pixe ls will be evident. This is illustrated in Figu re 1.07 which shows an original small image, a
magnified version of t his small image and a larger image created with a more sensible, higher
resolution.
Figure 1.07 (a) a bitmap logo; {b) an over-magnified ve rsion of the image; (c) a sensible larger version
File size is always an issue with an image file. A large file occup ies more memory space and
takes longer to display or to be transmitted across a network. A vector graphi c file w ill have a
smaller size than a corresponding bitmap file. A bitmap file has to store the pixe l data but the
file must also have a header that defines the resolution of the image and the coding scheme
for the pixel colour.
--- - ---- - - -- - - - - ~- - -- -- -
You can calculate the minimum size (the size not including the hea der) of a bit map fi le
knowing the reso lution and the colour depth . As an examp le, consider that a bitmap file is
needed to fill a laptop screen where the resolution is 1366 by 768. If the colour depth is to be
24 then the number of bits needed is:
The result of th is calculation shows the number of bits but a file size is always quoted as a
number of bytes or multiples of bytes. Thus our file size could be quoted as:
Kibi: a prefix representing the factor 210 (1024) written as the symbol Ki
Mebi: a prefix rep resenting the factor 220 (1048576) written as the symbol Mi
Gibi: a prefix representing the factor 230 written as the symbol Gi
TIP
For multiples of bytes, the terminology used has recently changed. Traditionally, computer
•
scientists have used the terminology kilobyte, megabyte, gigabyte etc. in a way that conflicted
with the definition of these prefi xes established by the International System of Units (SI).
Following the SI convention , one kilobyte wou ld represent 1000 bytes. Computer scientists
have used one kilobyte to represent 1024 bytes. There have been a number of variations on
how this was written , for example Kbyte, KB or kB but the basic contradiction remained. In
orderto resolve this unsatisfactory situation, the International Electrotechnical Commission
(IEC) in 1998 proposed a new set of definitions for such quantities. 1024 bytes is now identified
as one kibibyte where the kibi can be considered as representing kilobinary. This proposal has
been accepted by other international standards bod-ies.
1.05 Sound
Natural sound cons ists of variations in pressure w hich are detected by the human ear. A typical
sound conta ins a large number of individual waves each w ith a defined frequency. The resu lt is
a wave form in whi_ch the ampl itu de of the sound varies in a contin uous but irregu lar pat tern.
If t here is a need to store sou nd or transmit it electron ica lly the original ana logue sound
signal has to be co nverted to a bin ary code. A sound encoder has two compone nts. The first
is a band-limiting filter. This is needed to remove high-frequency co mponents. The ear would
not be able to detect t hese and they co uld ca use problems for the cod ing if not removed. The
other component in the encoder is an analogue-to -digital conve rter (ADC).
The method of operation of t he ADC is described w ith reference to Figure 1.08. The ampl itude
of the wave (t he red line) has to be samp led at regular interva ls. The blue vertica l li nes in dicate
the samp li ng times. The amplitude cannot be measured exactly; instead t he amp litud e is
approximated by the closest of t he defined amplitudes represented by t he horizontal lines. In
Figu re 1.08, sample values 1 and 4 w ill be an accurate estimate of the actual amplitude because
the wave is touching an amplitude li ne. In contrast, samples 5 and 6 will not be accurate because
the actual amplit ude is app roximately half way between the two closest defined values.
~~~~~~~~~~~~~~- - ~~~
Sound
amplitude
1 2 3 4 5 6 7
Time
Figure 1.08 ADC sampling
In practice, for coding soun d, t wo decisions have to be made. The first is the number of
bits to be used to store the amplitude values, which defines the samp ling resolution. If only
three bits are used then eight levels can be defined as shown in Figure 1.08. If too few are
used there will be a significant quantisation error. In practice 16 bits wil l provide reasonab le
accu racy for the digitised sound.
The other decision concerns the choice of the samp lin g rate, which is the number of samples
taken per second. Thi s should be in accordance with Nyquist's theorem which states that
sampling must be done at a frequency at least twice the highest frequency in the sample.
Once again file size can be an issue. Clearly an increased sampling rate and an increased
sampling resolution will both cause an increase in file size.
Simply recording sound and storing a digital representation is not enough for many
appl ications. Once a digital representation of the sound has been sto red in a file, it can be
man ipulated using sound-editing software. This will typically have features for:
1.06Video
The emphasis here is on the visual aspect of a video recording and, in pa rti cular, how the
_ image is disp layed on a screen. It might be imagined that a vid eo would be stored very
simply as a succession of still images or frames and the on ly concern would be the frame rate
defined as the number of frames disp layed per second . In practice the issues are far more
comp lex. They have not been made any more simp le by the recent changes that have taken
place with regards to screen technology.
The basic principle of operation is that the display of an individual frame is created line by
line. One of the issues is the choice of resolution. The resolution can be defined in terms
of the number of lines per frame and th e number of pixels per lin e. There needs to be
compatibi lity between the resolution of the stored image and the reso lution of the display
scree n. However, the technology used has to be chosen with regard to t he se nsitivi ty of the
human eye. One constraint is that unless the screen is refreshed at least 50 times per second
r ~
i
t· Chapter 1: Information Representation
the eye will notice the flicker. However, provided that the refresh rate is 25 times per second
the eye cannot see that any motion on the screen is not actua lly continuous.
The traditional solution to this problem has been to use interlaced encoding. This was used
in television broadcasting and then adapted for video recordings. The image for each frame
is split into two halves, one containing the odd numbered lines and the other the even. The
first half is displayed comp letely then the second half fo llows. This produces what appears to
the eye as being a high refresh rate but is halving the transmiss ion bandwidth requirements.
The alternati ve approach is to use progressive encoding where a full frame is displayed each
time. As improved transmission bandwidths become more generally ava ilable it is likely that
progressive encoding will become the norm.
There are two categories of compression. The first is lossless compression where the file
size is reduced but no information is lost and when necessary the process can be reversed to
re-create the original file. The second is lossy compression where th e file size is reduced
with some loss of information and the original fil e can never be recovered. In many
appl ications a combination of lossless and lossy methods may be used.
Lossless compression: coding techniques that allow subsequent decoding to recreate exactly the
origina l file
Lossy compression: coding techniques that cause some information to be lost so that the exact
original file cannot be recovered in subsequent decoding
•
If a file contains text then compression must be lossless because it is
not sensible to allow any loss of information . One possible compression Code Character
method wou ld be Huffma n cod in g. The procedure used to carry out the 10 e
compression is quite detailed but the principle is straightforward . Instead 01 t
of having each charac ter coded in one byte an ana lysis is carried out to find 111 0
the most often used cha racters. These are th en given shorter codes. The 110 h
original stream of bytes becomes a bit stream. A possible set of codes if a 0001 I
text contained only eight different letters is shown in Table 1.04. 0000 p
The important point to note here is the prefix prope rty. None of the codes
0011 w
begins with the sequence of bits representing a shorter code. Thus there 0010 z
can be no ambiguity when the transm itted compressed file has to be
Table 1.04 An example of Huffman coding
converted back to the original text.
A different lossless compression technique is run-length encod ing. Thi s can be particularly
effective for compressing a bitmap file. The compression converts sequences of the same bit
patte rn into a code that defines the bit pattern and the number of times it is repeated .
Lossy compression can be used in circumstances where a sound fil e or an image file can have
some of the detailed coding removed or mod ified when it is likely that the human ear or eye
will hardly notice any difference. One example would be to reduce th e colour depth for the
coding of a bitmap.
~
If the image coding for a video is to be compressed, one approach is to tackle th e spatial
redundancy in individual frames using tec hniques applicable to an im age file. However, t his
is unlikely t o be an efficient technique because, in genera l, one frame is very sim ila r to the
preceding one. It w ill be more effective to tackle this temporal redundancy by changing the
frame by frame coding to one w hich mainly records differences between adjacent frames.
A video conta ins images and sound but these do not go to the same part of any receiving and
displayi ng system. Clearly the audio and visual parts of a video must be handled independently
but in a way that guarantees synchronisation. The so lution to this is to package the audio and
visual components in what is known as a multimedia container format. This concept is currently
being developed by several different organisations or companies. The use is not restricted to
one video file and one sound file. Rather, one multimed ia container file will have many audio
and vid eo streams plus other streams, perhaps for subtitles or chapter headings.
• ASCII and Unicode are standardised codi ng schemes for text characters.
Exam-style Questions
1 A file contains binary cod ing. The following are t wo successive bytes in the file:
1 10010101 I 00110011 I
a One possib ility for the inform ation stored is t hat the two bytes together represent one unsigned integer bin ary
number.
Give the denary number corresponding to this. Show you r wo rking. [2)
.-- -
- - - - - - - - - - - - ----- --
c Another possibility for the information stored is that the two bytes individually represent two signed integer
binary numbers in two's complement form.
State which byte represents a negative number and explain the reason for your choice.
ii Give the de na ry number corresponding to each byte. Show your work ing. [3]
d Give two advantages from representing signed integers in two's complement fo rm rather than using a sign and
magnitude representation . . [2]
e Give three different examples of other options for the types of information that could be represented by two
bytes. For each example, state whether a representation requires two bytes each t ime, just one byte or only
part of a byte each time. [3]
a If the designer has some images stored in files there are two possible formats for t he files .
Describe the approach used if a graphic is stored in a vec tor graphic file. [2]
ii Describe the approach used if a graphic is stored in a bitmap file. [2]
iii State which format gives better image quality if t he image has to be magn ified and explain why. [2]
b The des igner is concerned abo ut tne size of some bitmap files .
If the resolution is to be 640 x 480 and the co lour depth is to be 16, calculate an approximate size for the
c
ii
bitmap file. Show your working and express the size using sensible units.
[l ]
[2]
•
ii Explain one possible approach to lossy compression that cou ld be used. [2]
3 An audio encoder is to be used to create a recording of a song. The encoder has two components.
b The other component of an audio encoder has to be used before the ADC is used.
c The recorded song is to be incorporated into a video. Sound-editing software is to be used as part of th is
process. Describe two techniq ues that the sound-editing software could provide. [3]