vData Representation
Number Systems
Binary System
Base 2 number system
It has two possible values only (0 and 1)
0 represents OFF, and 1 represents ON
A point to be noted is that the most left bit is called the MSB (Most
Significant Bit)
Denary System
Base 10 number system
Has values from 0 to 9
Hexadecimal (aka Hex)
Base 16 number system
Have values from 0 to 9 followed by A to F
A represents 10, B represents 11 and so on until 15, which is F
Binary Hexadecimal Denary
Value Value Value
0000 0 0
0001 1 1
0010 2 2
0011 3 3
0100 4 4
0101 5 5
0110 6 6
0111 7 7
Binary Hexadecimal Denary
Value Value Value
1000 8 8
1001 9 9
1010 A 10
1011 B 11
1100 C 12
1101 D 13
1110 E 14
1111 F 15
Number Conversions
Converting Binary to Denary
Place the binary value in columns of 2 raised to the power of the
number of values from the right starting from 0. e.g. For binary
value 11101110, place it in a table like this:
12 6 3 1
8 4 2 1
8 4 2 6
1 1 1 0 1 1 1 0
As can be seen it starts from 1 and then goes to 128 from left to
right
Now values with 1 are to be added together, giving the final answer,
as for the example, it is 128 + 64 + 32 + 8 + 4 + 2 = 238
Converting Denary to Binary
Take the value and successively divide it by 2, creating a table like
follows:
14
2
2
Remainde
2 71 0
r:
Remainde
2 35 1
r:
Remainde
2 17 1
r:
Remainde
2 8 1
r:
Remainde
2 4 0
r:
Remainde
2 2 0
r:
Remainde
2 1 0
r:
Remainde
0 1
r:
Note that when the value itself is not divisible by 2, it is divided by
the previous value of the current number and 1 is added to the
remainder column for that specific number
When you reach 0, the remainder has to be read from bottom to top
giving us the binary value ( as in this case, it is 1 0 0 0 1 1 1 0 )
Converting Hexadecimal to Binary
Separate each value from each other and convert them to denary
Each separate denary value to be converted to binary
All the binary values to be merged together
e.g.
Hexadecimal : 2 1 F D
Denary :2 1 15 13
Binary : 0010 0001 1111 1101
Final Answer: 0010000111111101
Converting Binary to Hexadecimal
Divide the binary value into groups of 4 starting from the right. If at
the end, the last division is less than 4, add 0s until it reaches 4
For each group, find the denary value as shown above, and then
convert each denary value to its corresponding hexadecimal value
(if less than 10, then itself, else, 10 is A, 11 is B, 12 is C, 13 is D, 14
is E and 15 is F).
After conversion, just put all the hexadecimal values in order to get
the final answer
Given Value : 1 0 0 0 0 1 1 1 1 1 1 1 0 1
When grouped: 10 0001 1111 1101
After 2 values added to left: 0010 0001 1111 1101
After Conversion to Denary: 2 1 15 13
Denary to Hexadecimal: 21FD
Converting Hexadecimal to Denary
Convert the value to binary as shown above, and then convert the
final answer to denary
Converting Denary to Hexadecimal
Convert the value to binary, and then convert it to hexadecimal as
explained above
Binary Calculations
Binary values are not added the way denary values are added, as
when adding 1 and 1, we cannot write two because it doesn’t exist
in binary.
Points to Note:
0+0=0
1+0/0+1=1
1 + 1 = 0 (1 carry)
1 + 1 + 1 = 1 (1 carry)
Overflow
When adding two values, if the solution exceeds the limit of given
values, e.g., the solution has 9 bits, but the question had 8 bits per
value, the 9th bit (most left bit) is called overflow.
This indicates that the memory doesn’t have enough space to store
the answer to the addition done in the previous part.
Steps to add Two Values (With Example)
The values we will add are 1 1 0 1 1 1 0 and 1 1 0 1 1 1 1 0
1. Convert both the bytes into 8 bits (add zero to the left-hand
side to match them).
e.g., 1 1 0 1 1 1 0 would become 0 1 1 0 1 1 1 0
2. Add the values as follows with the points given above
Carry 1 1 1 1 1 1 1
Byte 1 0 1 1 0 1 1 1 0
Byte 2 1 1 0 1 1 1 1 0
OVERFLO
W
Soluti
1 0 1 0 0 1 1 0 0
on
Note: We move from RHS to LHS, and when adding values, we use the
rules given above. If the bit crosses the limit (overflows), we put the value
in brackets, denoting it is overflow.
iii. The solution would now be (1) 0 1 0 0 1 1 0 0
Logical Shifts
The logical shift means moving a binary value to the left or the right
When doing a logical shift, keep in mind that the bit being emptied
is going to become 0
Explanation with Example
Shifting 10101010 - 1 place left:
1. The furthest bit in the direction to be logically shifted is
removed ( in this case, one at the LHS is removed) - ==(if it
were two places, 2 bits would have been removed)==
2. Every bit is moved in given places to the given direction
( every bit is moved one place to the left in this case, and the
leftover bit in the right is marked 0, so 10101010 would
become 01010100)
Two’s Complement (Binary Numbers)
Two’s complement is a method used to represent negative values in
binary. Here, the MSB ( Most Significant Bit) is replaced from 128 to -
128; thus, the range of values in a two’s complement byte is -128 to
127
Converting Binary Values to Two’s Complement
Firstly, write the binary value and locate the first one from the right;
e.g., 1101100 would have the first one at the third position from the
right.
Now, switch every value to the left of the first one located above
(not switching the one), e.g., the value in our example becomes
0010100, which is the two’s complement of itself.
Converting negative values to two complement
Find the binary equivalent of the value ignoring the - sign
Convert the binary value to two’s complement
Make the MSB 1, if not already
Converting Two’s Complement Value to Denary:
We do it the same way as a normal value is converted from binary
to denary; we only replace 128 with -12,8 e.g., for 1011101,0 we do
the:
-
6 3 1
12 8 4 2 1
4 2 6
8
1 0 1 1 1 0 1 0
-128 + 32 + 16 + 8 + 2 = -70
Use of the Hexadecimal System
Examples:
Defining colours in Hypertext Markup Language (HTML)
Media Access Control (MAC) addresses (a number that uniquely
identifies a device on a network)
Assembly languages and machine code
Memory Dumps
Debugging (method to find errors in a program)
Display error codes (numbers refer to the memory location of the
error)
IP (Internet Protocol) addresses
Memory Dumps
Hexadecimal is used when developing new software or when trying
to trace errors.
Memory dump is when the memory contents are output to a printer
or monitor.
Assembly code and machine code (low-level languages)
Computer memory is machine code/ assembly code
Using hexadecimal makes writing code easier, faster, and less error-
prone than binary.
Using machine code (binary) takes a long time to key in values and
is prone to errors.
Text, Sound and Images
ASCII
The standard ASCII code character set consists of 7-bit code that
represents the letters, numbers and characters found on a standard
keyboard, together with 32 control codes
Uppercase and lowercase characters have different ASCII values
Every subsequent value in ASCII is the previous value + 1. e.g. “a”
is 97 in ASCII, “b” will be 98 (which is 97 + 1)
Important ASCII values (in denary) to remember are as follows:
0 is at 48
A is at 65
a is at 97
ASCII uses one byte to store the value
When the ASCII value of a character is converted to binary, it can be
seen that the sixth-bit changes from 1 to 0 when going from
lowercase to uppercase of a character, and the rest remains the
same. e.g.
Unicode
ASCII does not contain all of the international languages thus,
Unicode is used to solve this problem
The first 128 values are the same as ASCII.
Unicode supports up to four bytes per character, storing multiple
languages and more data.
To represent text in binary, a computer uses a character set,
a collection of characters and the corresponding binary
codes that represent them.
Sound
Sound is analogue, and for it to be converted to digital form, it is
sampled
The sound waves are sampled at regular time intervals where the
amplitude is measured. However, it cannot be measured precisely,
so approximate values are stored
How is Sound Recorded
The amplitude of the sound wave is first determined at set time
intervals
The value is converted to digital form
Each sample of the sound wave is then encoded as a series of
binary digits
A series of readings gives an approximate representation of the
sound wave
Sampling Resolution:
The number of bits per sample is known as the sampling resolution
(aka bit depth)
Increasing the sampling resolution increases the accuracy of the
sampled sound as more detail is stored about the amplitude of the
sound.
Increasing the sampling resolution also increases the memory usage
of the file as more bits are being used to store the data.
Sampling Rate
The sampling rate is the number of sound samples taken per
second, which is measured in Hertz (Hz)
A higher sampling rate would allow more accurate sound as fewer
estimations will be done between samples.
Images
Bitmap Images
Bitmap images are made up of pixels
A bitmap image is stored in a computer as a series of binary
numbers
Colour Depth
The number of bits representing each colour is called the colour
depth.
An 8-bit colour depth means that each pixel can be one of 256
colours (because 2 to the power of 8 = 256)
A 1-bit colour depth means each pixel can store one colour (because
2 to the power of 1 is 2) - ( This is done as the bit can either be 0 or
1, with 0 being white and 1 being black)
Increasing colour depth increases the size of the file when storing an
image.
Image Resolution
Image resolution refers to the number of pixels that make up an
image; for example, an image could contain 4096 × 3072 pixels.
Photographs with a lower resolution have less detail than those with
a higher resolution.
When a bitmap image is ‘ blurry ‘ or ‘ fizzy ’ due to having a low
amount of pixels in it or when zoomed, it is known as
being pixelated.
High-resolution images use high amounts of memory as compared
to low-resolution ones.
Measurement of the Size of Computer Memories
A binary digit is referred to as a BIT
8 bits is a byte
4 bits is a nibble
Byte is used to measure memory size
IECB System (Most Common)
Name of memory No. of Equivalent Denary
size Bytes Value
1 kibibyte (1KiB) 210 1 024 bytes
1 mibibyte (1MiB) 220 1 048 576 bytes
1 gibibyte (1GiB) 230 1 073 741 824 bytes
1 099 511 627 776
1 tibibyte (1TiB) 240
bytes
1 125 899 906 842 624
1 pibibyte (1PiB) 250
bytes
Conventional System
Name of memory No. of Equivalent Denary
size Bytes Value
1 kilobyte (1KB) 103 1 000 bytes
1 megabyte (1MB) 106 1 000 000 bytes
1 gigabyte (1GB) 109 1 000 000 000 bytes
1 000 000 000 000
1 terabyte (1TB) 1012
bytes
1 000 000 000 000 000
1 petabyte (1PB) 1015
bytes
Calculation of File Size
The file size of an image is calculated as image resolution (in pixels)
× colour depth (in bits)
The size of a mono sound file is calculated as sample rate (in Hz) ×
sample resolution (in bits) × length of sample (in seconds). (For a
stereo sound file, you would then multiply the result by two.)
File Types
Musical Instrument Digital Format (MIDI)
Storage of music files
A communications protocol that allows electronic musical
instruments to interact with each other
Stored as a series of demands but no actual music notes
Uses 8-bit serial transmission (asynchronous)
Each MIDI command has a sequence of bytes:
o The first byte is the status byte – which informs the MIDI
device what function to perform
o Encoded in the status byte is the MIDI channel (operates on
16 different channels)
Examples of MIDI commands:
o Note on/off: indicates that a key has been pressed
o Key pressure: indicates how hard it has been pressed
(loudness of music)
It needs a lot of memory storage
MP3
It uses technology known as Audio Compression to convert music
and other sounds into an MP3 file format
This compression reduces the normal file size by 90%
o Done using file compression algorithms, which use Perceptual
Music Shaping
o Removes sounds that the human ear cannot hear properly
o Certain sounds are removed without affecting the quality, too
much
CD files are converted using File Compression Software
Use lossy format as the original file is lost following the compression
algorithm
MP4
This format allows the storage of multimedia files rather than just
sound
Music, videos, photos and animations can be stored
Videos could be streamed without losing any real discernible quality
Joint Photographic Experts Group (JPEG)
JPEG is a file format used to reduce photographic file sizes
Reducing picture resolution is changing the number of pixels per
centimetre
When a photographic file undergoes compression, file size is
reduced
JPEG will reduce the raw bitmap image by a factor between 5 and 15
Lossless and Lossy File Compression
Lossless File Compression
All the data bits from the original file are reconstructed again when
the file is uncompressed.
Important for files where the loss of data would be disastrous
(spreadsheet)
An algorithm is used to compress data
No data is lost
Repeated patterns/text are grouped together in indexes
Run-Length Encoding
It reduces the size of a string of adjacent, identical data (e.g.
repeated colours in an image)
A repeating string is encoded into two values: the first value
represents the number of identical data items (e.g. characters), and
the second value represents the code of the data item (such as
ASCII code if it is a keyboard character), e.g. ‘aaaaabbbbccddddd’
becomes “05 97 04 98 02 99 05 100.”
RLE is only effective where there is a long run of repeated units/bits
One difficulty is that RLE compression isn't perfect for strings like
"cdcdcdcdcd". We use a flag to solve this; e.g., 255 can be made as
the flag. Now 255 will be put before every repeating value, e.g. our
previous example becomes 255 05 97 255 04 98 255 02 99 255 05
100 where 255 now indicates that the next character/set of
characters is approaching
Lossy File Compression
The file compression algorithm eliminates unnecessary data bits like
in MP3 and JPEG formats.
It is impossible to get the original file back once it is compressed
Reduces file quality
In this, the image's resolution and colour depth are reduced.
Data Transmission
Types and Methods of Data Transmission
Data Packets
Packet Structure -
o Header
Contains the IP address of the sender and the receiver
The sequence number of the packet
Size of the packet
o Payload
Contains the actual data
o Trailer
Includes a method of identifying the end of the packet
Error-Checking methods
Packet Switching - Method of data transmission where the data is
broken into multiple packets. Packets are then sent independently
from start to end and reassembled at the receiver’s computer.
Advantages Disadvantages
There is no need to create a
Packets may be lost
single line of communication
Possible to overcome failed or More prone to errors in real-time
busy nodes streaming
Delay at the receiver while the
High data transmission speed
packets are being re-ordered
Easy to expand package usage
Data Transmission
Simplex data transmission is in one direction only (e.g. computer to
printer)
Half-duplex data transmission is in both directions but not at the
same time (e.g., walkie-talkie)
Full-duplex data transmission is in both directions simultaneously
(e.g. broadband connection on the phone line)
Serial data transmission is when data is sent one bit at a time over a
single wire
Parallel data transmission is when data of several bits (1 byte) are
sent down several wires at the same time.
Comparison of Serial and Parallel Data Transmission
Serial Parallel
Better for longer distances Better for short distances
(Telephone Lines) (Internal circuits)
Expensive (More hardware
Cheaper Option
required)
Used when the size of data
Used when speed is necessary
transmitted is small
Slower Option Faster than Serial
Universal Serial Bus (USB)
USB is an asynchronous serial data transmission method
USB consists of:
o Four-wire shielded cable
o Two wires are used for power and earth
o Two wires are used in data transmission
Advantages Disadvantages
Transmission rate is less than
Automatically detected
120 MB/sec
Only fit one way, prevents incorrect Maximum cable length is about
connections 5 metres
Different data transmission rates
Backwards compatible
Industry-standard
Methods of Error Detection
Parity Checks
It uses the number of 1-bits in a byte
Type Types -
o Even - Even number of 1-bits
o Odd - Odd numbers of 1-bits
Example (Even Parity) -
0 1 0 1 1 0 1 0
The LMB (Left-Most Bit) is the parity bit. As the number of 1s is
even, the parity bit would be set to even.
Limitations with Parity Checks
Two bits may change during transmission; therefore error is not
found
Even though the parity checks would reveal the errors, the bit(s)
changed wouldn’t be identified
Parity Blocks
To overcome the limitations of parity bits, Parity blocks would be
used.
Any changes in bits would be identified through the rows and
columns
Checksum
Whenever a block of data needs to be sent, the sender would
calculate the checksum value using a specific algorithm.
Once the data has been sent, The receiver would calculate the
checksum again with the same set of data and the same algorithm
used before.
The receiver would then compare the value received and the newly
calculated value. If they aren’t matched, A request is made to re-
send the data.
Echo Check
Once the data has been sent, The receiver will send the data back
to the sender for verification.
The sender would compare the received and original data for errors.
The only downside is that we wouldn’t know if the error occurred
when sending the data or sending the data back for verification.
Check Digits
Check digits are calculated from all the other digits in the data (ex-
codes). The check digit would be the last digit of the code.
These are used to identify mistyping errors such as -
o 6372 typed as 6379
o 8432 typed as 842
Automatic Repeat Requests (ARQs)
Uses acknowledgements and timeouts to make sure the user
received the data
The receiver would check the data for any errors; if none are found,
a positive acknowledgement is sent to the sender. However, if errors
are found, a negative acknowledgement will be sent, and the data
will be sent again.
The sender uses timeouts to wait for a pre-determined amount for
the acknowledgement.
If no acknowledgements are received after the timeout, the data will
be sent again to the receiver.
Encryption
Encryption is a process of turning the data into an unreadable form
so it doesn’t make sense to hackers and other attackers.
Plaintext and Ciphertext
Plaintext is the original data that is being sent
Ciphertext is the text produced after encryption
Symmetric and Asymmetric Encryption
Symmetric Encryption:
o It uses an encryption key for the encryption process; the same
key is used for encrypting and decrypting the data.
Asymmetric Encryption:
o Uses a public key and a private key. The public key is available
to everyone, whereas the private key is only available to the
user.
o The receiver would have the private key, and they would send
the public key to the sender. The sender can encrypt the
message with the public key, and the data can be decrypted
using the private key.
Hardware
Computer Architecture & Von Neumann Architecture
The central processing unit (CPU) (also known as a microprocessor
or processor) is central to all modern computer systems
The CPU consists of the following architecture:
Processor: The processor contains the Arithmetic and Logic Unit
(ALU)
Control Unit: The control unit controls the operation of the
memory, processor and input/output devices
Arithmetic Logic Unit: Carries out the logic system like
calculations
System Clock: The system clock is used to produce timing signals
on the control bus
Buses: Carry data through components. The following are its types.
Address bus – unidirectional
Data Bus – bi-directional
Control Bus – bi-directional
Immediate Access Store: Stores the instructions that are to be
processed, which are fetched by the CPU
The following registers also exist in the architecture:
REGIST
ABBREVIATION FUNCTION
ER
Current
Stores the instruction the CPU is
CIR instruction
currently decoding or executing
register
Memory address Stores the Address of the instruction,
MAR
register copy it, and sends it to MDR
Stores the Data from the address
Memory data
MDR received from the MAR and sends
register
data to CIR
Stores the address of the next
PC Program counter instruction to be fetched from
memory
During calculations, data is
ACC Accumulator
temporarily held in it
The Fetch-Execute Cycle
1. PC contains the address of the next instruction to be fetched
2. This address is copied to the MAR via the address bus
3. The instruction of the address is copied into the MDR temporarily
4. The instruction in the MDR is then placed in the CIR
5. The value in the PC is incremented by 1, pointing to the next
instruction to be fetched
6. The instruction is finally decoded and then executed
Stored Program Concept
Instructions are stored in the main memory
Instructions are fetched, decoded, and executed by the processor
Programs can be moved to and from the main memory
Memory Concept
A computer’s memory is divided into partitions: Each partition
consists of an address and its contents, e.g.
MEMORY CONTE
LOCATION NT
0101011
10101010
0
Instruction Set:
An instruction set is a list of all the commands that a CPU can process,
and the commands are machine code
Cores, Cache and Internal Clock
System’s Clock
The clock defines the clock cycle that synchronises all computer
operations. By increasing the clock speed, the computer's
processing speed also increases. This doesn’t mean that the
computer's performance is increased, however.
Overclocking
Using a clock speed higher than the computer was designed for.
It leads to multiple issues.
Operations become unsynchronised - (the computer would
frequently crash and become unstable)
can lead to serious overheating of the CPU
Length of Data Buses
The wider the data buses, the better the performance of the
computer
Cache
Cache memory is located within the CPU itself
-- allows faster access to the CPU
-- stores frequently used instructions and data that need to be accessed
faster, which improves CPU performance
The larger the cache memory size, the better the CPU
performance
Cores
The more cores in the CPU, the better and faster the performance
But if any number of cores are used, it could slow down the system
performance as the communication between each core increases,
and so do the data cables between each. Which in turn reduces the
potential system performance.
You might have heard about quad and dual cores, not septa or octa
cores.
Input Devices
Two-dimensional Scanners:
Used to input hard-copy documents
The image is converted into an electronic form, which can be stored
in the computer
o The document is placed on a glass panel
o A bright light illuminates the document
o A scan head moves across the document until the whole page
is scanned. An image of the document is produced and sent to
a lens using a series of mirrors
o The lens focuses on the document image
o The focused image now falls onto a charge-coupled device
(CCD), which consists of several integrated circuits
o The software produces a digital image in the electronic form
Optical Character Recognition (OCR) is a software which converts
scanned documents into a text file format
If the original document was a photo/image, then the scanned
image forms an image file such as JPEG
Three-dimensional Scanners
3D scanners can scan solid objects and produce a three-dimensional
image
Scanners take images at several points, x, y and z (lasers, magnetic,
white light)
The scanned images can be used in Computer-Aided Design
(CAD) or in a 3D printer to produce a working model
Application of 2D Scanners at an Airport:
Make use of (OCR) to produce digital images which represent the
passport pages
Text can be stored in ASCII format
The 2D photograph in the passport is also scanned and stored as
jpeg image
The passenger’s face is also photographed using a digital camera
and compared to using face recognition software
Key parts of the face are compared (distance between eyes, width of
nose)
Barcode readers/scanners
A barcode is a series of dark and light parallel lines of varying
thicknesses
The numbers 0 -9 are each represented by a unique series of lines
The left and right-hand sides of the barcode are separate using
guard bars
Allows barcode to be scanned in any direction
o The barcode is read by a red laser or red LED
o Light is reflected off the barcode; dark areas reflect little light,
which allows the bars to be read
o Reflected light is read by sensors (photoelectric cells)
o The pattern is generated, which is converted to digital
Quick Response (QR) Codes
Another type of barcode is the QR codes
Made up of a matrix of filled-in dark squares on a light background
Can hold more storage (7000 digits)
Advantages of QR codes:
o No need for the user to write down the website address
o QR codes can store website addresses
Digital Cameras
It is controlled by a microprocessor that adjusts the shutter speed,
focuses the image, etc.
Photo is captured when light passes through the lens onto a light
sensitive cell
The cell is made up of pixels
The number of pixels determines the size of the file
Keyboards
Connected to a computer with a USB connection or by wireless
connection
Each character has an ASCII value and is converted into a digital
signal
Slow method
Prone to errors
Pointing devices
Mouse/trackball
o Traditional mechanical ball, connected by USB port
Modern type: red LEDs to detect movement
Microphones
Used to input sound to a computer
When a microphone picks up sound, a diaphragm vibrates,
producing an electric signal
The signal goes to a sound card and is converted into digital values
and stored in a computer
Voice recognition: voice is detected and converted into digital
Touchscreens
Capacitive (medium cost tech)
o Made up of many layers of glass
o Creating electric fields between glass plates in layers
o When the top layer of glass is touched, electric current
changes
o Co-ordinates where the screen was touched are determined
by an on-board microprocessor
Infra-red heat (expensive)
o Use glass as the screen material
o Needs a warm object to carry an input operation
Infra-red optical (expensive)
o Uses glass as screen material
o Uses an array of sensors (grid form)
o Point of contact is based on which grid co-ordinate is touched
Resistive (inexpensive)
o The upper layer of polyester, the bottom layer of glass
o When the top polyester is touched, the top layer and bottom
layer complete a circuit
o Signals are then sent out, which are interpreted by a
microprocessor to determine where the screen was touched
Sensors
Devices that read or measure physical properties
Data needs to be converted to digital
Analogue-to-digital converter (ADC) converts physical values into
digital
Sensors and their purposes:
o Acoustic - These sensors act like a microphone that converts
sound to electric pulses.
o Accelerometer - These sensors measure an object's
acceleration or deceleration and motion.
o Flow - This sensor measures the flow of liquid or gas.
o Gas - These sensors measure the amount/level of any gas in
the environment.
o Humidity - This sensor measures the water vapour in the air or
any sample.
o Infra-red (active) - This IR sensor uses an invisible infrared
beam. When the beam is broken/disturbed, it changes the
amount of infrared light reaching the detector.
o Infra-red (passive) - These sensors detect the heat emitted by
any object.
o Level - This sensor detects the solids, liquids, or gas level.
o Light - These devices use light-sensitive cells that generate
electric current based on light brightness.
o Magnetic field - This sensor detects the change in magnetic
field.
o Moisture - This type of sensor detects the water content
wherever this sensor has been installed.
o pH - This measures the acidity or alkalinity.
o Pressure - This sensor measures the pressure applied
o Proximity - This sensor detects the nearby objects around the
sensor
o Temperature - These sensors measure the temperature of the
environment.
(Note: You do not need to know the working principle of the sensor.
But have an idea of their purposes.)
Control of Street Lighting
The light sensor sends data to the ADC
The data is digitised and sent to the microprocessor
Microprocessor samples data every minute
If data from sensor < value stored in memory:
o Signal sent from microprocessor to street lamp
o Lamp switched on
Output Devices
Inkjet Printers
Used to print one-off pictures and documents
Data from the document sent to the printer driver
The printer driver ensures data is in the correct format
Check made by printer driver that the chosen printer is available
Data is sent to the printer and stored in a temporary memory
(printer buffer)
A sheet of paper is fed; the sensor detects if the paper is available in
the paper tray
The print head moves across paper printing text/image, four ink
colours sprayed in the exact amount
Paper is advanced, so the next line is printed
Repeated until the buffer is empty
Once it is done, the printer sends an interrupt to the processor
(request for more data to be sent)
Laser Printers
Used to print flyers, high quality
Use dry powder ink (toner) and static electricity to produce text and
images
Prints the whole page in one go
1. (steps 1-4 same as inkjet)
2. The printing drum is given a positive charge; as the drum rotates, a
laser beam is scanned across it; removing the positive charge
leaves negatively charged areas which match the text/image
3. The drum is then coated with positively charged toner; it only sticks
to negatively charged parts of the drum
4. A negatively charged sheet is rolled over the drum
5. The toner on the drum now sticks to the paper to produce a copy of
the page
6. Paper finally goes through a fuser (set of heated rollers); heat melts
the ink so it is permanent
7. The discharge lamp removes all electric charge from the drum,
ready to print on the next page
3D Printers
Used for models of cars
Produce solid objects that work
Built up layer by layer, using powdered resin, ceramic powder
A design is made using Computer-aided Design (CAD)
2D and 3D Cutters
3D cutters can recognise objects in x, y, z direction
3D laser cutters can cut glass, crystal, metal, wood
Actuators
The actuators convert electrical signals to mechanical processes.
Used in many control applications involving sensors and devices
(ADC and DAC)
Loudspeakers/Headphones
Sound is produced by passing the digital data through a DAC, then
through an amplifier, and then emerges from the loudspeaker
Produced by voltage differences vibrating a cone in the speaker at
different frequencies
LCD and LED Monitors
The front layer of the monitor is made up of Liquid Crystal
Display (LCD); these tiny diodes are grouped in threes as pixels (LCD
doesn’t emit any light)
LCD monitors are backlit using Light Emitting Diode (LED) because:
o LEDs reach their maximum brightness immediately
o LEDs sharpen image (higher resolution), and CCFL has a
yellow tint
o LEDs improve the colour image
o Monitors using LED are much thinner than CCFL
o LEDs consume very little power
Before LEDs, LCD monitors were backlit using CCFL
CCFL uses two fluorescent tubes behind the LCD screen, which
supplies the light source
Light Projectors:
Two common types of light projectors:
o Digital Light Projector (DLP)
o LCD Projector
Projectors are used to project computer output onto larger
screens/interactive whiteboards
Digital Light Projectors (DLP)
Uses millions of micromirrors
the number of micromirrors and the way they are arranged on the
DLP chip determines the resolution of the image
When the micromirrors tilt towards the light source they are on
When the micromirrors tilt away from the light source, they are off
This creates a light or dark pixel on the projection screen
A bright white light source passes through a colour filter on its way
to the DLP chip
White light splits into primary colours
LCD Projectors
Older technology than DLP
A powerful beam of white light is generated from a bulb
This beam of light is then sent to a group of chromatic-coated
mirrors; these reflect the light at different wavelengths
When the white light hits the mirrors, the reflected light has
wavelengths corresponding to red, green, and blue
These three different lights pass through three LCD screens; these
screens show the image to be projected as millions of pixels in
grayscale
When the coloured light passes through the LCD screens, a red,
green and blue version of the grey image emerges
Finally, the image passes through the projector lens onto the screen
Source: Cambridge IGCSE and O Level Computer Science - Second Edition
(Hodder Education)
Memory, Storage Devices & Media
Primary vs. Secondary Storage
The CPU directly accesses primary storage
The CPU does not directly access secondary storage
RAM, ROM, and cache memory are some examples
HDD, SSD, DVD, memory stick, and Blu-ray disc are some examples
Primary Memory:
Random Access Memory (RAM)
RAM is used by a system when it needs to store and access data
that is actively being used or processed by the user immediately.
Features of RAM
o Volatile/temporary memory (contents lost if RAM is turned off)
o Used to store; data, files
o It can be written to or read from, and the contents of the
memory can be changed
The larger the size of the RAM, the faster the computer will operate
RAM never runs out of memory and continues to run slow
As RAM becomes full, the processor has to access the continually
hard drive to overwrite old data on RAM with new data
RAM is of two types:
DRAM (Dynamic RAM) and SRAM (Static RAM)
Source: Cambridge
IGCSE and O Level Computer Science - Second Edition (Hodder Education)
Virtual memory
When RAM runs out of memory, there is a problem with memory
management; thus, the system has a high chance of crashing. This
is why virtual memory comes into the picture.
The virtual memory can be either HDD or SSD (these storages are
discussed below)
You may be expected to draw a diagram like the above.
The main advantages of virtual memory are
o They can be larger than the physical memory provided in the
RAM.
o Avoids the need to install/upgrade RAM, as it could be
expensive
o The system wastes no storage on unwanted/unused data.
Read Only Memory (ROM)
Features of ROM
o Non-volatile/permanent memories (contents remain even
when ROM is turned off)
o Used to store start-up instructions (basic input/output
systems)
o Data/contents of a ROM chip can only be read and cannot be
changed
Secondary Storage:
Hard Disk Drives (HDD)
Data is stored in a digital format on the magnetic surface of the
disks (platter)
A number of read/write heads can access all of the surfaces of the
disk
Each platter will have two surfaces which can be used to store the
data
Data is stored on the surfaces in sectors and tracks
HDD has very slow data access compared to RAM
Solid-State Drive (SSD)
There are no moving parts, and all data is received at the same time
(not like HDD)
Store data by controlling the movement of electrons within NAND
chips, as 1s and 0s
Non-volatile rewritable memory
Benefits of using SSD rather than HDD:
o More reliable (no moving parts)
o Considerably lighter (suitable for laptops)
o Lower power consumption
o Run much cooler than HDDs
o Very thin
o Data access is faster than HDD
Drawback – questionable longevity (20GB per day)
Off-Line Storage:
CD/DVD Disks
Laser (red) light is used to read and write data on the surface of the
disk.
A thin layer of metal alloy is used to store data.
Both systems use a single spiral track that runs from the centre of
the disk to the edge
DVD uses Dual-Layering, which increases the storage capacity (two
individual recording layers)
Blu-ray Disks
Uses a blue laser to carry out read-and-write operations
The wavelength of laser light is less than CD and DVD (stores up to
five times more data than DVD)
Automatically come with secure encryption (prevent piracy and
copyright infringement)
Used as backup systems
USB Flash Memories
Very small, lightweight, and suitable for transferring files
Small back-up devices for photo, music
Solid state, so needs to be treated with care
Cloud Storage:
Cloud storage is a method of data storage where data is stored on
remote servers
The same data is stored on more than one server in case of
maintenance or repair, allowing clients to access data at any time.
This is known as data redundancy.
The following are its types:
Public cloud – this is a storage environment where the
customer/client and cloud storage provider are different companies
Private cloud – this is storage provided by a dedicated
environment behind a company firewall; customer/client and cloud
storage provider are integrated and operate as a single entity
Hybrid cloud – this is a combination of the two above
environments; some data resides in the private cloud, and less
sensitive/less commercial data can be accessed from a public cloud
storage provider
Embedded System
A combination of hardware and software is designed to carry out a
specific set of tasks.
Embedded systems may contain -
o Microcontrollers - CPU, RAM, ROM and other peripherals on
one single chip
o Microprocessor - Integrated circuit with CPU only
o System on Chips (SoC) - microprocessor with I/O ports, storage
and memory
Process of Embedded Devices -
o Input from the user is sent to the microprocessor (ADC needed
if the data is analogue)
o Data from the user interface is also sent to the microprocessor
o The microprocessor then sends signals to actuators which are
the output
Non-programmable devices need to be replaced if they need a
software update.
Programmable devices have two methods of updating
o Connecting the device to a computer and downloading the
update
o Updating automatically via a satellite, cellular or Wi-Fi link
Advantages and Disadvantages of using embedded systems
Advantages Disadvantages
Small in size, therefore can
Can be difficult to upgrade
easily fit into devices
Low cost to make The interface can be confusing
Advantages Disadvantages
sometimes
Requires very little power Troubleshooting is a specialist’s job
Very fast reaction to Often thrown away as difficult to
changing input upgrade and faults are harder to find
Increased garbage as they are thrown
Dedicated to one task only
away
Any computerised system is prone to
Can be controlled remotely
attacks
Applications of Embedded devices
o GPS systems
o Security Systems
o Vending Machines
o Washing Machines
o Oven
o Microwave
Network Hardware
Network Interface Card (NIC)
A network interface card (NIC) is needed to allow a device to connect to a
network (such as the Internet).
Media Access Control (MAC)
A MAC address comprises 48 bits which are shown as six groups of
hexadecimal digits. The first six display the manufacturer’s code, and the
second half shows the device serial number.
These do not change and are primarily constant for every device
there are two types of MAC addresses: the Universally Administered
MAC Address (UAA) and the Locally Administered MAC Address (LAA)
The only difference between the two types is that UAA is made Universally
and cannot be changed, but it is the opposite for LAA.
IP Addresses
IP address allocation:
o The network allocates IP addresses.
o Two types of IP addresses: static and dynamic.
Static IP addresses:
o Assigned manually to a device.
o Does not change over time.
Dynamic IP addresses:
o Assigned automatically by a DHCP (Dynamic Host
Configuration Protocol) server.
o Changes periodically or when the device connects to a
different network.
IPv4 (Internet Protocol version 4):
o Widely used protocol.
o Consists of four groups of decimal numbers separated by dots
(e.g., 192.168.0.1).
o Provides approximately 4.3 billion unique addresses.
IPv6 (Internet Protocol version 6):
o Developed to address the limitations of IPv4.
o Uses eight groups of hexadecimal numbers separated by
colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).
o Provides an extremely large number of unique addresses
(approximately 340 undecillion).
Differences between IPv4 and IPv6:
o Address format: IPv4 uses a 32-bit address, while IPv6 uses a
128-bit address.
o Address space: IPv4 provides approximately 4.3 billion
addresses, whereas IPv6 offers around 340 undecillion
addresses.
o Address allocation: IPv4 addresses are allocated manually
using DHCP, while IPv6 addresses are primarily assigned using
stateless autoconfiguration.
Routers
Router functionality:
o A router is a networking device that directs data packets
between different networks.
o It determines the most efficient path for data transmission.
Sending data to a specific destination on a network:
o A router examines the destination IP address of incoming data
packets.
o It uses routing tables to determine the next hop or the next
router on the path to the destination.
o The router forwards the data packet to the appropriate next
hop.
Router's role in IP address assignment:
o A router can act as a DHCP server (Dynamic Host
Configuration Protocol) and assign IP addresses to devices on
a local network.
o It dynamically allocates IP addresses from a predefined range
to connected devices.
o DHCP allows for automatic IP address configuration and
simplifies network management.
Connecting a local network to the Internet:
o A router serves as the gateway between a local network and
the internet.
o It connects the local network to an internet service provider
(ISP) network.
o The router receives data packets from devices on the local
network and forwards them to the internet.
o It also receives incoming data packets from the internet and
routes them to the appropriate devices on the local network.
Types of Software and Interrupts
Types of Software
1. System Software e.g. Operating System, Utility programs and
device drivers
2. Application Software e.g. spreadsheet, word processor, etc.
System Software:
these are a set of programs which control and manage the
operations of hardware
gives a platform for other software to run
it is required to allow hardware and software to run without
problems
provides a human-computer interface (HCI) to the user
controls the allocation and usage of hardware resources
Application Software:
allows a user to perform specific tasks using the computer’s
resources
maybe a single program (for example, NotePad) or a suite of
programs (for example, Microsoft Office)
user can execute the software when they require, and it is mostly
not automatic
Examples
System Software:
Compiler: Translates high-level language into machine code,
allowing for direct use by a computer to perform tasks without re-
compilation.
Linker: Combines object files produced by a compiler into a single
program, allowing the use of separately written code modules in the
final program.
Device driver: Software that enables hardware devices to
communicate with a computer's operating system, without which a
device like a printer would be unable to work.
Operating system: Software that manages basic computer functions
such as input/output operations, program loading and running, and
security management, making computers more user-friendly.
Utility programs: Software that manages, maintains, and controls
computer resources by carrying out specific tasks, such as virus
checking, disk repair and analysis, file management, and security.
Application Software:
Word Processor: Software used for manipulating text documents,
including creating, editing, and formatting text with tools for
copying, deleting, spell-checking, and importing images.
Spreadsheet: Organizes and manipulates numerical data using a
grid of lettered columns and numbered rows, with each cell
identified using a unique combination of columns and rows. It can
calculate using formulas, produce graphs, and do modelling and
"what if" calculations.
Database: Software used to organize, analyze, and manipulate data
consisting of one or more tables that hold records and fields. It
provides the ability to query and report on data and add, delete, and
modify records in a table.
Control and Measuring Software: A program designed to interface
with sensors and allow a computer or microprocessor to measure
physical quantities and control applications by comparing sensor
data with stored data and altering process parameters accordingly.
Apps: Software designed to run on mobile phones or tablets,
downloaded from an "App Store" and ranging from games to
sophisticated software such as phone banking. Common examples
include video and music streaming, GPS, and camera facilities.
Photo and Video Editing Software: Software that allows users to
manipulate digital photographs or videos, including changing colour,
brightness, and contrast, applying filters and other enhancements,
and creating transitions between clips.
Graphics Manipulation Software: Software that allows the
manipulation of bitmap and vector images, with bitmap graphics
editors changing pixels to produce a different image, while vector
graphics editors manipulate lines, curves, and text to alter the
stored image as required.
Interrupts
An interrupt is a signal sent to the microprocessor, either from a device or
software, prompting the microprocessor to pause its ongoing tasks and
handle the interrupt temporarily. Various factors can trigger interrupts,
including:
Timing signals: Scheduled signals prompt the microprocessor to
pause and handle tasks at specific intervals.
Input/Output processes: Events such as a disk drive or printer
requiring additional data cause an interruption in the
microprocessor's activities.
Hardware faults: Issues like a paper jam in a printer, signalling the
microprocessor to halt its operations and address the hardware
problem.
User interaction: Instances like a user pressing specific keys on a
keyboard (e.g., ), leading to an interrupt in the system's operation.
Software errors: Problems such as missing .exe files needed to
initiate a program, conflicts like two processes accessing the exact
memory location, or attempts to divide by zero. These errors trigger
interrupts, prompting the microprocessor to handle the issues.
Source: Cambridge
IGCSE and O Level Computer Science - Second Edition (Hodder Education)
Utility Software
Computer users have access to utility programs as part of system
software
Utility programs can be initiated by the user or run in the
background without user input
Common utility programs include virus checkers, defragmentation
software, disk analysis and repair tools, file compression and
management software, backup software, security tools, and
screensavers.
Virus Checkers & Anti-Virus Software
Virus checkers or anti-virus software are important for protecting
computers from malware.
They should be kept up to date and run in the background to
maintain their effectiveness.
Anti-virus software checks files before they are run or loaded and
compares possible viruses against a database of known viruses.
Heuristic checking is used to identify possible viruses that are not
yet on the database.
Infected files are put into quarantine for automatic deletion or for
the user to decide.
Anti-virus software must be updated as new viruses are constantly
discovered.
Full system scans should be carried out regularly to detect dormant
viruses.
Disk Defragmentation Software
Defragmentation software rearranges the data blocks on a hard disk
drive (HDD) to store files in contiguous sectors, reducing head
movements and improving data access time.
As an HDD becomes full, blocks used for files become scattered all
over the disk surface, making it slower to retrieve data as the HDD
read-write head needs several movements to find the data.
When a file is deleted or extended, new data does not fill the vacant
sectors immediately, causing the files to become more scattered
throughout the disk surfaces.
A disk defragmenter rearranges the data blocks to store files in
contiguous sectors wherever possible, allowing for faster data
access and retrieval.
The defragmentation process can free up previously occupied
sectors and empty some tracks.
Backup Software
Backup software is a utility software that helps create and manage
backup copies of data files and programs.
Manual backups using memory sticks or portable hard drives are
good practices, but operating system backup utilities are also
recommended.
Backup utilities allow scheduling backups and only backup files if
changes have been made to them.
There could be three file versions for total security: the current
version stored on the internal HDD/SSD, a locally backed-up copy on
a portable SSD, and a remote backup on cloud storage.
Security Software
Security software is a utility software that manages access control,
user accounts, and links to other utilities such as virus and spyware
checkers.
It also protects network interfaces using firewalls to prevent
unauthorized access.
Security software uses encryption and decryption to ensure
intercepted data is unreadable without a decryption key.
It oversees software updates to verify legitimate sources and
prevent malicious software from being installed.
Access control and user accounts use IDs and passwords to secure
user data and prevent unauthorized access.
Screensavers
Screensavers display moving and still images on the monitor screen
after computer inactivity.
They were originally developed to protect CRT monitors from
'phosphor burn'.
Screensavers are now mostly used for customizing a device and as a
part of computer security systems.
They automatically log out of the user after a certain period of
inactivity.
Some screensavers activate useful background tasks like virus scans
and distributed computing applications.
Device Drivers
Device drivers translate data into a format that can be understood
by the hardware device they are associated with.
Without the appropriate device driver, a hardware device cannot
work with a computer and may not be recognised by the operating
system.
USB device drivers contain descriptors, which include a vendor ID
(VID), product ID (PID) and unique serial number that allow the
operating system to identify the device.
Serial numbers must be unique to avoid confusion if two devices
with the same serial number are plugged into a computer
simultaneously.
Operating Systems
Operating Systems are designed to establish communication
between the user and the computer
Functions of a typical operating system -
-managing files
– handling interrupts
– providing an interface
– managing peripherals and drivers
– managing memory
– managing multitasking
– providing a platform for running applications
– providing system security
– managing user accounts
WIMP - Windows, Icons, Menu, and Pointing Devices
Advantages and Disadvantages of CLI and GUI
Source: Cambridge
IGCSE and O Level Computer Science - Second Edition (Hodder Education)
Memory Management - Manages the RAM and the HDD/SSD during
the execution of programs
Security Management - Providing security features such as Anti-
Virus, System updates and so on
Hardware Peripheral Management - Managing the device drives,
Inputs, Outputs, Queues and buffers
File Management - Opening, Creating, Deleting, Renaming, and
many more functions
Multitasking - OS would share the hardware resources with each of
the processes
Management of User Accounts - OS would allow multiple users to
customise their accounts individually.
Running of Applications
The computer starts its OS (booting up the computer) through the
bootstrap loader.
The BIOS (Basic Input/Output System) tells the computer the
location of the OS in the storage.
BIOS is often referred to as the firmware
Interrupts
Signal that causes the operating system to stop what it’s doing and
service a task
Ensures important tasks are dealt with on a priority basis
It can be a software or a hardware interrupt
Peripherals like a keyboard & mouse can generate it
Different interrupts have different levels of priority
After interruption is dealt with, the previous process continues
Programming Languages, Translators and IDEs
Computers can only understand machine code; therefore,
translators are needed
High-Level Languages
It is easier to read and understand as the language is closer to
human language.
Easier to write in a shorter time
Easier to debug at the development stage
Easier to maintain once in use
Low-Level Languages
Refer to machine code
Binary instructions that the computer understands
Source: Cambridge
IGCSE and O Level Computer Science - Second Edition (Hodder Education)
Assembly Language
Few programmers use assembly language to -
o Make use of special hardware
o Write code that doesn’t take up much space
o Write code that runs very quickly
o Assembly language must be translated into machine code
using an assembler to run.
Translators
Compiler
Translates a program written in a high-level language into machine
code
Used without compiler
Executable file of machine code produced
One high-level language translated into several machine code
instructions
Used for general use
Interpreter
Executes a high-language program a statement at a time
No executable file of machine code produced
One high-level language program statement may require several
machine code instructions to be executed.
Interpreted programs cannot be used without an interpreter
Used when the program is being developed
Assembler
Translates a low-level language program into machine code
Executable file of machine code produced
One low-level language translated into one machine code
instructions
It can be used without an assembler
Used for general use
Compiler Interpreter Assembler
Translates a high- Translates a low-
Executes a high-level
level language level assembly
language program one
program into language program
statement at a time.
machine code. into machine code.
An executable file of No executable file of An executable file of
machine code is machine code is machine code is
produced. produced. produced.
One high-level
One high-level One low-level
language program
language statement language statement
statement may require
can be translated is usually translated
several machine code
into several machine into one machine
instructions to be
code instructions. code instruction.
executed.
Assembled
Compiled programs Interpreted programs
programs are used
are run without the cannot be run without
without the
compiler. the interpreter.
assembler.
Compiler Interpreter Assembler
An assembled
A compiled program An interpreter is often
program is usually
is usually distributed used when a program
distributed for
for general use. is being developed.
general use.
Source: Cambridge IGCSE and O Level Computer Science - Second Edition
(Hodder Education)
Integrated Development Environments (IDEs)
An IDE would usually have these features -
o Code Editor
o Translator
o Debugger
o Error Reports
o Auto-Completion and Auto-Correction
o Auto-Documenter
o Pretty Printing
Automated and Emerging Technologies
Automated Systems
Automated Systems are a combination of software and hardware
designed to function without human intervention.
Process of Automated Systems
o Sensors take inputs, and they are sent to the microprocessor.
The data is usually analogue, so it has to go through
Analogue-to-Digital Converter (ADC)
o The microprocessor processes the data and makes the
necessary decisions based on its program
o The actions are then executed by the actuators (Motors,
wheels and so on)
Advantages and Disadvantages of Automated Systems
Advantages Disadvantages
Faster and Safer Expensive to set up and maintain
Any changes can be Any computerised systems are prone to
identified quickly attacks
Less Expensive in the Over-reliance on automated systems may
long run cause humans to lose skills
Higher Productivity and
Efficiency
You should be able to describe the advantages and disadvantages
of an automated system used for a given scenario.
Including scenarios from:
industry
transport
agriculture
weather
gaming
lighting
science
Robotics
Robotics is the branch of computer science that combines robot
design, construction and operation.
Isaac Asimov’s Laws of Robotics -
o A robot may not injure a human through action or inaction
o A robot must obey orders given by humans unless it comes
into conflict with Law 1
o a robot must protect itself unless this conflicts with law 1.
Characteristics of a robot -
o Ability to sense their surroundings
o Have a degree of movement
o Programmable
NOTE - ROBOTS DO NOT POSSESS AI; THEY TEND TO DO
REPETITIVE TASKS RATHER THAN REQUIRING HUMAN
CHARACTERISTICS
Types of Robots -
o Independent - Have no human intervention; they can
completely replace humans
o Dependent - Needs human intervention through an interface,
can supplement but can’t completely replace humans
Advantages and Disadvantages of Robots
Advantages Disadvantages
Robots can find it difficult to do
Robots can work 24/7
non-standard tasks
Robots can work in hazardous Robots can lead to higher
conditions unemployment
They are less expensive in the Risk of deskilling as robots replace
long run humans in some task
They have high productivity and Expensive to install and maintain in
are more consistent the short run
Robots have the risk of getting
hacked.
Artificial Intelligence
AI is the branch of computer science that simulates intelligent
human behaviour.
Types of AI -
o Narrow AI - A machine has superior performance to a human
when doing one specific task
o General AI - A machine is similar to a human when doing one
specific task
o Strong AI - Machine has superior performance to a human in
many tasks
Characteristics of AI -
o Collection of Data and Rules
o Ability to Reason
Ability to learn and adapt
Types of AI
Expert System - AI that is developed to mimic human knowledge
and experiences. They are usually used for answering questions
using knowledge and inference.
They have many applications, including chatbots, diagnosis in the
medical industry, financial calculations and so on
Advantages and Disadvantages of Expert Systems
Advantages Disadvantages
Setup and Maintenance costs are very
High level of Expertise
high
High Accuracy and Can only rely on the information in the
Consistent system
Tend to give cold responses
High response times
sometimes
Machine Learning is a subset of AI in which machines are
trained to learn from past experiences.
Difference Between AI and Machine Learning
AI Machine Learning
Machines are trained to make
Representation of human
decisions without being programmed
intelligence in machines
to
The aim is to build machines The aim is to make machines learn
that think like humans through data acquisitions