Computer Science Coursebook-43-55
Computer Science Coursebook-43-55
''
I
3.01 The memory system
• As a broa d generalisation it can be said that there are two ma in uses of a compu ter system .
The first is to run programs.
t
In t he dis cussion of computer system architecture in Chapter 5 (Section 5.01) you wi ll see
that the si mp lest model consists of a processor with access to a stored program . The history
of compu ting is one of increasing performance. In the context of increasing performance of
t the syste min runn ing programs, the first requirement is for the speed of the processor to
~
increase. However, this potential for improvement can only be realised if the time taken for
~
the proce sso r to access the stored program decreases to match the increased processor
speed . Th e reality so far has been that access speeds have improved but they haven't kept
~ pace fully with the improvement in processor speeds.
I
11 The seco nd main use of a computer system is to store data . Here the major issues with
11
regards t o increasing performance are capacity and cost; access speeds are not so
~
importan t.
;.
The termi no logy used to describe components for storing programs and data is not always
consisten t. One variation is to distinguish between memory as the component which the
processo r can access direc tly and the (fi le-) store used for long-term storage. An alternative is
to disting uish between the primary and t he secondary storage.
~
The mem ory system hierarchy is a useful concept for considering the choice of components
in a mem ory system. Figu re 3.01 uses a si mplified version of a memory system hierarchy to
•
show the trends in the important factors affecting this choice. The factors increase in the
direction of the arrow.
Auxilia ry storage
Figure 3.01 Trends in the factors affecting the cho ice of memory components
Th e indivi dual entries in the Component column are discussed in Sections 3.02 and 3.03 .
Compute r users would really like to have a large amount of primary storage that costs little
and allow s quick access. Th is is not possible; the fastest components cost more and have
limited ca pacity. In practice, the choice made is a compromise.
~
It cou ld b e argued that there is a need for secondary storage because t he use of only primary
storage w ould be far too expensive. However, it is more sensib le simply to recogn ise that
long-term storage of data requires separate dedicated components .
'
I
-------
Cambridge International AS and A level Computer Science
There is another way of categorising memory components. The first category is called
random -access memory (RAM). This is a potentially misleading term because a
programmer does not expect a program to make random decisions about wh ich memory
location should be accessed.
Random -access memory (RAM): volatile memory that can be read from or written to any number of
times
Read-only memory (ROM): non-volatile memory that cannot be written to but can be read from any
number of times
The name has been chosen because such memory can be accessed at any location
independently of which previous location was used (it might have been better ca lled 'd irect-
access memory'). A better description is read-write memory because RAM can be repeatedly
read from or written to. Another distingu ishing characteristic of RAM is that it is volatile which
means that when the computer system is switched off the contents of the memory are lost.
There are two general types of RAM technology. Dynam ic RAM (DRAM) is constructed
from capacitors which leak electricity and therefore need regularly recharging (every few
milliseconds) to maintain the identity of the data stored . Static RAM (SRAM) is constructed
from flip -flops (discussed in Chapter 18 (Section 18.02)) which continue to store data
indefinitely while the computer system is sw itched on.
SRAM provides shorter access time but unfortunately it compares unfavourably with DRAM in
al l other aspects. DRAM is less expensive to make, it can store more bits per chip and despite
the need for recharging it requires less power to operate. So, once more, a compromise is
needed. The norm is for cache memory to be provided by SRAM with the main memory
being constructed from DRAM technology.
The second category of memory component is called read -only memory (ROM). Again
th is name does not give a full picture of the characteristics of this type of component. ROM
shares the random-access or direct-access properties of RAM except that it cannot be written
to. The other important characteristic is that the data in ROM is not lost when the computer
system is switched off; the memory is non-volatile.
ROM has specialised uses invo lving the storage of data or programs that are going to be
used unchanged over and over aga in. ROM may be programmable (PROM) or erasable PROM
(EPROM) or even electrically erasable PROM (EEPROM). These terms re late to the manufacture
and installation of the ROM and do not impact on its basic use in a computer system.
Discussion Point:
Can you find out what memory components are in the computer system you are using and
any details about them such as the type and storage capacity?
r - ----~- --
• ._ • ; r • , Chapter 3: Hardware
Magnetic media
Magnetic media have been t he mainstay of fi lestore technology for a very long time. The
invention of magnetic tape for sound recording pre-dates the inventi_on of the computer by
many yea rs so, not unexpectedly, this technology was the first to be utilised as a storage
device. In contrast the hard disk was invented as a technology specifically for computer
storage, arriving a few years later than the first use of magnetic tape.
For either type of magnetic media the interaction with it is contro lled by a read head and
a write head. A read head uses the basic law of physics that a state of magnetisation will
affect an electrical prope rty; a write head uses the reverse law. Although they are separate
•
devices the t wo heads are comb in ed in a read-wr ite head. The two alternative states of
magnetisation are interpreted as a 1 or 0
A schematic diagram of a hard disk is shown in Figure 3.02. Points to note about the physical
construction are that there is more th an one platter (d isk) and that each platter has a read -
write head for each side. Th e platters spin in un ison . The read-write heads are attached to
act uator arms wh ich allow the heads to move over the surfaces of the platte rs. The motion
of each actuator head is synchronised with the motion of the other heads. A cush ion of air
ensures that a head does not touch a platter surface.
Read -w rite
head Arm
i
Spindle~
l
r
I
Track
Sector
f The logical construction is that data is stored in concentric tracks . Each track consists of a
sequence of bits but these are formatted into sectors where each sector conta ins a defined
r
I
Cambridge International AS and A level Computer Science
number of bytes. The sector becomes the smallest unit of storage. To store a file, a sufficient
number of sectors have to be allocated but these may or may not be adjacent to each other.
As files are created and subsequently deleted or edited the use of the sectors becomes
increasingly fragmented which degrades the performance of the disk. A defragmentation
program can reo rganise the allocation of sectors to files to restore performance. This is
discussed in Chapter 7 (Section 7.03).
A hard drive is considered to be a di rect-access read-write device because any sector can be
chosen for reading or writing. However, the data in a sector has to be read sequentially.
The above account only gives a simpl ified version of hard drive technology. One particular
omission is consideration of how manufacturers can effectively deal with the fact that the
physical length of a track increases from the innermost track to the outermost track . If this
fact is ignored the data storage capacity must be less than it potentially cou ld be. The other
omission is the simple fact that the storage capacity of disk drives has continued to improve
and sizes have continued to shrink. There is every reason to believe that this performance
improvement is due to continue for some time.
There has always been a need for a storage device that can be removed from the computer
system. For large installations an organisation's requirement is normally driven by security
concerns and the need for suitable back-up procedures. For individuals the need may be the
storage of personal data or personally owned programs or simple transfer of data between
computers or between a computer and, for example, a camera. The first technology to
dominate the use by individuals was the floppy disk but this was superseded by optical storage.
Optical media
As with the magnet ic tape medium, optical storage was developed from existing technology
not associated with computing systems. The compact disc (CD) evolved into CD digital audio
(CD-DA) and this became the technology used in the CD -ROM. This was extensively used for
distributing software but was of no value as a replacement for the floppy disk. The read-write
version (CD -RW) which came later provided the needed write functionality. However, the
CD has now given way to the DVD (originally 'digital video disc' but later renamed as 'digital
versatile disc'). The latest and most powerful technology is the Blu -ray disc (BO).
A schematic diagram of an optical disc drive is shown in Figure 3.03. The disc spins and the laser
beam is reflected from a surface which is sandwiched between a substrate and a protective
outer coating. For a CD-ROM, the reflective surface is
Tracking
manufactured with indentations, called 'pits', separated by system
what are referred to as 'lands'. When the disc is being read, (CD-like)
al loy material. When dat a is being written to the disc (the Read-write
laser
'burn' process) the heat generated by the absorption of the (red) ! -- ~ ~= ~ ~~ ~ ~
laser light changes the material to liqu id form. Depend ing on
the intensity of the laser light the material reverts to either a variab le
crystalline or an amorphous solid form when it cools. When spheri ca l
Read signal detecto r aberrat io n
the disc is read, the laser light is reflected from the crystalline correction ~~~
solid but not from the amorphous so lid allowing the coding
of a 1 or 0. Figure 3.03 A schematic drawing of an optica l disc drive
-- -------
r
~ -, Chapter 3: Hardware
~
Wh ile the disc is spinning the optica l head that directs the laser beam is made to move so
that the point of contact of the laser beam with the disc follows a sin gle spiral path from the
centre of the disc to the periphery. Despite there only being this one path the formatting of
t he dat a into sectors allows the disc to be used as a direct-access device just as is the case for
a magnetic hard disk.
Another similarity with magnetic disk technology is t hat the storage capacity is dependent on how
close together individu al physica l representations of a binary digit can get. There are two aspects
govern ing this for an optical disc. The fi rst is that if the disc is spi nning at constant revolutions per
second the outer part of the disc travels faster than the inner part. Early technology counteracted
this by spinning at a constantly changing speed keeping the bit density constant along the spiral
path . The second is that t he wavelength of the light controls how well t he light ca n be focused; the
shorter t he wavelength the better the focus. The original infrared diode laser used in a CD-ROM
has much longer wavelength than the red laser light used in a DVD. The more recent ly used blue
laser light has an even shorter wavelength. This change in wavelength is one of t he reasons for t he
improvements in the storage capacity of the modern technology.
Solid-state media
Despite the continued improvement in optical technology there is now a powerful
competitor in solid-state storage. The basis for th is is 'flash' m emory which is often said to
be a form of EE PROM but whe re the programmable aspect is part of th e normal use. Flash
mem ory is a sem icond ucto r technology w ith no moving parts. The circui t s consist of arrays
of t ransistors acting as memory cells . The most frequently used technology is called 'NANO'
because the basic circuitry resem bles that of a NANO logic gate (see Section 4.03) with the
memory cells connected in se ries. The special feature is t hat blocks of memory cells can
have th eir con tents erase d all at once 'in a flash'. Fu rthermo re, before data can be written to
a block of cells in the memory the data in the block first has to be erased. When data is read,
a whole block of data has to be read in one operation.
•
The technology can be used for 'solid-state' drives, wh ich can replace hard disk drives. The
more frequent use is either in a memory card or in a USB flash drive. In th e latter case the
flash memory is incorporated in a device w ith the memory chip connected to a st andard USB
connector. This is currently the tech nology of choice for removab le data storage but how
long t his wi ll remain so is very uncert ain with alternative technologies such as phase-change
random access memory (PRAM) already under development.
Consider first the options available for the storage device inside a laptop computer. Create a
table showing cost, storage capacity and access speed for typical examp les. Then consider
the options available for peripheral storage devices. Create a simi lar tab le for these.
Can you identify which technologies remain viable and which ones are becoming
uncompetitive? Are there any new technologies likely to come into common use?
tones but a printer at any position on a page could only print black or nothing. The solution
to this was halftoning. This technique approximated a grey tone by printing an array of black
dots; varying the size of the dots changed the tone displayed. The technique, of course, relies
on the limitations of the human eye which does not register the individual dots if they are
suffic iently small.
Computer mouse
A significant step forward came with the introdu ction of graphica l user interfaces (GU ls) as
standard features for microcomputer systems in the 1980s. Th e screen technology remained
the same but the functionality was completely transformed by the arrival of screen w indows
and icons. To use the GUI effectively, the user needed a point ing device. The computer
mouse was introduced for th is purpose. Th e screen became not just an output device but
also an input device activated by a mouse click .
There are two aspects to co mputer mouse technology. The first is the behaviour instigated
by a button click which needs no further discussion; the second is t he operation of t he
mou se in controll ing a screen cursor. The important point to emphasise here is that a mouse
has no knowledge of an absolute position; all it can do is
al low a rela ti ve movement to be recorded so that it can
infl uence the screen cursor position.
More recently the tracker ball mouse was phased out and the optical mouse was introduced . This
technology dispenses with t he mechanical aspects associated w ith the movement of a rubber
ball. The mouse shines a light beam from a light emitting diode down onto the surface the mouse
l is resting on . This light is reflected back on to a sensor fitted to the underside of the mouse. As the
mouse is moved along the surface the sensor acts like a camera taking successive images of the
surface. Image processing software then interprets these images to establish the movement that
has taken place and this data is transmitted to the computer as before.
Screen display
We can now consider the technology associated with the creation of a screen display. Chapter 1
(Section 1.04) described how an image could be stored as a bitmap built up from pixels. Screen
displays are also based on the pixel concept but with one major difference: a screen pixel
consists of three sub-pixe ls t ypica lly one each for red, green and blue. Varying the level of light
emitted from the individual sub-pixels allows a full range of colours to be displayed.
There have been a number of very different technologies used to create a pixe l. In the original
cathode ray tube (CRT) techno logy, there is no individual component for a pixel. Th e inner
surface of the screen is covered with phosphor, which is a material that em its light when
irradiated. An ind ividual pixel is created by cont rolling the direction of the electron beam
irradiating the phosphor. Th is is mod ified for colour disp lays whe re individual red, green and
blue phosphors are arranged so as to create an array of pixels.
Phosp hors are also used in one of the major flat-screen technologies, the plasma screen .
Th ere is now a construction based on in dividual cells constituting a matrix of pixels. Each
cell contains plasma and a phosphor. When an electri cal cha rge is applied to the plasma
•
it releases radiation that hits the phosphor and causes light emission. Ea ch pixel or, more
accurate ly, each sub-pixel is a light source. The sub-pixel emi t s one of red, green or blue light.
Liquid-crystal display (LCD): a screen back-lit by light-emitting diodes and with liquid crystal cells
sandwiched between polarisers
In the flat-screen technology that is most used at present, the pixel is not a light sou rce.
The liquid-crystal display (LCD) screen has ind ividua l cells contain ing a liquid crystal to
create t he pixel matrix but these do not
emit light. The pixel matrix is illuminated
by back-lighting and each pixe l can affect
the transm ission of this light to cause the Polarizer
on-screen display. A typical arrangement is
Colour Filter
shown in Figure 3.05.
Colour Filter glass
The back-lighting is usually provided by
light-emitting diodes (LEDs). The important
T
feature is the use of polarised light directed
towards the pixel matrix and the use of a
further polariser between the pixel matrix TFT Glass
and the screen. If a voltage is applied to an Polarizer
individ ual pixel cel l the alignment of the / , I I I I I I I \ \ \ \ \
liquid crystal molecules is affected and in
turn this can change the polarisation of the Backlight
light and therefore affect what is displayed on
the screen . There are a number of different Figure 3.05 The components of a liquid-crystal display screen
-------
Cambridge International AS and A level Computer Science
technologies but the principle of their functioning is the same and colour disp lays use red, green
and blue combinations as before.
More recently, a different tech nology has been introduced. This is based on t he use of an
organic light-emitti ng diode (OLED) to create the pixel. The OLEO is used direct ly as a light
source so this tec hnology requires no back-lighting.
Touch screens
As we ll as provi ding improved display capability, fl at-screen tech nology has allowed a new
mechanism for interaction wi t h t he display. Touch-screen techno logy is now a major fea t ure
of a who le range of co mputer-based products.
Th e modern version of a to uch-sen sitive screen has t he layers of technology provid ing the
disp lay wi t h ext ra layers of tech nology added im med iately be neath the surface of t he screen .
There have been t wo approaches used. The first is t he resistive t ouch screen. This type
has t wo layers separated by a t hi n space beneath the screen su rface . The screen is not rigid
so w hen a fi nger presses on to the screen the pressu re moves the top most of t hese two
se para ted layers so th at it ma kes co ntact wi t h t he lower layer. The po int of co ntact creates a
voltage divider in the horizontal and vert ical directions . These allow the pos ition of the po int
of con tact to be transm itted to t he processor.
The second tec hnology is t he capacitive touch screen. This does not requ ire a soft
scree n but in stead makes use of th e fact that a finger touchi ng a glass scree n can cause
a capacitance chan ge in a circ uit compo nent im mediate ly below t he scree n. The most
effect ive tec hnology is projective capacitive touch (PCT) with mut ual capacitance. This has
a circu it beneath t he screen which contains an array of capacitors. This enab les multi -touch
techn ology, whi ch al lows more functionali ty t han just po int ing at one location on a screen .
Resistive touch screen: a flexible surface which causes contact between electrically resistive layers
beneath when touched
Capacitive touch screen: a rigid surface above a co nductive layer which undergoes a change in
electrical state when a finger touches the screen
Discussion Point:
Investigate which flat-screen technologies are used in any computer, laptop, tablet or mobile/
cell phone that you use. Discuss the benefits and drawbacks associated with their use.
~ Chapter 3: Hardware
'
technology underpinning all of these devices is the same assuming that there are actual
physical keys to be used.
When the keyboard is being used to input text it appears as though a key press immediately
transfers the appropriate character to the computer screen but this is an illusion. The key
press has to be converted to a character code which is transmitted to the processor. The
processor, under the control of the operating system, ensures that the text character is
displayed on the screen. The same process takes place if the keyboard is used to initiate
some action, perhaps by using a shortcut key combination, except that the processor has to
respond by taking the requested action.
To achieve this functional ity the keyboard has electrical circuitry together with its own
microprocessor and a ROM chip. The keys are positioned above a key matrix which consists
of a set of rows of w ires and another set of columns of wires. Pressing a key causes contact
at a specific intersection . The microprocessor continuously tests to see if any electrical
circuit involving a row wire and a column wire has become closed. When the microprocessor
recognises that a circuit has become closed , it can identify the particular intersection that
is causing this. It then uses data stored in the ROM to create the appropriate character code
relating to the key associated with that intersection and sends this code to the processor.
The same principles apply if t wo keys are pressed simultaneously.
Ink is supplied to the printhead from one or more ink cartridges. Often the printhead is part
of the cartridge. For black and white printing only one cartridge is required but for colour
printing more are needed . The simp lest technology for colour printing uses three colour
cartridges (one for each of the subtractive primaries: cyan , magenta and yellow) in addition
to the black cartridge . Suitable positioning of combinations of overlapping droplets in
principle allows any colour to be created . Good quality printing requires a printing resolution
of several hundred dots per inch which is achievable because of the large number and small
size of the nozzles. The number of dots per inch is defined by the printhead geometry and
cannot be changed but the number of dots per pixel can be dictated by the controlling
software. Increasing the number gives better colour definition for the pixel but the pixel size is
~-~~~~~--~--~~~~~~
increased giving poorer resolution for the image. Better resolution can only be achieved with
poorer colour definition .
Laser printer
The alternative technology is the laser printer. Laser printers have always been more
expensive to buy and used to offer much higher-quality printing but the comparison is no
longer so clear cut.
A schematic diagram of the workings of a laser printer is shown in Figure 3.06. The operation
can be summarised as follows :
6
image has been created .
The drum is coated with a charged toner which
•Photoreceptor
~Drum
only sticks to positions where the drum has been ~i1t"~~~-~- ~-~~-- .A=ssembly
discharged.
7 The drum rolls over a sheet of paper which is initially PAPER TRAY
given an electric charge.
8 The sheet of paper is discharged and then is passed
through heated rollers to fuse the toner particles and Figure 3.06 A schematic diagram of a laser printer
seal the image on the paper surface.
9 The drum is discharged before the process starts again for the next page.
The above sequence represents black and white printing. For colour printing, separate toners
are requ ired for the colours and the process has to take place for each colour. Although the
technology is completely different the logical aspect of the printing is the same as that for
in kjet printing. Colours are created from cyan, magenta, yellow and black. The technology
produces dots; quality depends on the number of dots per inch and software can control the
number of dots per pixel.
Engineers and designers working in manufacturing are potential users of graph plotters. They
are also potential users of the 3D printer. The name could be said to be a little misleading but
its meaning is genera lly understood . It is a device that offers an alternative technology for
comp uter-a ided manufacture (CAM).
The original concept was that the starting point is a 3D design create·d in a suitable computer-
aided design (CAD) package. The design is split into layers. The data for the first layer is
transmitted to the 3D printer. Rather than using ink to draw the
layer, the 3D printer uses a nozzle to squirt material on to the
printer bed to create a physical layer to match the design. Th is
process is repeated for success ive layers. When the whole object
has been formed it has to be cured in some way to ensure that
•
the layers are, in effect, welded together and the material has
been converted to the form required for the finished product.
For input, a microphone is needed. This is a device that has a diaphragm, a flexi ble material
wh ich is caused to vibrate by an incoming sound. If the diaphragm is connected to suitable
circuitry the vibration can cause a change in an electrical signa l. A condense r microphone
uses capacitance change as the mechanism; an alternative is to use a piezoelectric crystal.
The electrical signal has to be converted to a digital signal by an analogue-to-digital
converter before it can be processed by a sound (a udio) card inside the co mp uter.
For output, a loudspeaker or speaker is needed. This is involved in what is effectively the
reverse process to that for input. The computer sound card produces a digital signal which
is converted to analogue by a digital-to-a nalogue converter. Th e anal ogue signa l is fed to
the speaker. In the traditional technology the current flows through a coil suspended within
-
'
Cambridge International AS and A level Computer Science
the magnetic field provided by a permanent magnet in the speaker. As the d irection of the
curre nt keeps reversing, the coil moves backwards and forwards. This movement controls
the movement of a diaphragm which causes sound to be created .
• Primary storage is main memory, consisting of RAM (DRAM or SRAM) and ROM.
• Output devices include screens (CRT, plasma , LCD, OLED), printers (inkjet, laser and 3D), plotters and speakers.
• Touch screens (capacitive or resistive) are used for both input and output.
Exam-style Questions
1 a A typ ica l computer wil l have RAM and ROM.
iii RAM may be either DRAM or SRAM. Explain t he difference between these. [2]
For each t ype of storage identify one feature of the basic internal operation wh ich
is different from that of the other two types. [3]
ii For two of the three types of storage identify two similarities in the basic internal operation . [2]
2 a Pressing a key on a co mp ut er keyboard can cause a character to be displayed on the computer screen .
Identify four aspects of t he basic internal operation of a keyboard that makes this happen. (4]
ii Describe an alternative method for a user to enter some text into a computer system. [2]
Describe two differences between how an in kjet printe r wo rks and how a laser printer wo rks. [4]
ii Id entify two sim ilariti es in the logical approach used in these two types of printer. [2]