Chapter 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

03 Hardware

Candidates 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)
Show an understanding of monitoring and control systems

Use the following logic gate symbols:

Understand and define the functions of :


NOT, AND, OR, NAND, NOR and XOR (EOR) gates

Construct the truth table for each of the logic gates above

Construct a logic circuit

Construct a truth table

Construct a logic expression

Definitions
Part of the computer memory which can be accessed
Primary Memory
directly by the CPU

Volatile Memory Memory contents are lost on powering off the computer

Random-Access Memory Volatile Memory that can be read from or written to any
(RAM) number of times

Non-volatile memory that cannot be written to but can be


Read-Only Memory (ROM)
read from any number of times

A RAM chip that makes use of flip-flops to hold each bit of


Static RAM (RAM)
memory
A RAM chip consisting of several transistors and
Dynamic RAM (RAM)
capacitors

Programmable ROM A ROM chip is made up of a matrix of fuses that can be


(PROM) altered only once

Erasable Programmable A ROM chip made up of floating gate transistors and


ROM (EPROM) capacitors that can be erased multiple times

Electrically Erasable PROM


A ROM chip similar to EPROM but uses electrical signals
(EEPROM)

A microprocessor that performs one specific task within a


Embedded System
larger system

Part of the computer memory that cannot be accessed


Secondary Storage
directly by the CPU

A secondary storage device that stores and retrieves data


Hard Disk Drive (HDD)
using magnetic storage

Made of aluminium or glass with surfaces covered with a


Platter
material capable of being magnetized

Part of the disk drive which moves above the disk platter
Read/Write Head
that reads from and writes data to the disk

The time it takes for a specific block of data on a data


Latency
track to rotate around to the read-write head

A secondary storage device that uses integrated circuit


Solid State Drive (SSD)
assemblies to store data typically using flash memory
Storage where laser light is used to read data, and write
Optical Storage
data on the surface of a disk

A software program without a user interface (UI) that


Device Driver manages hardware components or peripherals attached to
a computer

A component of Inkjet printers made up of nozzles that


Print Head
spray droplets of ink onto the paper

Thermal Bubble (for localized heat from tiny resistors causes the ink to vaporize
producing ink droplets) and form a tiny bubble, which is ejected by the print head

crystal at the back of the ink reservoir for each nozzle is


Piezoelectric (for
given a charge making it vibrate, which forces ink to be
producing ink droplets)
ejected onto paper

Additive Manufacturing The object is built up layer by layer

Subtractive Manufacturing Removal of material to make the object

Hardware devices used to show the output from a


Screens
computer

Uses organic materials to create flexible semi-conductors


Organic Light Emitting
and is a self-contained system; can produce light on its
Diode (OLED)
own

Creates electric fields between glass plates in players to


Capacitive Screen
determine where the screen was touched

Resistive Screen Uses a top polyester and bottom glass layer and touching
the top player completes the circuit, which determines
where the screen was touched

Sensors Input devices which read or measure physical properties

An electromechanical device such as a relay, solenoid or


Actuator
motor

A system where the output system can affect the next


Feedback System
input

Monitors an environment, often collecting data about the


Monitoring System
environment

Uses sensors to automatically control elements of a


Control System
system by using the data from them to trigger an action

Hardware that takes binary inputs and produces a binary


Logic Gates
output

Made from combining several logic gates to perform a


Logic Circuits
specific function

Truth Tables Used to trace the output from a logic gate or a logic circuit

NOT Gate The output is 1 only if the input is NOT 1

AND Gate The output is 1 only if all inputs are 1

OR Gate The output is 1 only if at least one input is 1

NAND (NOT AND) Gate The output is 1 only if all inputs are NOT 1

NOR (NOT OR) Gate The output is 1 only if all outputs are 0

XOR Gate The output is 1 if one output is 1 and the other is 0


3.1 Computer and their components
3.1.1 Types of Memory and Storage
Primary Memory
Store files needed to boot the system

Store parts of the Operating System

