0% found this document useful (0 votes)
63 views

Cambridge-Igcse-Computer-Science Fit

This document discusses hexadecimal numbering systems and their uses in computing. It provides examples of converting URLs to hexadecimal and comparing machine code expressed in binary versus hexadecimal. Hexadecimal makes machine and assembly code easier to write than binary by avoiding long strings of 1s and 0s. It is also less error prone than binary.
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
0% found this document useful (0 votes)
63 views

Cambridge-Igcse-Computer-Science Fit

This document discusses hexadecimal numbering systems and their uses in computing. It provides examples of converting URLs to hexadecimal and comparing machine code expressed in binary versus hexadecimal. Hexadecimal makes machine and assembly code easier to write than binary by avoiding long strings of 1s and 0s. It is also less error prone than binary.
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/ 13

1.

6 Use of the hexadecimal system

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.

1.6.5 Assembly code and machine code


Computer memory can be referred to directly using machine code or assembly
code. This can have many advantages to program developers or when carrying
out troubleshooting.
Machine code and assembly code are co\·ered in much more derail in Chapter 7;
here we are simply interested in how hexadecimal fits into the picrnre.
Using hexadecimal makes it much easier, faster and less error prone to write
code compared to binary. Using true machine code (which uses binary ) is \·ery
cumbersome and it takes a long time to kL-y in the values. It is also very easy to
mistype the digits in a 'sea of ls and Os'. Here is a simple example:
STO FFA4 (assembly code )

A5E4 FFA4 (machine code using hexadecimal \lalu cs)

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.

2.2 Data transmission


Data transmission can be either over a short distance ( for example, from
co mputer to printer) or over longer distances (for example, over a telephone
network ). Esse ntiall y, three factors need to be considered when transmitting
data (each factor has to be agreed by both sender a nd receiver for this to work
without error):
• the direction of the data transmission (i.e. in one direction only or in both
directions)
• the method of transmission (how many bits arc sent at the same time )
• the method of synchronisation between the two devices.

2.2.1 Simplex, half-duplex and full-duplex ©


S IMPLEX DATA TRANSMISSION is in one direction only (i.e. from sender to receiver ).
Example: data being sent from a computer to a printer.
HALF· DUPLEX DATA TRANSMISSION is in both directions but not at the same time
(i.e. data can be sent from 'A' to 'B' or from 'B' to 'A' along the same line, but
not at the same time ). Example: a phone conversation between two people where
only one person speaks a t a time .
FULL·DUPLEX DATA TRANSM ISSION is in bothdirectiom sim11/taneously (i.e. data
can be sent from 'A' to ' B' and from 'B' to 'A' along the same line, both at the
same time) . Example: broadband connection on a phone line.

2.2.2 Serial and parallel data transmission ©


SERIAL DATA TRANSMISSION is when data is sent, 011e bit at t1 time, over t1 single
wireorcht1nnel (bits arc se nt one after the other in a single stream).

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.

2.2.3 Asynchronous and synchronous data transmission


AsYNCH RONOUS DATA T RANSMISSION refers to data being transmitted in an agreed
bit pattern. Data bits ( ls and Os) arc grouped together and sent with CONTROL
2 COMMUNICATION AND INTERNET TECHNOLOGIES

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).

2.2.4 Un iversa l Seria l Bus (USB)


