CS9618 Camb 3 Hardware
CS9618 Camb 3 Hardware
Chapter 3:
Hardware
Learning objectives
By the end of this chapter you should be able to:
■ show understanding of the need for input, output, primary memory and secondary (including removable) storage
■ show understanding of embedded systems
■ describe the principal operations of hardware devices
■ show understanding of the use of buffers
■ explain the differences between Random Access Memory (RAM) and Read Only Memory (ROM)
■ explain the differences between Static RAM (SRAM) and Dynamic RAM (DRAM)
■ explain the difference between Programmable ROM (PROM), Erasable Programmable ROM (EPROM) and Electrically
Erasable Programmable ROM (EEPROM).
Part 1: Chapter 3: Hardware
Data storage
The terminology used in the computer literature to describe components for storing data is
not always consistent. One variation is to distinguish between memory as the component
which the processor can access directly and the (file-) store used for long-term storage. An
alternative is to describe the memory as primary storage and the remainder as secondary
storage.
Whatever names are used, the memory hierarchy is a useful concept when we choose the
components to be used in a computer system for data storage. Figure 3.01 shows a version
of this hierarchy that includes the trends in the important factors that affect our choice. The
factors increase in the direction of the arrow. The register is a component within the CPU that
has the fastest access speed. The cache memory has faster access speed than that of main
memory, particularly when the cache is a built-in part of the CPU chip.
51
Main memory
Auxiliary storage
Figure 3.01 Trends in the factors affecting the choice of memory components
Computer users would really like to have a large amount of primary storage that costs little
and allows quick access. This is not possible; the fastest components cost more and have
limited capacity. In practice, the choice made is a compromise. It could be argued that there
is a need for secondary storage because the use of primary storage alone would be far too
expensive. However, it is more sensible simply to recognise that long-term storage of data
requires separate dedicated components.
An alternative approach when choosing a storage medium or device is to consider which of
the following applies:
•• it is an integral part of the system, to which the user cannot normally get access – the
options here are a hard disk or solid-state drive
•• it is an individual item that can be inserted into a drive which is part of the computer system or
which can be connected to it – could be a floppy disk, optical disc or magnetic tape cartridge
Cambridge International AS & A Level Computer Science
•• it is a peripheral device that can be connected to the system when needed – there are
many possibilities here including a hard drive, a memory stick or a memory card
•• it is a portable item that the user can carry around with them for attaching to different
systems; possibly used for personal backup – usually a flash memory stick nowadays but
a floppy disk or optical disc is an alternative
•• it is remote from the system, possibly accessible via a network connection; often used
for backup – cloud storage is one option, but others are magnetic tape, RAID (Redundant
Arrays of Independent Disks) or SAN (Storage-Area Network).
Data output
For data output from a computer system the following options are available:
•• screen display
•• hardcopy using a printer or plotter
•• virtual headset display
•• a speaker
•• writing to any of the data storage devices described earlier
•• transmission on a network link.
Data input
For the input of data to a computer system the following are among the options available:
•• keyboard or keypad entry by a user
52
•• user interaction with a screen using screen icons or menus; possibly using a pointing
device and possibly involving the use of a touch screen
•• a user using a game controller
•• a user using a scanner
•• a user using a microphone in tandem with voice recognition software
•• reading from any of the storage devices described earlier
•• transmission on a network link.
Note that input and output in a computer system are controlled by an I/O sub-system. This
handles data input to or output from the computer system as well as data read from or
written to the internal hard disk or solid-state drive.
The major advantage of embedded systems is that they are special-purpose; possibly
performing only a single function. This function is likely to be required in a wide variety
of different manufactured products. Mass production of an embedded system brings
economies of scale: the more we make, the cheaper they become. During the early years of
their use, embedded systems had the disadvantage that programming was difficult because
the memory space available to store a program was limited. For this reason, programs
had to be short. In addition, there was the disadvantage that if errors were found following
installation then new chips had to be manufactured and used to replace the faulty ones.
In modern systems these problems are less likely, but a new problem has developed.
Embedded systems are now part of what is called the IoT (Internet of Things). More and more
embedded systems are being installed with a network connection. This can greatly improve
the usefulness of a product, for example by providing information and updates to the owner.
However, this accessibility via a network is a security concern. Embedded systems are less
likely to be protected against unlawful actions than general-purpose systems.
Discussion Point:
How might useful information from an embedded system installed in a domestic appliance
be communicated over a network to the owner of the appliance?
Random-access memory (RAM): volatile memory that can be read from or written to any number of times 53
Read-only memory (ROM): non-volatile memory that cannot be written to but can be read from any
number of times
The components that make up the main memory of a general-purpose computer system
are called random-access memory (RAM). It is called RAM because any byte of data stored
can be accessed without affecting the other bytes stored. Because of this it might have been
better called ‘direct-access memory’. Another possible name would be ‘read–write memory’
because RAM can be repeatedly read from or written to. A key feature 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. Dynamic RAM (DRAM) is constructed
from capacitors that 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 that continue to store data indefinitely while the computer system is switched
on. The circuits and logic for flip-flops are discussed in Chapter 19 (Section 19.02)).
The major difference between the two types of RAM is that DRAM requires fewer electronic
components per bit stored. This means DRAM is cheaper to make and has a higher density for
data storage. The major advantage of SRAM is that it provides shorter access time. In a general-
purpose computer system, it is normal practice for main memory to be constructed from
DRAM but for cache memory to be provided by SRAM because of the faster access speed. By
contrast, embedded systems that need RAM with only limited capacity often use SRAM for this.
The second category of memory component is called read-only memory (ROM). Again,
this 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. However, as the name implies it
Cambridge International AS & A Level Computer Science
cannot be written to when in use within the computer system. The other key feature is that the
data in ROM is not lost when the computer system is switched off; the memory is non-volatile.
TIP
The word volatile has several meanings. Try to remember that volatile memory no longer stores
data when the system is switched off.
ROM has specialised uses for the storage of data or programs that are going to be used
unchanged over and over again. In a general-purpose system the most important use is in
storing the bootstrap program. This is a program that runs immediately when a system is
switched on. There are a number of other uses for ROM in such a system, some of which we
will see later in this book. In addition, ROM is used in many embedded systems.
There are four different types of ROM.
1 In the simplest type of ROM the programs or data are installed as part of the manufacturing
process. If different contents are needed the chip must be replaced.
2 An alternative is Programmable ROM (PROM). The manufacturer of the chip supplies chips
to a system builder. The system builder installs the program or data into the chips. This
allows the system builder to test some samples of programmed chip before committing the
whole batch to be programmed. As with the simplest type of ROM, the program or data once
installed cannot be changed.
3 A more flexible type of ROM is Erasable PROM (EPROM). The installed data or program can be
54 erased (using ultraviolet light) and new data or a new program can be installed. However, this
reprogramming usually requires the chip to be removed from the circuit.
4 The most flexible type of ROM is Electrically Erasable PROM (EEPROM). As the name suggests,
this works in a similar way to EPROM, except an electrical signal can be used to remove
existing data. This has the major advantage that the chip can remain in the circuit while the
contents are changed. However, the chip is still used as read-only.
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?
Buffers
Whenever data has to be transferred from one part of a computer system to another, a
problem occurs if the data can be sent more quickly than it can be received. The solution to
the problem is to use a buffer. Data enters a buffer before being transmitted to its destination.
The buffer functions as a queue so the data emerges in the order that it has entered the buffer.
Typically, the buffer is created in the computer memory.
KEY TERM
Buffer: a temporary storage created for data transmitted from one part of the system to another which
functions as a queue
Question 3.01
Can you think of examples of data transfer that would need a buffer?
Part 1: Chapter 3: Hardware
Magnetic media
Magnetic media have been the mainstay of filestore technology for a very long time. The
invention of magnetic tape for sound recording pre-dates the invention of the computer by
many years. As a result, magnetic tape was the first storage device. In contrast, the hard disk
was specifically invented for computer storage. The hard disk also used magnetisation to
write data, and arrived a few years after magnetic tape was first used for storage.
For either type of magnetic medium the interaction with it is controlled 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 property; a write head uses the reverse law. Although they are separate
devices the two heads are combined in a read–write 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 55
construction are:
•• there is more than one platter (disk)
•• each platter has a read–write head for each side
•• the platters spin in unison (all together and at the same speed)
•• the read–write heads are attached to actuator arms which allow the heads to move over
the surfaces of the platters
•• the motion of each read–write head is synchronised with the motion of the other heads
•• a cushion of air ensures that a head does not touch a platter surface.
Read–write Actuator
head arm
Spindle
Platter
Block
Cylinder
Track
Sector
Data are stored in concentric tracks (tracks sharing the same centre). Each track consists of a
sequence of bits. These are formatted into sectors where each sector contains a defined number
of bytes. The sector becomes the smallest unit of storage. Because the movement of the heads is
synchronised, the same tracks on different disks can have related data stored on them. These are
accessible by just one movement of the head. The collection of tracks is referred to as a ‘cylinder’.
To store a file, a sufficient number of sectors have to be allocated but these might or might
not be next 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 reorganise the allocation of sectors to files to restore
performance. This is discussed in Chapter 8 (Section 8.03).
A hard drive is considered to be a direct-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 (in order).
This is only a simplified explanation of hard drive technology. There are several issues that
arise when making hard drives. For example, the length of a track on the disk gets larger as
you move from centre to edge. Manufacturers have to take account of this in their designs,
otherwise the data storage capacity will be less than it potentially might be.
Optical media
As with the magnetic 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
56
version (CD-RW) which came later finally meant CD was a complete alternative to floppy disks.
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 (BD).
A schematic diagram of a design for an optical disc drive is shown in Figure 3.03. This is
equipped to read a CD with infrared laser light of wavelength 780 nm or a DVD with red laser
light of wavelength 680 nm.
Tracking
Tracking laser
system
(780 nm)
(CD-like)
Tracking
detector Beam splitter
Read–write
laser
(red)
Dichroic mirror Objective
lens and
Signal collection lens optical
correction
Read signal detector
We can ignore the finer details of the construction of the drive and concentrate on the
principles of how it operates. The important features for the process of reading data from the
disc are as follows.
•• The optical disc has one spiral track running from the inner extreme of the surface to the
outer edge.
•• During operation, the disc spins.
•• Simultaneously the laser moves across ensuring that it is continuously focused on the
spiral track.
•• The track on the surface of the disc has what are referred to as ‘pits’ and ‘lands’.
•• The laser beam is reflected from the surface of the disc.
•• The difference between the reflection from a pit compared to that from a land can be
detected.
•• This difference in the intensity of the light the detector receives can be interpreted as
either a 1 or a 0 to allow a binary code to be read from the disc.
For CD-RW and DVD-RW technologies, the reflective surface is a special alloy material. When
data is being written to the disc (the ‘burn’ process) the heat generated by the absorption
of the laser light changes the material to liquid form. Depending on the intensity of the laser
light the material reverts to either a crystalline or an amorphous solid form when it cools.
When the disc is read, the laser light is reflected from the crystalline solid but not from the
amorphous solid, allowing the coding of a 1 or 0.
Despite there being only one track the disc functions as a direct-access device because the
laser can move forwards or backwards. The data is formatted into sectors along the track in a 57
similar way to the formatting of a magnetic hard disk.
Another similarity with magnetic disk technology is that the storage capacity is dependent
on how close together individual physical representations of a binary digit can get. There
are two aspects governing this for an optical disc. The speed of rotation is one but the most
important is the wavelength of the light. Shorter wavelength light can be better focused. This
is why a DVD can store more than a CD but much less than a Blu-ray disc.
Solid-state media
Despite the continued improvement in optical technology there is now a powerful
competitor in the form of solid-state storage. The basis for this is ‘flash’ memory, which is a
semiconductor technology with no moving parts. The circuits consist of arrays of transistors
acting as memory cells. The most frequently used technology is called ‘NAND’ because the
basic circuitry resembles that of a NAND logic gate (see Chapter 4 Section 4.04) with the
memory cells connected in series. The writing to the memory and the reading from it is
handled by a NAND flash controller. The special feature is that blocks of memory cells can
have their contents erased all at once ‘in a flash’. Furthermore, before data can be written to
a block of cells in the memory the data in the block first has to be erased. A block consists
of several pages of memory. When data is read, a single page of data can be read in one
operation.
The most frequent use is either in a memory card or in a USB flash drive (memory stick). In
the latter case the flash memory is incorporated in a device with the memory chip connected
to a standard USB connector. This is currently the technology of choice for removable data
storage. How long this will remain so is uncertain with alternative technologies such as
phase-change random access memory (PRAM) already under development.
Cambridge International AS & A Level Computer Science
The alternative use is as a substitute for a hard disk when it is often referred to as a solid-
state drive (SSD). You might think that, with no moving parts, the technology would last
forever. This is not true; with continuous use there is a degradation in the material used for
construction. However, this is only gradual and it can be detected and its effects corrected
for. Another major advantage over the traditional hard drive is the faster access speed.
Polariser
Colour Filter
Colour Filter glass
Liquid
Crystal
Voltage
TFT Glas
Glass
Polariser
Polari
iser
Backlight
KEY TERM
Liquid-crystal display (LCD): a screen back-lit by light-emitting diodes and with liquid crystal cells
sandwiched between polarisers
An inkjet printer works in the following way. A sheet of paper is fed in; the printhead moves
across the sheet depositing ink on to the paper; the paper is moved forward a fraction and
the printhead moves across the paper again. This continues until the sheet has been fully
printed. The printhead consists of nozzles that spray droplets on to the paper. Ink is supplied
to the printhead from one or more ink cartridges.
A schematic diagram of the workings of a laser printer is shown in Figure 3.05. The operation
can be summarised as follows.
1 The drum is given an electric charge.
2 The drum starts to revolve step by step.
3 At each step a laser beam is directed by the mirror and lens assembly to a sequence of
positions across the width of the drum.
4 At each position the laser is either switched off to leave the charge on the drum or
switched on to discharge the position.
5 This process repeats until a full-page electrostatic image has been created.
6 The drum is coated with a charged toner that only sticks to positions where the drum has
been discharged.
7 The drum rolls over a sheet of paper which is initially given an electric charge.
8 The sheet of paper is discharged and then is passed through heated rollers to fuse the
toner particles and 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.
Cambridge International AS & A Level Computer Science
For colour printing, separate toners are required for the colours and the process has to
take place for each colour. The colours are created from cyan, magenta, yellow and black.
The technology produces dots. Image quality depends on the number of dots per inch and
software can control the number of dots per pixel.
paper exit
Toner
Hopper
Laser Unit
Photoreceptor
Drum
Assembly
Fuser
PAPER TRAY
The same principles apply for colour printing using an inkjet printer, where separate colour
60 inks are used.
The screen
There are a number of ways in which a user can cause data to be input through an interaction
with a screen. At one time a computer system user only had access to a keyboard and a
screen acting as a monitor. Even then the software could display a menu on the screen and
the user could choose an option by keying in a number from the menu.
A significant step forward came with the introduction of graphical user interfaces (GUIs)
as standard features for microcomputer systems in the 1980s. A GUI provides a number of
different types of screen icon, each of which allows the user to control data input. The user
Cambridge International AS & A Level Computer Science
needs a pointing mechanism to use a GUI effectively. One example of a pointing mechanism
is a computer mouse that controls the position of a cursor on the screen. The screen is now
not just an output device but also an input device activated by a mouse click.
Touch screens
The early versions of touch screen technology worked with a CRT screen but could equally
well be used with a flat screen. The mechanism required emitters to be positioned on the
sides of the screen with detectors positioned opposite to them. The emitters produced either
infrared light or ultrasonic waves. When a finger touched the screen and blocked some of the
light or ultrasound, some of the detectors would measure a reduced signal level.
As well as providing improved display capability, flat-screen technology has allowed new
mechanisms for touch screen interaction.
The modern version of a touch-sensitive screen has layers providing the light output by the
display with further, touch-detecting layers added immediately beneath the surface of the
screen. There have been two approaches used. The first is the resistive touch screen. This
type has two layers separated by a thin space beneath the screen surface. The screen is not
rigid so when a finger presses on to the screen the pressure moves the topmost of these
two separated layers, so that the top layer makes contact with the lower layer. The point of
contact creates a voltage divider in the horizontal and vertical directions.
The second technology is the capacitive touch screen. This does not require a soft
screen but instead makes use of the fact that a finger touching a glass screen can cause
a capacitance change in a circuit component immediately below the screen. The most
62
effective technology is projective capacitive touch (PCT) with mutual capacitance. PCT
screens have a circuit beneath the screen that contains an array of capacitors. This
capacitive technology can detect the touch of several fingertips at the same time, which
allows for more sophisticated applications.
In any type of touch screen the processor takes readings from measuring devices and
uses these readings to calculate the position of the touch. This calculation then allows the
processor to set in motion whatever action the user was requesting.
KEY TERMS
Resistive touch screen: a flexible surface that causes contact between electrically resistive layers
beneath when touched
Capacitive touch screen: a rigid surface above a conductive layer that 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.
Part 1: Chapter 3: Hardware
Input of a graphic
There are several ways to store and use image (graphic) data in a computer. A webcam
is a device used to stream video images into a computer system. A digital camera can be
connected to a computer and stored images or videos can then be downloaded into the
computer. Another option is to use a scanner. Effectively, a scanner reverses the printing
process in that it takes an image and creates a digital representation from it. A sheet of paper
containing the image (which may be text) is held in a fixed position and a light source moves
from one end of the sheet to the other. It covers the width of the paper. The reflected light is
directed by a system of mirrors and lenses on to a charge-coupled device (CCD).
You don’t need to know the details of how a CCD works, but three aspects to note are:
•• a CCD consists of an array of photo-sensitive cells
•• a CCD produces an electrical response proportional to the light intensity for each cell
•• a CCD needs an analogue-to-digital converter to create digital values to be transmitted to
the computer.
Reflection Point:
The description ‘peripheral’ is often used to describe devices that can be connected to a
computer. In your research did you come across the word being used? Is it a useful one or is it
possibly not so because of the lack of a clear definition?
Cambridge International AS & A Level Computer Science
Summary
■ Primary storage is main memory, consisting of RAM (DRAM or SRAM) and ROM (possibly PROM, EPROM or
EEPROM).
■ Secondary storage includes magnetic, optical and solid-state media.
Exam-style Questions
1 a Examples of primary and secondary storage devices include:
•• hard disk
•• DVD-RW
•• flash memory
For each device, describe the type of media used.
Hard disk
DVD-RW
Flash memory [3]
64
b Describe the internal operation of the following devices:
DVD-RW
2 a Pressing a key on a computer keyboard can cause a character to be displayed on the
computer screen.
i Identify four aspects of the 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]
b i In the operation of a laser printer there are a number of initial stages which lead up to
the creation of a full-page electrostatic image. Identify three of these stages and
present them in the order that they would occur. [3]
ii Identify two of the stages that make use of this electrostatic image. [2]
iii State the difference in the procedure used for colour printing from that used for
black and white printing. [1]
3 a Describe the operation of a touch screen technology that can be used in association with
any type of computer screen. [4]
b Describe the operation of a touch screen technology that is only applicable for use with a
flat screen. [4]
4 a Examples of primary and secondary storage devices include: [3]
• hard disk • DVD-RW • flash memory
For each device, describe the type of media used.
Hard disk
DVD-RW
Flash memory [3]
Part 1: Chapter 3: Hardware
65