Cambridge-Igcse-Computer-Science Fit
Cambridge-Igcse-Computer-Science Fit
Activity 1.9
Using the ASCII rnde table (Figure 1.7) convert the following URL~ into the equivalent
hexadecimal:
a www.de.org.uk
b www.de.org.uk/computer_sdence
c httpsJ/INvwi.hodder.co.uk
d www.HodderEducation .co.uk
e http://www.ucles.ac.uk/computing.htm
Sometimes the hexadecimal addresses arc used in the address of files or web pages
as a security feature. It takes longer to type in the URL using the hexadecimal
codes, but it has the advantage that you are unlikely to fall into the trap of
copying and pasting a 'fake' website address.
1010 01011110 0100 1111 1111 1010 0100 (machine code using binary)
,\lachine code and assembly code are examples of low-level languages and are
used by software dL·velopers when producing, for example, computer games. As
you will find in Chapter 7, although they look cumbersome, thL-y ha\·e many
advantages at the development stage of software writing ( especially when trying
to locate errors in the code ).
Communication and internet technologies
2.1 Introduction
When data is se nt from one device to another, it is important to consider how
that data is transmitted. It is also important to ensure that the data hasn't bee n
changed in any way.
The internet has now become an integral part of all of our li\·es. This chapter
will consider some of the important technologies going on in the background
whic h support the internet.
Figure2.1
•
( Note: bits can be transmitted as simplex, half-duplex or full -dupl ex.)
2.2 Data transmission
This method of data transmission works well o\·er long distances. However, data
is transmitted at a slower rate than parallel data transmission. Since only one wire
or channel is used, there is no problem of data arri\'ing at its destination out of
synchronisation.
An example of its use is sending data from a computer to a modem for
transmission over a telephone line.
PARAILBL DATA TRANSMISSION is when sevem/ bits of dntt1 (umal/y 1 byte) are
sent down several wires 01' channels at the same time; one wire or channel is used
to transmit each bit.
I-· I l-~-1~;,£~
Figur• 2.2 ... ;;::=,,p
(Note: bits can be transmitted as simplex, half-duplex or full -duplex. ) •
This method of data transmission works very well o\·er short distances ( over
longer distances, the bits can become 'skewed' - this means they will no longer be Figure 2.3 R;bbooronnector
synchronised ). It is, howe\·er, a faster method of data transmission than serial.
An example of its use is when sending data to a printer from a computer using a
ribbon connector.
Activity 2.1
Describewhatisme,mtby:
a serial, hatl-duplexdatatransmission
b parallel,full-duplexdatatransmiOOn
c serial,simplexdata trammission
A common use for serial data transmission is discussed in Section 2.2.4 (Universal
Serial Bus (USB )).
Parallel data transmission is used in the internal electronics of the computer
system. The pathways benveen the CPU and the memory all use this method
of data transmission. Integrated circuits, buses and other internal components
all use parallel data transmission because of the need for high speed data transfer.
The use of8 -bit, 16-bit, 32-bit and 64-bit buses, for example, allow much faster
data transmission rates than could be achieved with single channel serial data
transfer. An internal clock is used to ensure the correct timing of data transfer;
it is essentially synchronous in narnre (see Section 2.2.3 ) and the short distances
between components mean that none of the issues described earlier have any real
impact on the accuracy ofthe data.
Chapter 4 covers the internal architecrnre of computer systems (including the
role of buses ) and this should be read in conjunction with the information given
above.
1,tartbit 1, I O 1, 1, 1, 1, I O I O 1, 1, 1, I O 1, I O 1, I O Isiopbit I
cootrol bit
Figu,.2.4
This means that the recei\·er of the data knows when the data starts and when it
ends. This prevents data becoming mixed up; without these control bits, it would
be in1possible to separate groups of data as they arrived.
SYNC HRONOUS DATA TRANSMISSION is a continuous stream of data (unlike
asynchronous data which is sent in discrete groups). The data is accompanied by
timing signals generated by an internal clock. This ensures that the sender and
recei\'cr are synchronised with each other.
The recei\'ercounts how many bits ( l s and Os ) were sent and then reassembles
them into bytes of data. The timing must be \·ery accurate here since there arc
no control bits sent in this type of data transmission. H owe\'er, it is a faster
data transfer method than asynchronous and is therefore used where this is an
important issue (for example, in network communications).
Oevkespluggedintolhe«rnputera,reaotomabcally
detected;de,,;ced,iv,,.-,a,reautomaticallyuploaded
Thero,mec!OfScanonlyfitonew~:thisp,'-"'enls Themaximumcablelenglhisp,esentlyabootS
inror,ectconnectionsbeingmade metres
Thishasbecomethe indllSt,y,tan,fa,d;thismeans
thatcoosidefablesuppo,tisava ilabletousers
Severaldiffe,entdatatransmissioo,atesare Thep,esenttransmissioo,ateislimitedtoJessthan
supported 500megabil5Jll'fsecood
2.3 Error<hecking methods
• parity checking
• automatic repeat request (ARQ)
• checksum
• echo checking.
p,,<itybit
Figur•2.6
2 COMMUNICATION AND INTERNET TECHNOLOGIES
If this byte is using even parity, then the parity bit needs to be O since there is
already an even number of I -bits (in this case, 4 ).
If odd parity is being used, then the parity bit needs to be I to make the
number of I -bits odd.
Therefore, the byte just before transmission would be:
either(even parity)
parjtybit
Rgu,.2.7
or (odd parity)
parjtybit
Rgu,.2.8
Activity 2.2
Findtheparitybitsloreadiolthelollowingbytes:
a 1101101 eveoparjtyused
b 0001111 even parity used
c 0111000 even parity used
d 1110100 oddparjtyused
odd parity used
If a byte has been transmitted from 'A' to 'B', and even parity is used,
an error would be flagged if the byte now had an odd number of I-bits at
the recei\'er'send.
Examp le 1@
Rgu,.2.9
In this case, the receiver's byte has three I -bits, which means it now has odd
parity whilst the byte from the sender had even parity ( four I-bits). This clearly
means an error has occurred during the transmission of the data.
The error is detected by the computer recalculating the parity of the byte sent.
If c\'cn parity has been agreed between sender and recei\·er, then a change of
parity in the received byte indicates that a transmission error has occurred.
2.3 Error<hecking methods
Activity 2.3
Whichofthefollowingbyteshaveanerrorfollowingdatatransmission?
a 11101101 even parity used
b 01001111 even parity used
c 00111000 even parity used
d 11110100 odd parity used
odd parity used
In each case where an error occurs, can you work out which bit is incorrect?
Namrally, any of the bits in Example 1 could have been changed leading to
a transmission error. Therefore, e\·en though an error has been flagged , it is
impossible to know exactly which bit is in error. (Your last answer in Activity 2.3
should have been 'NO' since there isn't enough information to determine which
bit has been changed. )
0 One of the ways around this problem is to use PARITY BLOCKS. ln this
method, a block of data is sent and the number of 1-bits are totalled horizontally
and vertically (in other words, a parity check is done in both horizontal and
vertical directions ). As Example 2 shows, this method not only identifies that an
error has occurred but also indicates where the error is.
Examp le 2 @
In this example, nine b)'tes of data ha\·e been transmitted. Agreement has been
made that even parity will be used. Another byte, known as the PARITY BITE,
has also been sent. This b)'te consists entirely of the parity bits produced by the
\'ertical parity check. The parity b)'te also indicates the end of the block of data.
The following table shows how the data arri\·ed at the recei\'ing end:
byteB 0
byte9 0
parity
"'~
A carefid srudy of Table 2.2 shows the following:
• byte 8 (row 8 ) has incorrect parity (there are three 1-bits)
• bit 5 (column 5 ) also has incorrect parity (there are five 1-bits).
2 COMMUNICATION AND INTERNET TECHNOLOGIES
First of all, the table shows that an error has occurred following data transmission.
Secondly, at the intersection of row 8 and column 5, the position of the
incorrect bit value (which caused the error) can be found.
This means that byte 8 should have the value:
Figure2.10
which would also correct column 5 giving an even vertical parity ( now has four
1-bits ).
This byte could therefore be corrected automatically as shown above, or an
error message could be relayed back to the sender asking them to retransmit the
block of data.
One final point: if two of the bits change value following data transmission,
it may be impossible to locate the error using the above method. For example,
using fa:ample l again:
Figure2.12
Figure2.14
All three are clearly incorrect; but they have retained even parity so this wouldn't
have triggered an error message at the receiving end. Clearly we need to look
at other methods to complement parity when it comes to error checking
transmitted data.
2.3 Error<hecking methods
Activity 2.4
The following block of data was received after transmission from a remote computer; odd parity
beingusedbybothsenderandreceiver.Oneofthebitshasbeeochangedduringthetransmission
stage. LDG1tewherethiserrorisands.uggestamrrectedbyte value
byte1 0
byte2 1
byte3 1
byte4 0
bvt.5 1
bvte6 1
bvte7 0
bvte8 0
l bvte9 O
parity
S,w
2.3.3 Checksum ®
CHECKSUM is another way to check if data has been changed or corrupted
Oividethesum,X.of
following data transmission. Data is sent in blocks and an additional value, thebyte,by2S6
the checksum, is also sent at the end of the bloc.k of data.
To explain how this works, we will assume the checksum of a block of data
is I byte in length. This gives a maximum value of28 - 1 (i.e. 255 ). 111e value Roondtheanswer
downtothenea,est
0000 0000 is ignored in this calculation. Example 3 explains how a checksum is wholenumbef.Y
generated.
Examp le 3
If the sum of all the bytes in the transmitted block of data is<• 255, then the
checksum is this value.
H owever, if the Slllll of all the brt:es in the data block> 255, then the checksum Cakulatethe
is found using the simple algorithm in Figure 2.15. ciffereoce(X - Z)
Suppose the value ofX is 1185, then tracing through the algorithm , we get:
X - 1185 Thi,valuei,the
checksum
1 1185/256 - 4.629
2 Rounding down to nearest whole number gives Y - 4 Figure 2.15
3 Multiplying br 256 gives Z - Y • 256 - 1024
4 The difference (X - Z ) gives the checksum: ( ll85 - 1024) - 161
5 This gives the checksum - 16 1
2 COMMUNICATION AND INTERNET TECHNOLOGIES
When a block of data is about to be transmitted, the checksum for the bytes is
first of all calculated. This value is then transmitted with the block of data. At the
recei\'ing end, the checksum is recalculated from the block of data received. This
calculated value is then compared to the checksum transmitted. If they are the
same value, then the data was transmitted without any errors; if the \'alues are
different, then a request is sent for the data to be retransmitted.
Activity 2.5
Cakulate the chedsum for blocks of
datawiththefollowingbytesums
, 148
b 905
c 14S0
d 4095
An I P address can be used instead of typing in the full URL. For example:
hnp://109. 108.158.1
would take you straight to the device corresponding to this address.
c:colgroup>
c:col span•"2" style•"background-color,red">
c:col style•"background-color :yellow">
•
2 COMMUNICATION AND INTERNET TECHNOLOGIES
Some of the <tags> used to create a css file have been shown already in the
HTML example shown abo\·e . The following section shows an example ofhow
these <tags> can be used to create a stylesheet called example2 . css. This is
then used in a web page document. The tags (hl, h3 and p ) all define how the
document will look when this css file (stylesheet) is attached.
Figu ,.2.17
refers to http over i; ecure. It is slower to use https than http; https is usually only
adopted where sensit.i\·e or private data is being transferred across the .internet.
the protocol
used {i.e (o ften the
http) web page)
The web browser translates the web server name into an IP address (see Section
2.4.2) which is part ofthe URL. The HTML code is remrned and is shown as a
correctly formatted page on the computer screen . It is also (X)SSible th at cookies
may be sent from the web browser to the web se rver when the code is executed.
( Note: please refer to Section 8 .3 for more information about the use of cookies.)