RAM vs ROM

ROM (Read Only Memory) RAM (Random Access Memory)

Non-Volatile Volatile

Can only be read from Can be written to or read from

Stores the Operating System Stores currently running parts

Stores data, files, programs, and part of


Stores boot-up instructions
the Operating System currently in use

Can’t be changed Can be changed

RAM

Types of RAM are:

SRAM (Static RAM) DRAM (Dynamic RAM)

Uses transistors arranged as flip-flops to Consists of several transistors and


hold each bit of memory capacitors
Does not need to be constantly refreshed Needs to be constantly refreshed

Faster Data Access Time than DRAM Less expensive than SRAM

Used as Processor Memory Cache Higher Memory

ROM

Types of ROM are:

PROM (Programmable ROM) EPROM (Erasable Programmable ROM)

Requires the use of a PROM writer which Uses floating gate transistors and
uses an electric current to alter specific capacitors; UV light is used to program an
cells by ‘burning’ fuses in the matrix EPROM through a quartz window

data can be erased and reprogrammed


Can only be written once multiple times, though it needs to be
removed from the device

Used in applications under development,


Used in Mobile Phones and RFID tags such as programming of new game
consoles

EEPROM (Electrically Erasable PROM) is similar to EPROM, except an electrical signal can
be used to remove existing data. Therefore, the chip can remain in the circuit when the
contents are changed

Embedded System

Involves installing microprocessors in devices to enable operations to be controlled in a


more efficient way
Example:

devices such as cookers, refrigerators and central heating systems can now all be
activated by a web-enabled device (such as a phone) anywhere in the world
Benefits:

Being small in size makes it easy to fit into devices

It also costs less and consumes little power


Since it’s dedicated to a single task, it has a simple interface

It has a fast reaction to changing input


Drawbacks:
It’s difficult to upgrade devices

Devices can be accessed illegally over the internet


Troubleshoot faults in devices require a specialist

Since it is difficult to upgrade and to find faults, devices are often thrown away, hence
wasteful

Buffers

Short-term memory storage that stores data right before it’s used, typically in RAM
Enables CPU to manipulate data before transferring to a device

Secondary Memory
Secondary Memory devices store files for long-term access

Hard Disk Drive (HDD)

Have platters (disks) made of aluminium or glass whose surfaces are covered with a
material capable of being magnetized
Platters are mounted on a central spindle and rotated at high speed
Each surface is accessed by a read/write head mounted on an arm positioned just above
the surface, which is controlled by electrical circuits
The surface of platters divided into concentric tracks and sectors

One track in one sector is the basic unit called the block, each of which has data encoded
as a magnetic pattern
When writing, current variation in the head causes magnetic field variation on the disk

When reading, magnetic field variation from the disk produces current variation in the
read head

SSD (Solid State Drive)

It has no moving parts and is non-volatile


Use semiconductor chips to store data
Consist of a grid of columns and rows with 2 transistors at each intersection

The two transistors are the floating gate and the control gate
Memory cells store voltages that represent either 0 or 1

The movement of electrons is controlled to read/write


Not possible to overwrite existing data, and hence old data needs to be erased and new
data needs to be written in the same location

Optical Media

CDs and DVDs can be designated R (write once only) or RW (can be written to or read
from many times)

The disc surface has a reflective metal layer and is spun using drive motors
The tracking mechanism moves the laser assembly

Lens focus laser onto disc


The laser beam is shone onto the disc to read/write
Tracks have sequences of pits and lands

When reading, the reflected light from the different states on the track is encoded as bit
patterns
When writing, the laser changes surface to pits and lands along the track, which
correspond to 1s or 0s
Blu-ray has the highest storage capacity

The CD has the lowest storage capacity

Comparison of Secondary Media

Magnetic Media Solid State Media Optical Media

SD Card, SSD Hard Drives,


HDD, Tape Drive DVD, CD, Blu-Ray Discs
USB Pen Drive

- Can hold a lot more data