1l1e UNIVERSAL SERIAL Bus (USB) is an asynchronous serial data transmission
method. It has quickly become the standard method for transferring data between
a computer and a number of devices. Essentially, the USB cable consists of:
• a four-wire shielded cable
• two of the wires arc used for power and the earth
• two of the wires are used in the data transmission.
When a de\'ice is plugged into a computer using one of the USB ports:
• the computer automatically detects that a device is present (this is due to a
small change in the \'oltagc level on the data signal wires in the cable ) Figu,. 2.5 use cable
• the de\'ice is automatically recognised, and the appropriate DEVICE DRIVER is
loaded up so that computer and de\'ice can communicate effectively
• if a new device is detected, the computer will look for the de\'ice driver which
matches the dt.·\'ice; if this is not available, the user is prompted to download
the appropriate software.
Even though the USB system has become the industrial standard, there arc still a
number ofbenefits (/ ) and drawbacks (x) to using this system:

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

2.3 Error-checking methods


Following data transmission, there is always the risk that the data has been
corrupted or changed in some way. This can occur whether data is being
transmitted over short distances or o\'er long distances.
Checking for errors is important since computers aren't able to check that text
is correct; they can only recognise whether a word is in their built-in dictionary or
not. Look at the following text:
Can you racd tihs?
' I cnduo't bvleicc taht I culod aulaclty uesdtannrd waht I was rdnaieg.
Unisg the icndeblirc pweor of the hmuan mnid, aocdcrnig to rscccrah
at Cmabridgc Uincrvtisy, it dseno't mttaer in waht oderr the ltercts in a
wrod are, the olny irpoamtnt tihng is taht the frsit and lsat ltteer be in the
rhgit pclae. The rsct can be a raotl mscs and you can sit!] racd it whoutit a
pbocrlm.
Tihs is bucscac the huamn mnid dcos not racd crvcy lttccr by istlcf, but
the wrod as a wlohc.
Aaznmig, huh? Yeah and I awlyas tghhuot slclinpg was ipmorantt! Sec if
yuor fdrcins can racd tihs too'
(From an unknown source at Cambridge University)
Whilst you probably had little problem understanding this text, a computer
would be unable to make any sense of it.
This is why error checking is such an important part of computer technology.
This section considers a number of ways tliat can be used to check for errors so
that you don't end up with text as shown in the example above!
A number of methods exist which can detect errors and , in some cases, actually
correc t tl1e error. The methods covered in tl1is section arc :

• parity checking
• automatic repeat request (ARQ)
• checksum
• echo checking.

2.3.1 Par ity check ing @


PARITY C H ECKING is one method used to check whether data has been changed or
corrupted following transmission from one device or medium to anotl1er device
or medium.
A byte of data, for example, is allocated a PA RITY BIT. This is allocated before
transmission takes place. Systems that use EVEN PA RITY ha\·e an even number of
1-bits; systems that use ODD PA RITY have an odd number of 1-bits.
Consider tl1e following byte:

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

Before data is transferred, an agreement is made between sender and recei\·er


regarding which of the two types of parity are used. This is an example of a

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:

Figu re2 .11

This byte could reach the destination as:

Figure2.12

Figu re2 .13

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.2 Automatic Repeat Request (ARO)


Aurm,IATIC REPEAT REQuEIT (ARQ) is another method used to check whether
data has been correctly transmitted.
It uses an ACKNOWLEDGEMENT (a message sent by the receiver indicating that
data has been received correctly) and n1,rnour (this is the rime allowed to elapse
before an acknowledgement is recei\·ed ).
If an acknowledgement isn't sent back to the sender before rime out occurs,
then the message is automatically resent.

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

2.3.4 Echo check


With ECHO CHECK, when data is sent to another device, this data is sent back
again to the sender. The sender compares the two sets of data to check if any
errors occurred during the transmission process.
As you will ha\'e no doubt worked out, this isn't \'ery reliable. If the two sets
of data are different, it isn't known whether the error occurred when sending
the data in the first place, or if the error occurred when sending the data back
for checking!
H owe\·er, if no errors occurred then it is another way to check that the data
was transmitted correctly.

2.4 Internet t echno logies


TI1e internet is a world -,vide system of computer nenvorks and computers. All
computers attached to the internet can communicate with each other providing
a number of rules and protocols are adhered to.

2.4.1 Internet Service Provider (ISP)


Each user makes use of an INTERNET SERVICE PROVIDER ( ISP ); tl1ese are
companies that pro\'ide the user with access to the internet. A monthly fee is
usually charged for tills service. The ISP will set up a user account which will
contain a username and a password; most ISPs also gi,·e the user an email address.
Before ISPs became crnrunon in the 1990s, internet access was usually limited
to users who were part of a miiversity or a gO\·ernment agency.

2.4.2 Internet Protocol (IP) Address