- Large capacity to store
than a standard DVD,
- Reasonably fast access - Large capacity to store
meaning it can store movies
speed - Fast access speed, so
with better picture and
- If a large number is users don’t have to wait for
sound quality
needed, the cost would be video to load
- More expensive than
quite low - Due to no moving parts, it
DVDs
- Data degrades slowly and is reliable because it can
- Can lose data when
hence lasts longer and is work even after being
scratched
more reliable under heavy damaged
- Portable
use
- Requires a Blu-ray player

3.1.2 Input and Output Devices


Printers
Laser Printer

Laser beams and rotating mirrors are used to draw images of pages on a
photosensitive drum
Image converted to electric charge, attracting toner to stick to it

Electrostatic-charged paper rolled against the drum


The charge attracts toner on paper away from the drum

The heat was applied in the fuser to fuse toner on the paper
Electrical charge removed from drum
Inkjet Printer

The print head moves from side to side across the paper being fed
Colours from nozzles are exactly sprayed to get the desired colour

After each pass of the print head, the paper slightly advances to print the next line
Until the buffer not empty, the steps repeat
Ink droplets are produced by using one of two technologies:

Thermal Bubble - localized heat from tiny resistors causes the ink to vaporize and
form a tiny bubble, which is ejected by the print head
Piezoelectric - crystal at the back of the ink reservoir for each nozzle is given a
charge making it vibrate, which forces ink to be ejected onto paper
For both Laser and Inkjet Printers, the following process takes place initially:

Data is sent to the driver, which ensures that data is in a format, the printer can
understand
The driver checks if the printer is available, and if yes, sends it to a temporary
memory known as a printer buffer
3D Printer
The process starts with a digital file containing the blueprint

The software splits the object into pieces and sends to the printer
Solid plastic is melted and transferred to the nozzle, which is moved by stepper motor
into position

Object built layer by layer until object created


Object cured (e.g. resin-made objects are hardened by UV light)

Speakers and Microphones


Speaker
Receives electrical signals, which pass through the coil, creating an electromagnetic
field

Change in digital audio signal causes current direction to change, changing field
polarity
Electromagnet either attracted or repelled to a permanent magnet, causing the
diaphragm attached to the coil to vibrate
Vibration causes sound waves to be produced
Microphone

Incoming sound waves enter the screen and cause the diaphragm to vibrate
This causes the coil to move past a magnetic core

Electric current is generated which is then digitized

Screens
Both an input and output device
2 types:
Resistive Capacitive

Consists of 2 charged plates, the Consists of many layers of glass,


upper layer of polyester and a bottom acting like capacitors creating electric
layer of glass fields between the glass plates

When the top layer is touched, the When the top glass is touched, the
two layers complete a circuit. The electric current changes and the
signal is sent out and the coordinate of touch is determined by
microprocessor determines the the onboard microprocessor.
coordinates of where the screen was Coordinates sent to touch screen
touched driver

Cheap Expensive

Screen visibility poor in strong Screen visibility is good under strong


sunlight sunlight

Does not permit multi-touch capacity Permits multi-touch capability

Weak screen durability, Vulnerable to


Very durable screen
scratches and wears out with time

Can use bare fingers, gloves or a


Only bare fingers can be used
stylus

Virtual Headsets
Video sent from computer to headset
Two feeds sent to an LCD/OLED display
Lenses placed between eyes and screen allow for focusing and reshaping of images or
video for each eye, giving a 3D effect

Sensors and LED measure the movement when the user moves their head, to coordinate
the visuals according to this movement
Binaural sound is used to create a 3D sound effect by making the sound appear from
multiple angles and distance

Sensors
Input devices reading or measuring physical quantities
Converts real data, which is analogue, to digital format by Analogue to Digital Converter
(ADC) so that the computer can understand it
A Digital to Analogue Converter (DAC) is used by computers to convert digital data to
analogue to control physical devices

An actuator compares the output given by the DAC to the actual output stored and stores
the approved output
A feedback system is in place, where readings from sensors cause microprocessors
controlling devices such as a valve or motor, to alter them. This altering affects the next
readings of the sensor and is often used to bring the system within the required limits
Some of the sensors along with their applications are:

Temperature: control a central heated system


Humidity: monitor humidity levels in soil
Light: control light levels in the greenhouse

Infrared: count people entering a building


Pressure: control gas pressure in industries

Sound: detect leaks by detecting the noise of liquids


Gas: control pollution levels in the air
pH: monitor alkalinity in the soil
Magnetic Field: detect changes in cell phones

Sensors are used in monitoring and control systems as visualized in this flowchart

Some examples of monitoring systems include monitoring a patient’s vitals in a hospital,


checking for intruders in a burglar alarm system, and monitoring pollution in the river
Some examples of the control system are controlling the greenhouse environment,
turning street lights at night, and controlling the temperature in the central heating
system
Skill Check 1
Kiara has a washing machine and a refrigerator.

1. She has an embedded system in her washing machine.


Describe what is meant by an embedded system, using the washing machine as
an example. [2]
2. The washing machine’s embedded system makes use of both Random Access
Memory (RAM) and Read Only Memory (ROM).
State the purpose of RAM and ROM within the washing machine’s embedded
system. [2]
3. The temperature in her refrigerator must be kept between 4 and 6 degrees
Celsius.
The microprocessor in the refrigerator turns on the cooling if the temperature is
too high, and turns off the cooling if the temperature is too low.
Explain why the system in the refrigerator is a control and not a monitoring
system. [2]

Solution

1. It is a system of microprocessors that performs one specific task each within


a larger system. For example, there could be an embedded system in the
washing machine that only controls the programs for the washing cycle.

2. RAM: It stores the choices the user has entered.


ROM: It stores the start-up instructions for the washing cycles.
3. The system uses feedback and also produces an action based on it.

3.2 Logic Gates and Logic Circuits


3.2.1 Logic Gates
Logic gates take binary inputs and produce a binary output. Several logic gates combined
form a logic circuit and these circuits are designed to carry out a specific task.

3.2.2 Truth Tables


Truth Tables are used to trace output from logic gates or logic circuits. When constructing
truth tables, all possible combinations of 0s and 1s which can be input are considered. If a
logic circuit has x total inputs, there are 2x possible binary combinations.

3.2.3 The Functions of the Six Logic Gates


NOT Gate

Truth Table:

Inpu Outpu
t t

Description: The output, X , is 1 if the input A X


A is NOT 1.
0 1
Logic Notation: NOT A
1 0

AND Gate

Truth Table:

Input Outpu
s t
Description: The output, X , is 1 if all inputs A B X
are 1.
Logic Notation: A AND B 0 0 0

0 1 0

1 0 0

1 1 1

OR Gate

Truth Table:

Input
Output
s
Description: The output, X , is 1 if any
A B X
input is 1.
Logic Notation: A OR B 0 0 0

0 1 1

1 0 1

1 1 1

NAND Gate (NOT AND)

Truth Table:

Input Output
Description: The output, X , is 1 if all inputs s
are not 1.
A B X
Logic Notation: A NAND B
0 0 1

0 1 1

1 0 1

1 1 0

NOR Gate (NOT OR)

Truth Table:

Input Outpu
s t

Description: The output, X , is 1 if all inputs A B X


are 0.
Logic Notation: A NOR B 0 0 1

0 1 0

1 0 0

1 1 0

XOR Gate

Truth Table:
Input Outpu
s t

A B X
Description: The output, X , is 1 if both
outputs are different. 0 0 0

Logic Notation: A XOR B 0 1 1

1 0 1

1 1 0

3.2.4 Logic Circuits


Logic Circuits are formed to carry out a particular function by combining logic gates.

The following examples show how to produce a truth table, design a logic circuit from a
given logic statement, and design a logic circuit to carry out an actual safety function.