Each device on the internet is gi\'en a uniqu e address known as tl1e INI"ERNIIT
PROTOCOL ( IP ) ADDRESS. This is a 32 -bit number which is usually written in the
form:
109.108.158.1
A home computer is given an IP address when it connects to the internet. This is
assigned by the ISP and is unique for that particular internet session. The only IP
addresses tl1at remain fairly unchanged are web ser\'ers.
2.4 Internet technologies

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.

IP addresses and MAC add resses


You will recall the term MEDIA ACCESS CONrROL (MAC) ADDRESS from Chapter l.
This is a unigue number that identifies a device connected to the internet. So
what is the difference between an IP address and a ,\.IAC address? The IP address
gives the location of a device on the internet, whereas the MAC address identifies
the device connected to the internet.
You can think of the IP address as the address of the house you live in ( it will
have some unique way of identifying it, such as a JX)St or zip code). Using this
example, the MAC address can be thought of as a way of uniquely identifying
each person living in that house. It is possible to move house (so your IP address
will change) but the same people will be living in the new house ( so their MAC
addresses will remain unchanged ).

2.4.3 HyperText Mark-up Language (HTML)


H YPERTEXT MARK-UP LANGUAGE (H TML) is used when writing and
de\·eloping web pages. HTML isn't a programming language but is simply a
mark-up language. A mark-up language is used in the processing, definition and
presentation of text (for example, specifying the colour of the text).
HTML uses <tags> which are used to bracket a piece of code; for example,
<td> starts a standard cell in an H TML table, and </td> ends it. 'Nhatever is
between the two tags has been defined. H ere is a short section of H TML code:
c:tr>
c:td>c:hl>Small carc:/hJ>
c:hl>Used car salesc:/hl>
c:h2>Ca rs from $500c:/h2>
c: br >c:h2>Cas h sales onlyc:/h2>c:/td>c:/br>
c:/tr>

c:colgroup>
c:col span•"2" style•"background-color,red">
c:col style•"background-color :yellow">

HTML st ru ct ure and prese ntati on


\\'hen writing H TML code, it is very imixirtant to realise that there is a difference
between the structure and the presentation.
Sr&ucruRE is the essential part of the H TML document; it includes the
se mantics (meaning ) and strucrnral mark-up of the document.
PRESENTATION is the style of the document; i.e. how the document will look
(or even sound ifit includes multin1edia elements).
These two features must be kept separate throughout the designing of a
web page. At the end of the design process, the author should have an HTML
document (which contains the structure and the actual content) and a separate
css (CASCAD ING STYLE SH EIIT) file. The css file will contain t.·verything to control
the acrnal presentation ofthe web page.


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.

~r'"--"'"-"'f<;io,, ..... -r,.;.i~E,:1.,..,.-,......


lcalo.aia!~uark
(eolo"'f:r::~~ifji;;7rlf:

Figu ,.2.16 Thisshow,:howlhecssfile (examp'el.css)isc,eatedfllf useinthe


documentbelow;h1.h3andphaveall beendefined. sowhenthefileisattached
below.awebbmwserknow,:howtodisplaythi,webpage

Figu ,.2.17

2.4.4 Hypertext transfer protocol (http)


HYPERTEXT TRANSFER PROTOCOL ( Hrrr ) is a se t of rules th at must be obeyed
when transferring files across the internet. \Vhen some form of security ( e.g. SSL
1

~;:~fi:i::~:: :::7~ti;~~~~:es:~las ::l ~;l:s s~: : : :~:~ ~ : : ~::~:s at:e~t1:::p

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.

2.4.5 Web browsers


A WBB BROWSBR is software which allows a user to display a web page on their
computer screen . Web browsers interpret or translate the HTML code from
websites and show the result of the translation. This can often be in the form of
videos, images or sound . Most web browsers share the following features:
• they have a H OME page
• they have the ability to store a user's fu\·ourite websites/pages
• they keep a history of the websites vis ited by the user
• they give the ability to go backward and forward to websites opened.
2.4 Internet technologies

Users can either dick on a link, such as \.\'W'\','.hoddcreducation.co.uk/igcse or


they can type in the uniform resource locator (U RL ) manually.
The web browser will break up the URL into three parts:

http:/ /www.hoddereducation.eo. uk/i gcsc_comp11ter_scien ce

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.)

You might also like