Skill Check 2
The following example shows how to produce a truth table, design logic circuit from
a given logic statement, and design a logic circuit to carry out an actual safety
function.
A safety system uses three inputs to a logic circuit. An alarm, X , sounds if input A
represents ON and input B represents OFF, or if input B represents ON and input C
represents OFF.
Produce a logic circuit and truth table to show the conditions which cause the output
X to be 1.
Solution

1. Convert to a logic statement by breaking down the problem statement.


X = 1 if (A = 1 AND B = NOT 1) OR (B = 1 AND C = NOT 1)
2. Construct the logic gate for the first and third parts of the logic statement.

3. Combine both parts with Part 2 (the OR gate).


4. Produce the truth table either by tracing through the logic circuit or by using
the original logic statement. Use intermediate values to make it easier to
produce the table.

Input
Values Output
s Intermediate

D (A = 1 AND E (B= 1 AND


A B C X
B = NOT 1) C = NOT 1)

0 0 0 0 0 0

0 0 1 0 0 0

0 1 0 0 1 1

0 1 1 0 0 0

1 0 0 1 0 1

1 0 1 1 0 1

1 1 0 0 1 1

1 1 1 0 0 0

Skill Check 3
Cristiano has to attend school if it’s a weekday AND NOT a holiday, OR if it’s NOT a
weekday AND a sports week AND NOT a holiday.
Let the parameter used to represent Cristiano attending school be given by X , where
X = 1 represents Cristiano attending school.
Using suitable inputs, Produce a logic circuit and truth table to show the conditions
which cause the output X to be 1.
Solution


1. Assign suitable parameters to represent each event/input. For this solution,
the following example parameters are used.
A = 1: It is a weekday.
B = 1: It is a holiday.
C = 1: It is a sports week.
2. Convert to a logic statement by breaking down the problem statement.
X = 1 if (A = 1 AND B = NOT 1) OR (A = NOT 1 AND B = NOT 1 AND C =
1)
3. Construct the logic gate for the first and third parts of the logic statement.
For the third part, it’s recommended to break down the circuit into smaller
circuits such as (A = NOT 1 AND B = NOT 1) AND C = 1, so that each
circuit uses 2 inputs. However, although not recommended, three inputs to
the logic gate also work.
4. Combine both parts with Part 2 (the OR gate).

5. Produce the truth table either by tracing through the logic circuit or by using
the original logic statement. Use intermediate values to make it easier to
produce the table.

Input
Values Output
s Intermediate

D (A = 1 E (A = NOT 1
A B C AND B = AND B = NOT 1 X
NOT 1) AND C = 1)

0 0 0 0 0 0

0 0 1 0 1 1

0 1 0 0 0 0

0 1 1 0 0 0

1 0 0 1 0 1

1 0 1 1 0 1

1 1 0 0 0 0

1 1 1 0 0 0

3.2.5 Logic Circuits in the Real World


It is possible to build up any logic gate, and therefore any logic circuit, by linking together
multiple NAND gates. Some examples are:
AND gate
Revision Guides / AS / COMPUTER SCIENCE / 03 Hardware
OR gate

NOT gate

Points to Note
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
Output devices include screens, printers, plotters and speakers
Input devices include the keyboard, scanner and microphone
Screens can be used for both input and output
A monitoring system requires sensors

A sensor measures a physical quantity; there are many examples, such as temperature,
humidity, pH, infrared, pressure, sound and carbon monoxide
A monitoring and control system requires sensors and actuators
A program used for a monitoring and control system has to operate in real-time with an
infinite loop that accepts input from the sensors at timed intervals

The program transmits signals to the actuators if the values received from the sensors
indicate a need for control measures to be taken
A logic scenario can be described by a problem statement or a logic expression
A logic expression comprises logic propositions and Boolean operators
Logic circuits are constructed from logic gates

The operation of a logic gate matches that of a Boolean operator


The outcome of a logic expression or a logic circuit can be expressed as a truth table
A logic expressed can be created from a truth table using the rows that provide a 1 output

You might also like