0% found this document useful (0 votes)
5 views72 pages

Computer Science All In One Paper 1

The document is a comprehensive revision guide for Computer Science, covering key topics such as processor characteristics, software development, data exchange, and ethical issues. It details the structure and function of processors, types of processors, memory management, and various storage devices. Additionally, it discusses operating systems, scheduling algorithms, and the impact of technology on performance and efficiency.

Uploaded by

Jiminy Bob
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views72 pages

Computer Science All In One Paper 1

The document is a comprehensive revision guide for Computer Science, covering key topics such as processor characteristics, software development, data exchange, and ethical issues. It details the structure and function of processors, types of processors, memory management, and various storage devices. Additionally, it discusses operating systems, scheduling algorithms, and the impact of technology on performance and efficiency.

Uploaded by

Jiminy Bob
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 72

Computer

Science

All-In-One
Revision
Guide

Paper 1
Contents
1.1 Characteristics of contemporary processors, input,
1
output and storage devices
1.1.1 Structure and Function of a Processor 1
1.1.2 Types of Processor 8
1.1.3 Input, Output and Storage 10
1.2 Software and software development 12
1.2.1 Systems Software 12
1.2.2 Applications Generation 15
1.2.3 Software Development 18
1.2.4 Types of Programming Language 22
1.3 Exchanging Data 25
1.3.1 Compression, Encryption and Hashing 25
1.3.2 Databases 27
1.3.3 Networks 31
1.3.4 Web Technologies 37
1.4 Data types, data structures and algorithms 44
1.4.1 Data Types 44
1.4.2 Data Structures 52
1.4.3 Boolean Algebra 60
1.5 Legal, Moral, Cultural and Ethical Issues 66
1.5.1 Computing Related Legislation 66
1.5.2 Moral and Ethical Issues 68
1.1.1 Structure and Function
of a Processor
CPU (Central Processing Unit)
General purpose processors that execute instructions in a computer
system through the fetch-decode-execute cycle (FDE).

Each CPU consists of:


- An Arithmetic Logic Unit (ALU) - A Control Unit (CU)
- Registers -
Buses
Arithmetic Logic Unit
Control Unit (CU)
(ALU) Decodes and manages the
Carries out calculations and execution of instructions using
logical decisions. Results of control signals to coordinate
calculations are stored in the movement of data. Sends out
Accumulator (ACC). Calculations signals to coordinate how the
are completed using boolean processor works. Synchronises
logic operations such as AND, actions using inbuilt clock.
OR, NOT and XOR. Controls FDE cycle and buses.
Registers
Memory locations in the processor that temporarily store data and
control information. This provides faster access than RAM when
frequent access is needed during FDE cycle.

Program Counter (PC) – Holds the address of the next instruction


to be executed.
Accumulator (ACC) – Temporary storage of calculation results from
the ALU.
General Purpose Register (GPR) – Used to temporarily store
general data being used rather than sending data to and from slower
memory.
Memory Address Register (MAR) – Holds the address of a location
that is to be read from or written to.
Memory Data Register (MDR) – Temporarily stores data that has
been read or data that needs to be written.
Current Instruction Register (CIR) – Holds the current instruction
1
being executed, divided up into operand and opcode.
Buses
A parallel group of wires able to transmit data in groups of bits
together from one register to another in the processor.
Data Bus – Bi-directional bus (two way) used for transporting data
and instructions between components.
Address Bus – Used to transmit the memory addresses specifying
where data is to be sent to or retrieved from.
Control Bus – Bi-directional bus used to transmit control signals
between internal and external components. Coordinates the use of
the address and data buses and provides status information between
system
Controlcomponents.
Signals
Bus request: Shows that a device is requesting the use of the data
bus.
Bus grant: Shows that the CPU has granted access to the data bus.
Memory write: Data is written into the addressed location using this
bus.
Memory read: Data is read from a specific location to be placed
onto the data bus.
Interrupt request: Shows that a device is requesting access to the
CPU.
Fetch-Decode-Execute
Clock: Used to synchronise operations.
Cycle
The fetch-decode-execute cycle is
the sequence of operations that are
completed in order to execute an
instruction.
Fetch phase: - Address from the PC
is copied to the MAR.
- Instruction held at that address is
copied to MDR by the data bus.
- Simultaneously, the contents of
the PC are increased by 1.
- The value held in the MDR is
copied to the CIR.
Decode phase: - The contents of
CIR are split into operand and
opcode.
Execute phase: - The decoded 2
instruction is executed.
Assembly Language
Assembly code uses mnemonics to
represent instructions. This is a
simplified way of representing
machine code. The instruction is
divided into operand and opcode in
the CIR. The operand contains the
data or the address of the data upon
which the operation is to be
performed. The opcode specifies the
type of instruction to be executed.

Pipelining
The process of completing the FDE cycle of three instructions at the
same time, holding appropriate data in a buffer close to the CPU until
it is required. While one instruction is being executed, another can be
decoded and another fetched. Pipelining is intended to reduce the
amount of the CPU kept idle.
If branches are used, the efficiency of pipelining is reduced as the
next instruction cannot be fetched or decoded. If a branch occurs, the
pipeline must be ‘flushed’ to remove the data already fetched and
decoded that isn’t required for the branched instruction.

3
Factors Affecting CPU Performance
There are three factors that affect CPU performance: clock speed,
number of cores and the amount and type of cache memory.
Clock Speed
Determined by the system clock. All processor activities begin on a
clock pulse, and each CPU operation starts as the clock changes from
0 to 1. The clock speed is the time taken for one clock cycle to
complete. A faster clock speed means more operations can be
completed within a given time.
Number of Cores
A core is an independent processor that is able to run its own fetch-
execute cycle. A computer with multiple cores can complete more
than one fetch-execute cycle at any given time. However, not all
programs are able to utilise multiple cores efficiently as they have not
been designed to do so, so this is not always possible.
Amount and Type of Cache Memory
Cache memory is the CPU’s onboard memory. Instructions fetched
from main memory are copied to the cache, so if required again, they
can be accessed quicker. As cache fills up, unused instructions are
replaced.
Cache Memory
When an instruction, or set of instructions,
is frequently used during an operation, it is
costly for a processor to fetch these from
RAM. To overcome this, cache memory is
used to store the instructions that are likely L
to be called upon. As with RAM, cached 1
memory is erased when power is removed.
Most modern computer systems have three L2
levels of cache, with some now
incorporating a fourth level. Cache memory
acts as a way of passing data and L3
instructions progressively from the slowest
cache (L3/L4) to the fastest (L1).
Storing instructions in cache reduces the
amount of time it takes to access that
instruction and pass it to a CPU core.

7
Von Neumann
-Single processor CU manages program control.
-One instruction processed at a time using FDE cycle.
-Both data and instructions are stored together in the same format.
-Single set of buses used for instructions and data.
-Uses special registers within the CPU.
-Simple to program but slower when processing large amounts of
data.
Features of
Harvard Contemporary
Processors
-Separate memory for data and
instructions. -Two separate areas of memory.
-Separate buses so data can be -Different sets of buses.
read from/written to memory -Pipelining.
while next instruction is read -Use of Cache.
from instruction memory. -Virtual Cores.
-Multiple Cores.
-Onboard Graphics.

1.1.2 Types of Processor


CISC (Complex Instruction Set RISC (Reduced Instruction Set
Computer) Computer)
Complex processor design. Simple processor design.
Complex instructions take multiple Simple instructions take one
machine cycles. machine cycle
Larger number of instructions Limited number of instructions
available. available.
Instructions perform complex Instructions perform simple tasks.
tasks.
Doesn’t allow pipelining. Allows pipelining.
Single register set Many register sets.
Many addressing modes. Fewer addressing modes.

8
Instructions have variable format. Instructions don’t have variable
format.
Programs run more slowly. Programs run more quickly.
Expensive due to integrated Cheaper due to simple circuitry.
circuitry.
Used by desktops and laptop Complex tasks only performed by
computers. combining multiple instructions
taking multiple machine cycles and
GPRs reduce need to constantly
send data to and from memory.
Used by smartphones and tablets.

GPU (Graphics Processing Unit)


Specifically designed to perform calculations associated with graphics
eg. High quality 3d graphics in simulations. GPUs have an instruction
set bespoke to these calculations. Has a parallel architecture to allow
for multiple tasks to be carried out at the same time – increases
speed of carrying out calculations. Can be used for non-graphical use
– eg. Performing complex numerical calculations or calculations on
matrices.

Multicore Systems Parallel Systems

Multicore processors have more Parallel Processing is where


than one processor incorporated multiple computations are carried
into a single chip to distribute the out by the computer
workload across multiple cores to simultaneously to solve a given
achieve a higher performance. problem by SIMD and MIMD. Not
suited to all problems as most only
partially parallelisable and writing
algorithms is more challenging.

SIMD MIMD

Same instruction applied to Different instructions applied to


multiple data simultaneously. different data concurrently.

9
1.1.3 Input, Output, Storage

Input Devices Output Storage


Hardware used to Devices Devices
put data in Hardware used to Non-volatile
computer. get info from peripheral that
Eg: computer. stores data.
-Keyboard Eg: Eg:
-Camera -Screen/monitor -HDD
-Microphone -Speaker -SDD
-Mouse -LEDs -CDs
-Printer -Flash memory drive
Magnetic Storage Devices
Uses magnetisable material and works by reading magnetic patterns
off platters that mechanically spin at high speeds. Can be noisy and
susceptible to damage. High capacity at low cost e.g. HDD and
magnetic tape used to backup servers.

Flash Memory Storage Devices


Solid State technology where data stored using memory chips.
Contents can be erased and overwritten when electrical charge
applied. No moving parts so requires less space and portable. R/W
speed faster and consumes less power than magnetic or optical
media but more expensive.

10
Optical Storage Devices
Works by using a laser to look at its reflection and read if the area on
the surface is a ‘pi’ or a ‘land’. Can write data using a laser to create
pits Cheap to distribute and resilient e.g. CD, DVD, Blu ray discs.

RAM (Random Access ROM (Read Only


Memory) Memory)
Primary Memory. Volatile, editable, Non-volatile, unalterable,
large. Stores apps software, OS, user small. Stores BIOS bootstrap
files currently in use and allows the program so immediately
user to alter contents. Offers fast available when computer
and direct access to data. Faster R/W turned on as is already
speed than storage devices and present in memory.
Virtual Storage
reduces buffering.
Virtual Storage is the combination of physical storage devices into a
single remote virtual storage software/device that is accessible
anywhere so no need to hire specialist staff, back up or security.
Often used for backups as data is stored remotely and so in case of
disaster, data is not damaged. Storage can be expanded, when
necessary, no limit on size. Speed of access is not priority for
backups. No physical space needed and no on-site maintenance
required.

11
1.2.1 Systems Software

Operating Systems
Functions of an operating system:
-Provide a user interface. -Provide system security.
-Manage hardware/peripherals. -Provide utilities for system
maintenance.
-Manage CPU usage. -Provide platform
to install/run software.
-Schedule jobs. -Handle interrupts.
-Manage
Memory memory.
Management -File management.
Memory Management organises use of main memory to enable
sharing by partitioning, allocating and reallocating memory when
necessary. Allows programs larger than main memory and separate
processes to run at the same time. Ensures no space is wasted by
converting logical addresses to physical addresses. Protects OS and
programs from accessing each other’s memory unless required.

Paging
Partitions memory into fixed size physical
divisions made to fit sections of memory
to allow programs to run despite
insufficient memory. Uses physical
addressing. All pages same size but
contents may not fill the page making it
less efficient due to wasted space.
Programs can be held in con-contiguous
locations (virtual addressing).

Segmentation
Partitions memory into variable
sized logical divisions holding
complete sections of programs
according to their function. Uses
logical addressing. Causes
fragmentation as more programs
are loaded into smaller segments.

12
Virtual Memory
Virtual Memory holds the part of the program not currently in use to
allow large programs to run when insufficient memory available. Uses
a backing store as additional memory and swaps pages between the
main memory and an area of a secondary storage device to make
space for pages needed. May cause disk thrashing when more time
spent transferring pages than processing causing computer to hang.
ISR (Interrupt Service
Interrupts
Signal to processor Routine)
causes a break in the Interrupt Register checked when the
execution of a current current FDE cycle is completed by
routine to obtain comparing the priority of the incoming
processor time, interrupt and the current task with the
indicates a process or a Interrupt Register. Contents of registers
device needs servicing are stored in a LIFO stack in the memory.
for a higher priority Location of the relevant ISR is loaded by
task to take precedence loading the relevant value into the PC.
to avoid delays and When the ISR is complete, flags are reset
data loss and use the to an inactive state, further interrupts are
processor efficiently. checked and serviced if necessary and the
previous state is popped from the stack
and loaded back into registers to resume
processing.
Scheduling
Scheduler is a program that processes the maximum number of jobs
in the least possible time and ensures all jobs are processed fairly, so
long jobs don’t monopolise the processor. Changes priorities where
necessary and maximises interactive users with fast response times
and no apparent delay. Utilises resources and processor time
efficiently depending on priorities.

Round Robin First Come First


Pre-emptive scheduler allocates Served
each user a small time slice in turn Jobs processed in order of
and at the end of each slice it moves arrival so others are queued
to the next user and jobs go to the up for their turn.
back of the queue. Repeats for all Can waste processor
users. Order may depend on user time if a job is using
priorities but users are unaware of a slow resource.
any delays.

13
Multilevel Feedback
Shortest Job First
Queues Picks job with the
Uses a number of queues each with shortest time and
different priorities. runs until finished.
Algorithm can move Shortest Remaining
jobs between queues
depending on the jobs
Time
Scheduler estimates the
behaviour.
length of each process then
Scheduling Algorithms picks the one with the least
Some scheduling algorithms can amount of time and runs that
cause starvation (ie. Jobs that never but
get processed). More complex if job added with
algorithms take up lots of processing shorter time it
time for the scheduling itself, taking switches to that one.
away time from the actual job.
Types of Operating Systems
Distributed - Shares processing between multiple computers to
work together as a single system.
Embedded - Built into device with limited resources.
Multitasking - Runs multiple programs apparently simultaneously
using separate windows for each task. Each receives a slice of
processor time before going onto the next task. User can switch
between programs.
Multiuser - One computer with multiple terminals each given a small
time slice in turn. Allows multiple users to access computer resources
at the same time using flags and priorities and separating user data
and rights.
Real Time - Data processed immediately with no delayDevice
guaranteeing
BIOS within
response (Basic Input/Output Drivers
a given time frame.
System) Device drivers are
Stored in ROM. Gets computer up and running software supplied
when first switched on. Processor PC points to with devices which
BIOS memory which checks if the computer is contain
functional, memory installed and accessible instructions to the
and processor working. Stored on flash memory OS using the
so can be updated and allows settings e.g. boot peripheral to
order of disks to be changed and saved by the enable
user. Without BIOS, the computer would be communication
unusable. and configure
hardware.

14
Virtual Machines
Theoretical computer provides environment in which translator
available. Uses interpreter to run intermediate code which can then
run off any computer with virtual machine. Slower than compiler and
has limited access to low level features e.g. GPU access. Used to run
an OS inside another when testing program compatibility.
Intermediate Code
Partly translated simplified code between high level and machine
code produced by a compiler. Runs on any computer using an
interpreter improving portability between machines. Same code can
be obtained from different High-Level Languages. Allows sections of
code to be written in different languages by different programmers.
Suitable for specific tasks as is error free and protects intellectual
property. Needs translation and additional software each time to run
so slower than exe code.

1.2.2 Applications Generation

Applications Software
Collection of compatible software complete with electronic or hard
copy user guides that allow the user to perform a task or produce
something useful e.g:
Word processors – Creating letters/documents/invoices.
Spreadsheet packages – Completing accounts, allowing for
recalculations and fewer mistakes.
Presentations software – Create/show business plans.
Desktop publishers – Creating marketing literature.
Graphics packages – Editing photographs/marketing photos.
Email software – Staff communication with one another or
customers.
Web browsers – To view websites to purchase stock/view
competitor’s websites.

15
Utilities
Relatively small housekeeping programs that perform specific tasks
to do with the maintenance of the system. Eg:
Disk Defragmenter – Optimises storage by storing file segments
contiguously to optimally read/write to the disk.
Firewall – Hardware/software that monitors and filters/blocks
traffic/packets going to and from a network. Protects organisation’s
data/intellectual property and prevents unauthorised access to a
network.
Compression Utility – Reduces size of files.
Anti-virus/malware checker – Find and removes/quarantines
viruses/malware.
File Manager – Allows files and directories to be moved, copied,
deleted and renamed. Allows easy access to the file system.
System Clean-up – Keeps system free of redundant files.
OpenDrivers
Disk Source Software
– Allow Closeddevices.
use of new peripheral Source Software
(OSS) (CSS)
Software with the source code Propriety software with the
freely available allowing others source code not available but
to make amended versions and provides automatic updates and
contribute to the program’s support. Usually costs to
development. Usually free of purchase license with no
cost. Can tailor the program to permissions for adapting the
user’s specific needs. program. Likely to be compiled.
E.g. Linux, Libre Office, Fireworks E.g. Linux, Libre Office, Fireworks

Translators
Converts code from one language to another i.e. from source code to
object code and detects errors in source code.
Interpreter – Interprets and runs high level code by translating one
line then runs before the translation of the next. Reports one error
then stops to indicate the position. Must be present each time the
program runs so slow due to translation but is machine independent.
Used with virtual machines and during program development.
Compiler – Translates the whole High Level Language program to
machine code as a unit. Creates .exe program when completed so
quicker. Easier to get access to lower level features e.g. GPU access.
Protects program from malicious use and preserves intellectual
property. Compiled code is not human readable and is architecture
specific. Gives a list of errors at the end of compilation which may be
spurious. Optimises to improve program speed and is no longer
needed once the .exe code is produced.
16
Translators cont.
Assembler – Program translates assembly code into machine code
by reserving storage for data/instructions, replacing mnemonic
opcodes by machine code and symbolic addresses by numeric
addresses, creates a symbol table to match labels to addresses,
checks syntax, gives a list of errors and offers diagnostics at the end.

Stages of Compilation
Lexical Analysis – White space and comments are removed.
Converts reserved words into a series of tokens. A symbol table is
used to store info about variable names and subroutines. Error
diagnostics are given to prepare the code for syntax analysis.
Required to put the code into a format which can be read and
processed by the syntax analyser.
Syntax Analysis – Accepts output from lexical analysis and checks
program is syntactically correct against the rules about the structure
of programming language. An abstract syntax tree is built and
diagnostics are given and if no errors the code is passed to code
generation. Required to ensure the code meets the structural rules of
the language, guaranteeing it will run.
Code Generation – Abstract syntax tree tree is converted to object
code by producing the machine code equivalent to source program.
Variables are given addresses and relative addresses are calculated.
Required to turn the code into a format the processor can understand.
Optimisation - Object code checked and made as efficient as
possible increasing processing speed by reducing the number of
instructions. Programmer can choose between size and speed. Whilst
notLinkers
required, ensures code runs quicker.
Loaders Libraries
Links compiled Part of the OS that Pre-written code that
program code loads the exe program performs common tasks
with complied and associated e.g. searching or sorting as
library code all libraries into the it is already available and
into one exe memory and handles tested so error free,
program. addresses before the reliable, reduces repeated
Required to program runs. Relative code saving amount of work
ensure the library addressing – loader and time, can be used
code is places program into multiple times, written in
incorporated into any location with different source languages
the final program. enough space. allowing programmers to
Alternatively, Absolute addressing – use others’ expertise and
dynamic linking places program into modules can be shared to
can be used to specific locations if make programs shorter.
17
link to libraries they are free.
(allows for easier
1.2.3 Software Development

Developmental Definitions
Feasibility Study – Analysts carry out initial enquires to decide if the
problem is realistically solvable before production by considering
parameters e.g. budget, time, work force, economic, environmental,
legal, social and technical feasibility to revise plan if the study
highlights problems.
Requirements Specification – Specification document developed
between the client and the software developers that unambiguously
states everything the new system is expected to do e.g. Input/Output,
processing, client agreement and hardware/software requirements.
User Documentation – Ensures the user can use the system so
contains info e.g. contents, index, glossary, trouble shooting, help,
contacts, warranties, FAQs etc.
Technical Documentation – Explains how the system works
allowing it to be maintained and further developed in the future e.g.
Data Flow Diagrams, System Flow Charts, Flow Charts, ERDs.

Waterfall Cycle
Consists of a series of linear
stages presented in order that
need to be completed to produce
the working system. Requirements
are established in the early stages
and are focussed on by the
subsequent stages. Each stage
feeds info into the next. May be
necessary to return to one or more
stages to collect more info or
check on data collected. After
returning, all intervening steps are
revisited to improve the solution.

18
Waterfall Lifecyle Pros Waterfall Lifecyle Cons

Tends to suit large scale projects Inflexible as dependent on clear


with stable requirements. requirements.
Ideal for supporting inexperienced Produces excessive documentation
teams. so time consuming.
Orderly sequence ensures quality Missing components discovered
documentation with reliability and during design and coding.
maintainability of system.
Progresses forward with slight System performance can’t be
‘splash back’. tested until system is almost fully
coded.
Progress easily measurable.

Agile Development
Group of methods designed to cope with changing requirements
through producing software in iterative versions each building on the
previous and increasing requirements met. So, if seeing a version the
user realises a requirement is not fully considered, they can add it in
a future iteration.

Extreme
Programming
An agile iterative approach
where program is coded,
tested and improved
repeatedly. A representative of
the customer becomes part of
team to help decide
requirements and tests used to
ensure they are correctly
implemented and answer any
questions about any problem
areas the programmers might
have.

19
Extreme Programming Pros Extreme Programming Cons

New requirements can be adopted Emphasis on coding instead of


as end user integral throughout. design so lack of documentation.
Paired programming used to Client must ensure they are
ensure code in each iteration is of represented on the team to accept
good enough quality completed code and discuss any
potential changes.
Final product well tested, efficient Unsuitable for larger projects.
and robust.
Created quickly so modules
become available for use by client.

Spiral Model
Progresses by evaluating and
dealing with risk. Analyst begins
by collecting data followed by
other stages leading to
evaluation leading to a return to
data collection to modify results.
Riskiest parts of project
identified and dealt with first.
Different stages refined with
each spiral iteration until project
complete.

Spiral Model Pros Spiral Model Cons

Large risk analysis ensures issues Risk analysis needs highly skilled
are addressed early in team.
development.
Used where risks involved e.g. Costs high due to number of
mission critical projects, games. prototypes created and increased
customer collaboration.

20
Rapid Application Development (RAD)
A prototype design with reduced functionality is produced to a set
deadline and is tested and evaluated to refine the design of the next
prototype using feedback from users. Cycle is repeated with each
iteration improving the program until the prototype is accepted and
the final product is produced.

Rapid Application Development Rapid Application Development


Pros Cons
Something can be seen working Speed may impact overall system
early in the project so cheaper. quality and consistency of designs
as lacks admin and documentation.
End user more involved. Not suitable for safety critical
systems.
Can change requirements as
product becomes clearer.
Concentrates on essentials needed
for user so overall development
time quicker than alternative
methods.
Used where requirements not well
defined and development team
authorised to make design
decisions without need for detailed
Black box
consultation Testing
with senior managers. White box Testing
Sets of different possible inputs Uses the source code to test the
are tested against the expected actual steps of the algorithm to
output according to the design ensure all parts work as
so need to test all situations intended by checking every
without considering how the possible path and condition
program works. statements with dry runs and
trace tables. 21
Alpha Testing Beta Testing
Testing is carried out by Nearly complete program is
programmers within the software tested by 3rd party users under
company playing the role of the normal operating conditions to
user during development to find aim to find any bugs the
bugs in the program. programmer overlooked to make
the final version more robust.

1.2.4 Types of Programming


Language

Need for a Variety of Programming Paradigms


High level languages come in a variety of paradigms so programmers
can choose according to the problem. A language is referred to as
“Turing Complete” if it can solve all the problems it has been proved a
computer can solve.

Procedural Languages
High level imperative languages which use sequence, selection and
iteration. The program states what to do and how to do it with a
series of statements in a specific order. Breaks down the solution into
subroutine blocks which are rebuilt and combined to form the
program. Logic of the program is given as a series of procedure calls.

Assembly Language
Machine specific Low Level Language (LLL). It is at a higher level and
is easier to write than machine code but is more difficult than High
Level Languages (HLLs). Uses descriptive names for data stores,
mnemonics for instructions and labels to allow selection. Each
instruction is translated into 1 machine code instruction. May use
macros.

22
LMC is a fictional processor designed to illustrate the principles of
how processors and assembly code work.

Mneumoni Example
Function Explanation
c Instruction
Add the contents of n to the
ADD Add ADD n
ACC
Subtract the contents of n
SUB Subtract SUB n
from the ACC
STA Store STA n Store the number n
Load the contents of n into
LDA Load LDA n
the ACC
Branch Unconditional jump to number
BRA BRA number
Always label
Branch if Jump to number label if ACC
BRZ BRZ number
Zero contents is zero
Branch if Jump to number label if ACC
BRP BRP number
Positive contents is positive
Prompt for a number to be
INP Input INP
input
Outputs the contents of the
OUT Output OUT
ACC
End
HLT HLT Stops program execution
Program
Data Creates data location n and
DAT N DAT 10
Indirect
Location Indexed
stores Addressing
the number 10 in it
Immediate Modifies the address
Addressing Addressing given by adding the
Uses the address field number from the Index
Data in
as a vector to the Register to the address
operand is the
address to be used. in the instruction. Allows
value used by
Used to access library efficient access to a
the operator
routines as it increases range of memory
and is added
the size of the address locations by
to the value in
that can be used incrementing the value
the ACC. Used
allowing a wider range in the Index Register e.g.
in assembly
of memory locations to used to iterate through
language.
be accessed. an array.
23
Direct Addressing
Simplest method of addressing uses data in operand without
modification as the address of the data and adds it to the value in
ACC. Memory locations that can be addressed are limited by the size
of the address field as the code is not relocatable. Used in assembly
language.

Object Oriented Languages (OOP)


OOP is where programs are built by considering components as
objects that interact with each other.
Class - Template to construct a set of objects that have state and
behaviour defines methods and attributes an object should have.
Object – Self-contained instance of a class made from attributes and
methods.
Method – Subroutine that forms the actions an object can perform.
Constructor – Method describes how an object is created.
Attribute – Value stored in variable associated with an object.

Inheritance Encapsulation Polymorphism


When a class Applies the same
the process of hiding
takes all the method to objects
data within objects to
methods and of
keep attributes private.
attributes of its different types as
Private attributes are
parent class, they are treated in
only accessed and
may override the same way.
changed via public
some of these Code written is
methods defined for
and has able to handle
class to maintain data
additional extra different objects in
integrity. Objects only
methods and the same way to
interact in the way
attributes of its reduce the volume
intended and prevents
own. The class produced e.g.
unexpected changes to
code is used as a apply same
attributes having
base for similar method to array
unforeseen
objects to save with objects of
consequences.
time. different classes.

24
1.3.1 Compression,
Encryption and Hashing
Compression
Necessary to reduce file sizes and time taken for data transmission by
considering available bandwidth, expected processing power and
storage requirements of the user’s computer. Allows files to download
quicker.
Lossy Compression
Where the algorithm makes the Lossless Compression
file size smaller by removing Where files are stored and
data. Lost data is not transmitted intact. The algorithm
recoverable, so accuracy is used retains all info in the file
reduced as it assumes there is while reducing the size so the
enough data remaining to be original can be reconstructed
acceptable. Used for sound and from the data e.g. ZIP, GIF, PNG,
image files e.g. JPEG, MPEG, program code.
MP3.
Run Length Encoding
(RLE)
Where a dictionary is used to
store items e.g. pixels, words,
bits. Repeated occurrences are
stored in a dictionary/table with
the number of occurrences. Used
in TIFF, BMP files. Not suited for
natural language.
Dictionary Coding
Where a compression algorithm
searches through a text to find
suitable entries in a known/own
dictionary and translates the
message accordingly, used in ZIP,
GIF, PNG files.

25
Encryption
Used when transmitting info on networks as data can be intercepted.
Important in VPNs as numerous users share a physical network.

Encryption Keys
Long random numbers needed to encrypt and decrypt a message.
The public key is available to all but private key confidential to owner.

Symmetric Encryption
Where the same key is used to encrypt and decrypt. Requires both
parties to have a copy of the key. Can’t be transmitted over Internet
as eavesdropper monitoring message may see it.

Symmetric Encryption
Where different keys are used to encrypt and decrypt using
public/private keys so it is more secure.

26
Hashing
Algorithm used to transform data e.g. network passwords stored in
abbreviated form. Has low chance of collision, quicker to calculate
and compare than bitwise comparison, provides smaller output than
input, difficult to regenerate original from hash value but easy to
check but vulnerable to brute force attacks. One way so can’t be
reversed.

1.3.2 Databases
Database
Structured non-volatile store of data for ease of processing by
allowing data to be retrieved quickly, updated easily and filtered for
different views.
Relational Database
Based on linked tables to avoid data duplication, inconsistency,
redundancy and improve data integrity and security. Easier to add
and change data, data format and control access.

Flat-file Database
Simple data structure that is easy to maintain but of limited use due
to data inconsistency, duplication and redundancy.

Primary Key Foreign Key


A unique identifier used to When a primary key in one table is
define every record in a used as an attribute in another.
table. Provides links between tables and
represents 1-m relationship to avoid
data duplication.

27
Secondary Key
an alternative index that takes up extra space in a database. It allows
tables to be sorted and searched quickly and differently from the PK
based on different attributes. When data tables changed, indexes
rebuilt.
Entity Relationship Diagram
Necessary when planning a relational database using diagrams to
show relationships between tables. Helpful in reducing redundancy.

Serial File
Where records are stored chronologically and new records are always
appended to existing records. Simple short file, easy to implement as
adding and searching records easy but slow as all preceding records
must be searched to access a record.

Sequential File
Sequentia Indexed Sequential File is where records are sorted
according to a primary key. A separate index is kept
l File allowing groups of records to be accessed directly
Serial file and quickly. Data needs to be inserted in the correct
where data is position and indexes updated to keep in sync with
sorted data. The file is difficult to manage but accessing
according to a specific records faster as sequential search from the
key field. beginning is not needed. More space efficient so
suited to large files.
Database Management System
Software that:
- Creates, maintains and handles complexities of managing a
database.
- Provides user interface, different views of data for different users,
security features.
- Creates queries, views, tables, interfaces and outputs.
- Finds, adds and updates data.
- Maintains indexes, enforces data integrity rules, manages access
rights and uses SQL to communicate with other programs.
Queries – Isolates and displays subset of data e.g. QBE.
C – Create, R – Read, U – Update, D - 28
Delete
Normalisation
Formal and methodical process that resolves many-many
relationships to design data tables optimally by going through distinct
stages leading to at least 3NF. Minimises repetition to reduce data
redundancy and ensure all attributes in a table depend on one
another to avoid the need to update multiple data entries when
changing a single attribute to reduce chances of mistakes.

2NF 3NF
Non-key
1NF Removes data items
dependencies
Separates out occurring in multiple
removed to their
multiple items/sets rows into a new
own linked tables so
of data in a row. table linked by
every field/attribute
repeated fields.
definable by key.

SQL
A declarative database language that allows the creation,
interrogation and alteration of a database.
Structur Example Explanation
e
SELECT SELECT “X” Extracts data from field “X”
FROM FROM “tbl” Lists data from table “tbl”
WHERE WHERE “Y” = “X” Adds conditions to list “Y” where it
equals “X”
LIKE “Y” LIKE “X” Matches “Y” when similar to “X”
AND “X” AND “Y” < 1 Both “X” and “Y” must be < 1
OR “X” OR “Y” > 0 Either “X” or “Y” must be > 0
DELETE DELETE FROM “tbl” Removes rows of data from table
“tbl”
INSERT INSERT INTO “tbl” Adds data to table “tbl”
DROP DROP TABLE “tbl” Removes table “tbl”
JOIN “tblx” ON Joins tables “tblx” and “tbly” to
JOIN “tbly” return linked data
SELECT * FROM Extracts everything from table
* “tbl” “tbl”
“X” LIKE “%Y” Extracts 1 or more characters
% 29
when “X” is like “Y”
SQL Examples – Movie Table
MovieID MovieTitle MovieCompa YearPublishe DirectorNam
ny d e

M0001 Howdy Partner! Cowboys Inc 2001 James

M0002 Okay Samantha, Sadboys Inc 2001 Joseph


just leave.
M0003 Bye Bye Bucky Cowboys Inc 2004 Jeremy

M0004 My wife left me for Sadboys Inc 2004 James


my dog...
M0005 Cars, Girls, and Rappers Itd 2012 James
Money.
M0006 Water Bottle Sadboys Inc 2015 Jeremy
Sadness

SELECT UPDATE
SELECT MovieTitle, UPDATE Movie;
YearPublished; SET MovieID = ‘M0008’,
FROM Movie; YearPublished = 2005;
WHERE YearPublished > 2004; WHERE MovieID = ‘M0003’;
ORDER BY YearPublished;
INSERT INTO
INSERT INTO Movie(MovieID, MovieTitle, MovieCompany,
YearPublished, DirectorName);
VALUES (M0007, New Film on the Block, Rappers ltd, 2024,
Jackson);
DELETE DROP
DELETE FROM Movie;
DROP TABLE Movie;
WHERE DirectorName =
‘Jeremy’;
JOIN
SELECT Movie.MovieTitle,
Director.DirectorName;
FROM Movie;
JOIN Director
ON Movie.DirectorName =
Director.DirectorName
Referential Integrity
Keeping a database in a consistent state. Enforced by DBMS
so data changed in one table considers data in linked tables
e.g. can’t delete data linked to existing data in another table. 30
Transaction Processing
Transactions are changes in the state of a database e.g. addition,
deletion, alteration of data and conforms to ACID rules.
Atomicity: Succeed or fail but never partially succeed.
Consistency: Only changes database according to rules of database.
Isolation: Transaction protected against others concurrently being
processed.
Durability: Change preserved no matter what happens.
Record Locking
Prevents simultaneous access to
objects in a database to prevent
Data Redundancy
Unnecessary repetition of data
updates being lost or
that leads to inconsistencies and
inconsistencies in data. Record
space wasted but allows data to
locked whenever a user
be recoverable if part of the
retrieves it for editing or
database is lost. Provided by
updating so others are denied
RAID setup or mirroring servers.
access until the transaction is
completed or cancelled. Can
cause deadlocking.

1.3.3 Networks

Protocols
A set of rules governing network communication between devices
e.g. TCP/IP developed for the Internet.

IP Address
Is a numerical address is made of 4 numbers each between 32
hexadecimal digits that uniquely identifies a device on a network and
is a logical identifier used to route messages.
Static Addressing – IP addresses assigned permanently to a device.
DHCP – IP addresses automatically assigned as needed.
Subnet – Have own IP addresses to conserve addresses.

31
MAC Address
A 48-bit address which is a unique identifier associated with the
network interface. Provides addressing capability in a network usually
assigned by the manufacturer.

Bus Topology
Nodes attached to a single
backbone. Vulnerable to
breakages and prone to data
collisions so uncommon.
Terminators remove unread
messages
+ -
Relatively inexpensive to set up If backbone cable fails, the entire
network gets disconnected
Doesn’t require additional As traffic increases, performance
hardware decreases, potential for collisions
All computers can see the data
transmission

Ring Topology
Each node connects to exactly 2
other nodes. Data frames are
sent in one direction minimising
collisions but is easily disrupted.

+ -
Simple to set up If one node breaks the entire
network goes down
Cheap to install Requires extensive preventative
maintenance and monitoring
Suitable for small businesses Performance declines rapidly with
each additional node
Low incidence of collision Reorganizing the network requires
a full system shutdown
32
Star Topology
Layout for most networks
characterised by a separate
physical link from each node to a
switch or hub so resilient.

+ -
Easy to manage from one point – Requires specialist network
the switch hardware (the switch)
Easy to add and remove nodes Makes the network reliant on the
switch’s performance
Durable A finite number of switch ports
limits the network’s size
Low cable usage

Mesh Topology
Layout for most networks
characterised by a separate
physical link from each node to a
switch or hub so resilient.

+ -
High speeds data transfers Requires a very large amount of
cable
Durable network that isn’t Can be difficult to secrete all the
dependent on any one node cable
Very secure Takes a long time to set up

Easy to identify faulty equipment Requires meticulous planning

Layering
A form of abstraction that divides a complex system into its
component parts to allow work to be done piecemeal. Efficient in
problem solving as each problem dealt in isolation. Used in networks
as each layer communicates only with the adjacent layers.

33
DNS
Hierarchical system for naming
resources on a network providing
human readable equivalents to IP
addresses. Domain name sent to
DNS servers which map to IP
address and if server can’t resolve
it passes request recursively to
another server which sends IP
address to browser so it can
retrieve website hosted from
OSI Modelserver.
Non-proprietary network model provides 7 layers where top layers are
closer to the user and the bottom layers are closer to physical
transmission.
Layer Name Function

Collecting, packaging and delivering data to and


7 Application
from users.
Presentatio Data conversions.
6
n
5 Session Manages connections.

Packetizing, checking, establishing and


4 Transport
terminating connections via routers.
Transmission of packets, routing from sender to
3 Network recipient, IP addressing and direction of
datagrams.
Access control, error detection and correction,
2 Data Link
passing datagrams to physical devices.
Network devices and media that provides
1 Physical
connections.
TCP/IP
Suite of protocols cover
data formatting,
addressing, routing and
receiving. Equivalent to
layers 7,4,3,2 of OSI
model.

34
WAN
A network over a geographically remote distance. Uses a modem to
act as a gateway and different forms of communication media
supplied by a 3rd party e.g. telecoms. Data is subject to interception
and computers have own peripherals instead of sharing.

LAN
A group of shared computer devices connected over small
geographical area using hardwired/wireless communication.
Infrastructure is owned by the network owner so more secure and
requires no extra communication devices.

PAN
Smallest type of network, consisting of connected devices that are in
close proximity to an individual. Usually Bluetooth.

Data Packet
An equal sized block of
data where the
structure is defined by
the protocol used. 3
parts: Header –
sender/receiver IP
address, protocol,
packet number and
order. Payload - Data
transmitted. Trailer –
End of packet marker
and error correcting
codes.
Packet Switching
Connectionless mode. The message is divided into packets which
take the most convenient route as no established route from source
to destination. Secure as message can’t be intercepted and avoids
message failure if route disrupted. Allows efficient use of a network
as each channel only used for a short time. Packets arrive out of
order so must be reordered at destination and only as fast as slowest
packet. Error checking promotes successful transmission so used by
TCP/IP.

35
Circuit Switching
3 phases: connection establishment, data
transmission and connection termination.
Connection mode so devices remain
connected for duration of data
transmission. Route established so all
packets sent down circuit on same route
but message can be intercepted if route
tapped into. Packets remain in correct
order but must be reassembled. Ties up
large areas of a network so no other data
can use any part of the circuit until
transmission complete.

Firewall Proxy SSL


Computer placed
Application controls Protocol that
between network
traffic in and out of enables encrypted
and remote resource
a network to links between
that intercepts traffic
prevent access to computer systems
and isolates network
system by to stop 3rd party
from the outside
unauthorised access.
world.
sources.
Network
Router Gateway
Switch Provides a link
Connects devices in A device that
between two
a network to each receives packets
dissimilar networks
other, enabling from other
by translating
them to talk by computers and
protocols.
exchanging data routes them to the
Client - Server next step.
packets. Peer-to-peer
Client computer requests service All computers have equal status
from high end computer server so can act as client or server or
that provides services e.g. file both. Useful on Internet as traffic
and print, web email, data can avoid servers so is private.
processing and storage. Client Doesn’t rely on company
code less complex so can be servers’ connection to the
implemented on multiple Internet so faster. No need to
platforms. Servers can be buy expensive hardware or
upgraded to fix security bandwidth so cheaper and
problems and provide more system is more fault tolerant.
features. Centrally administered
in one location – one location to
backup. Server
36
A device which provides a central point of
control/access.
1.3.4 Web Technologies
HTML (Hyper Text Mark-up Language)
The standard for making webpages and text files using tags to attach
to items affecting how they are rendered by describing the structure
and order of the content.

Tag Explanation
All code written within these tags is interpreted
<html>
as HTML.
Defines the browser tab or window heading
<head>
area.
Defines the text that appears with the tab or
<title>
window heading area.
Used to link to additional files, like CSS
<link>
stylesheets.
Defines the content in the main browser content
<body>
area.
<h1>, <h2>, <h3> Heading styles in decreasing sizes.
A paragraph separated with a line space above
<p>
and below.
A self-closing tag (there’s no need to include
<img> </img>) used for images. Tag parameters
include (src (source), height=x, width = y).
Anchor tag defining a hyperlink with location
<a>
parameters (<a href=location>link text</a>).
<ol> Defines an ordered list.
<ul> Defines an unordered list.
<li> Defines an individual list item.
Creates a division of a page into separate areas
<div> each which can be referred to uniquely by name,
(<div id= “page”>) .
<form> Used to create an HTML form for user input.
Tag specifies an input field where the user can
<input>
enter data.
Tag is used to embed a client-side script 37
<script>
(JavaScript).
HTML Examples
<html>
<head>
<title> Demo HTML Code! </title>
<link href= “styles.css” rel=“stylesheet”
type=“text/css”>
</head>

<body>
<div id= “page1”>
<h1> Demo of HTML Code! </h1>
<h2> Includes: </h2>
<ul>
<li> Lists </li>
<li> Images </li>
<li> Links </li>
<li> Paragraphs </li>
</ul>
<p> This guide should help by using all the above
things! </p>
<ol>
<li> Look at the photo </li>
<li> Click the link! </li>
<img src=“Guide-Demo-Photo.png”
alt=“alternative_text_demo” width=“1000”
height=“500”>
<a href=“https://www.demohomepage.com”> Click to go
<html>
Home </a>
<head> </body>
</html> <title> Demo Form! </title>
<link href= “styles.css” rel=“stylesheet”
type=“text/css”>
</head>

<body>
<div id= “FormsPage”>
<h1> Demo of forms! </h1>
<form>
Enter your name: <input type=“text”
name=“yourname”>
Press submit: <input type=“Submit”
value=“Click Me!”>
</form>
<p id="demo"></p>

<script>
document.getElementById(“demo”).innerHTML =
“Hello Java!”;
</script> 38
</body>
</html>
Classes Identifiers
Classes work in a similar way but
Identifiers are defined with a hashtag
use a full stop as a prefix to the
(#header). Identifiers must be unique to
class name (.list). Classes can be
each webpage.
used multiple times on a webpage.
E.g.
E.g.
In CSS:
In CSS:
.introduction {
.heading {
font-family: Ariel;
background-color:
}
lightblue;
}
In HTML:
<p id=“introduction”> Nice to see you!
In HTML:
</p>
<h1 class=“heading”> Welcome!
</h1>
CSS (Cascading Style Sheets)
Determines how tags affect objects. Promotes consistent and simpler
HTML as an external CSS file is used to store style info instead of
embedding it into a static HTML file directly. Can keep the content
and the formatting separate to standardise the appearance and
behaviour of webpages. Affects the whole site when changes are
made saving time as they are not rewritten for every page ensuring
consistency, used in multiple HTML files, cached by browser so the
site is quicker to access, changed for different themes or devices and
allows different display characteristics of the same webpage on
different platforms.
Tag Explanation
chosenElement
= Changes attributes of a HTML
document.getElementById(“example”); element.
Writing directly to the
Document.write(“Hello”);
document.
alert Border colour.
border-style Style of the border.
border-width Width of the border.
font-family Font of the text.
font-size Size of the font.
Used to set the height of an
height
element.
Used to set the width of an
width
element.
39
CSS Examples
body{
backround-color: red;
Font-family: Arial, Helvetica, sans-serif;
Color: blue;
font-size:36;
}

h1{
color: green;
font-family: Times New Roman;
font-size:48;
}

h2{
color: yellow;
font-family: Times New Roman;
font-size:32;
}

<div id="header">

#header{
background-color: white;
text align: center;
}

START OF HTML USING CSS FILE

<html>
<head>
<title> Demo Form! </title>
<link href= “styles.css” rel=“stylesheet”
type=“text/css”>
</head>

<body>
<h1> Demo File! </h1>
<h2> Heading 2! </h2>
<p> Demo content now </p>

<h1 id=“header”> Now a different style header </h1>

40
JavaScript
A scripting programming language that requires a runtime
environment e.g. a browser to provide the necessary objects and
methods. Embedded in HTML with the script tag to add functionality
and interactivity to a page e.g. validation, animation, loading new
content. Is interpreted as it is likely to run on a variety of machines
with different architectures and high level code and is machine
independent but slow. Used on the client side to reduce unnecessary
load on a server but can be amended and circumvented so also used
on server side.

Script Explanation
Used in HTML script to
<script> [...] </script> start/end a section of
JavaScript.
Retrieves the HTML element
with the ID "example" from
chosenElement = the document's DOM
document.getElementById(“example”); (Document Object Model)
and assigns it to the variable
chosenElement.
Modifies the content within
chosenElement.innerHTML = “Hello
World”;
the chosenElement HTML
element.
Writes directly into the
document.write(“Hello World”);
document.
Displays a pop-up alert box
alert(“Hello World”);
with a message.
Advantages of using JavaScript:
- Local computer can deal with invalid data before it is sent off to the
servers
- Eases the load on busy servers
- Reduces web traffic

41
Browser Search Engine Search Engine
Software program finds
Software that
info on the web, builds Indexing
renders/display Process of
and searches indexes
s HTML pages. collecting and
using content e.g.
Is useful to find storing data from
metatags and various
web resources websites so
algorithms, supports
by accepting search engines
many languages and
URLs and can quickly
improvements made
following links. match content
have allowed success
Used on private against search
with misspelled
networks. terms.
searches.

Web Crawler/Spiders
Web crawlers work by traversing the Internet, web page by web page
using links on websites. The web crawlers collect keywords and
phrases from the linked web pages and add this information to the
index. They also collect and add meta data from websites, which is
the information specified by the website owner.

PageRank Algorithm
Ranks pages according to their usefulness by considering the number
of sites linking to the site, the PageRank of the linking sites and the
number of outward links from the site. Iteratively calculates
importance of each website so more links from a website with high
importance is given a higher ranking than those of low importance.
The more the links, the better the site.
The data structure used to display this information is a directed
graph. This shows which pages link to other websites, and webpages
are represented as nodes while links between two pages are
represented as arcs between the nodes.

PageRank(x) = (1-d) + d[(PageRank(T1) ÷ Count(T1)) + … + (PageRank(Tn) ÷


Count(Tn)]

PageRank(x) The page rank of page x

Count(Tn) Total count of outbound links from a webpage n

d The damping factor (usually set to 0.85)

42
Server-side Processing
Takes place on the webserver. Best used where processing is integral
e.g. generating content and accessing data including secure data so
any data passed must be checked carefully.

Pros Cons
Essential for data security as data is Puts extra load on the server costing
sent from the browser to the server the company hosting the website.
which processes it and sends the
output back to the browser.
Takes away the reliance of a browser
having the correct interpreter.
Hides the code from the user to
protect copyright and avoid it being
amended.

Client-side Processing
Takes place on the web browser. Best used when no critical code runs
and where a quick response is needed e.g. games, validation.
Pros Cons
Reduces data traffic and load on the Browser may not run the code as it
server so it can do more processing. doesn’t have the capability or the user
intentionally disabled client code.
Gives quick feedback to the user. Code is visible so can be copied.
Sends better quality data to the Shows incorrect message if user’s
server. computer’s clock is in different time
zone.
Doesn’t require the data to be sent
back and forth.
Code is more responsive.

43
1.4.1 Data Types

Type Description Example


Whole number values with no decimal
Integer 152
part.
Real Numbers with decimal or fractional parts. 1.874
Single letter, digit, symbol or control
Character R
code.
String A string of alphanumeric characters. Cat

Boolean One of two values. True or False


Character Set
Normally equates to the symbols on the keyboard that are
represented by the computer by unique binary numbers and may
include control codes. Number of bits used for one character is 1
byte, number of characters tend to be a power of 2 and uses more
bits for an extended set.

ASCII
American Standard Code for Information Interchange. Each character
of the alphabet, special symbols and control codes are represented
by agreed 8 bit binary patterns. The number of characters is limited
to 256 so it is impossible to display a wide range for other alphabets
or symbols sets.
The capital letters A-Z are represented by codes 65-90 while the
lower case letters a-z correspond to codes 97-122.

Unicode
Solves the problem of ASCII’s limited character set. Unicode uses a
varying number of bits (originally fixed 16-bit) allowing for over 1
million different characters, many of which have yet to be allocated.
Because of this, Unicode has enough capacity to represent a wealth
of different languages, symbols and emoji.
Original ASCII representations are included with the same numeric
values.

44
Representing Integers in
Binary
Computers can store whole numbers
using binary. Just like humans count
in base 10, computers count in base
2, where each step in place
represents a value of two times the
previous place.
A single binary digit is called a bit,
and eight binary digits can be
Binary
combined to Decimal
to form a byte. (and vice versa)
The least significant bit of a binary number is the one furthest to the
right, while the most significant bit is furthest to the left. When
representing positive integers, the least significant bit always
represents a value of 1, with the 2nd least significant bit representing
a value of 2, then 4, 8, etc.
12
64 32 16 8 4 2 1 64 + 16 + 8 + 1
8
= 89
0 1 0 1 1 0 0 1

Representing Integers in
Binary
In the same way that decimal is base
10, and binary is base 2,
hexadecimal is base 16. In addition
to the numbers 0-9, hexadecimal
makes use of the characters A-F to
represent 10-15. Just like binary,
place values in hexadecimal start
with 1 (160 ) and go up in powers of
Binary to Hexadecimal 16. (and vice versa)
From the least significant bit, group bits of 4 to create each bit of hex.
Convert each group of 4 into denary and if it is over 9, use letters.

8 4 2 1
12
64 32 16 8 4 2 1 D9
8
1 1 0 1 1 0 0 1
8+4+1= 8+1=
45
13 D 9
Binary Addition
When adding in binary, there are four rules to remember:
0 + 0 + 0 = 0
0 + 0 + 1 = 1
0 + 1 + 1 = 10
1 + 1 + 1 = 11

Overflow
1 1 0 1 0 0 1 1 When in 8 bit addition, if the
+ 0 1 1 1 0 1 1 0 answer ‘overflows’ and
moves into a 9 bit, this is
th
1 1 1 0 0 1 0 0 1
1 1 1 1 1 1
discarded and not used in the
final answer. However, this
means the answer won’t be
completely accurate.
Binary Subtraction
When subtracting in binary, there are rules to remember:
0-0=0
1-0=1
1-1=0
0 - 1 = 1 This can’t be done directly, a digit must be borrowed
from the left
When borrowing a digit, the 1 gets turned into a 2.

0 21 01 2

1 1 0 1 0 1 1 0
- 0 0 1 1 1 0 1 0
1 0 0 0 1 1 0 0

Binary Shifts
Involves moving all of the bits in a binary number a specified number
of places to the right or to the left. This can be thought of as adding a
number of leading or trailing zeros.
The result of a logical shift is a multiplication (or division if shifting
right) by two to the power of the number of places shifted. The
example above has the effect of multiplying the original number by
= 8. A logical shift left by one place has the effect of doubling the
initial number.
46
Negative Numbers in Binary
Binary can represent negative numbers using a few different
methods. These methods set out rules for how a bit string should be
treated, giving a special meaning to certain bits which allows for the
representation of negative numbers.

Sign and Magnitude


Basic way to represent negative numbers in binary. This is the
equivalent of adding a + or - sign in front of a number. The most
significant is 1 for a negative number, and 0 for a positive number.
For example: 00010101 = 21 BUT 10010101 = -21 when using 8-bit
sign and magnitude binary.

Two’s Complement
Method of representing negative numbers
in binary, two’s complement has the added
advantage of making binary arithmetic with Simpler Method
negative numbers simpler. Flip the bits but keep
the right-most 1 (and
Converting to two’s complement is as all bits after that) as
simple as flipping all of the bits in the they were. This has
positive version of a binary number and the same effect as
adding one. For example, the binary byte adding 1.
representing 7 is 00000111. Flip all the bits
and you get 11111000, adding one gives us
11111001.

Subtracting Using Two’s Complement


Two’s complement makes subtraction in binary easy. Subtracting a
number from another is the same as adding a negative number. This
is how binary subtraction works.
Example: Subtract 12 from 8.
In five bit two’s complement, 8 is 01000 and -12 is 10100. The two’s
complement numbers are then added before the result can be read
off as 11100. Checking the result, -16 + 8 + 4 = -4 so the calculation
is correct.

47
Floating Point Numbers in Binary
Used for representing very large or very small numbers (similar to
scientific notation) so for example, 6.67 x . Floating point numbers
can be split into two parts: mantissa and exponent. In this case, the
mantissa is 6.67 and the exponent is -11. When combined, the
mantissa and exponent provide all the information needed to work
out the actual value being represented.
In this case, the scientific notation represents the value
0.0000000000667. The value 6.67 is shifted 11 times from the
decimal point.
We can do the same in binary, provided that we include information
about the size of the mantissa and exponent. We also dedicate a
single bit to the sign - whether a number is positive or negative.
Floating Point Binary Example
10-bit mantissa and a 6-bit two’s complement exponent.
S M E

0 1 1 0 0 1 0 0 1 1 1 0 0 0 1 0 1

Mantissa is always taken to have the binary point (the equivalent of a


decimal point, but in binary) after the most significant bit. So this
mantissa is actually 1.100100111.

Next, convert the exponent to decimal (you don’t need this again
after this). In this case = 5

Next, move the binary point five places to the right:


S M
0.062
+ 32 16 8 4 2 1 0.5 0.25 0.125
5

0 1 1 0 0 1 0 0 1 1 1

32 + 16 + 2 + 0.25 + 0.125 + 0.0625 = 50.4375

48
Normalisation
Floating point numbers are normalised to make sure that they are as
precise as possible in a given number of bits. This essentially equates
to making as much use of the mantissa as possible. To normalise a
binary number, adjust it so that it starts 01 for a positive number of
10 for a negative number.

Normalisation Example
8-bit mantissa and a 4-bit exponent.
M E

0 0 0 1 1 0 1 0 0 1 0 1

Adjust the mantissa so that it starts 01 or 10. In this case, because


we’re dealing with a positive number, we will move all of the bits two
places to the left and add zeros to the end of the mantissa.
M E

0 1 1 0 1 0 0 0 0 1 0 1

Because we’ve made the mantissa bigger by shifting the bits two
positions to the left, we must reduce the exponent by two so as to
ensure the same number is still represented.
M E

0 1 1 0 1 0 0 0 0 0 1 1

We now have a mantissa that starts with the digits 01. A positive
normalised number.

Floating Point Number Addition


In order to add floating point binary numbers, their exponents need to
be the same. Then it’s just a case of adding the mantissas and
normalising the result if required. If the exponents are not the same,
the numbers must first be modified so that they have the same
exponent.

49
Floating Point Addition Example
6-bit mantissa and a 4-bit exponent.
S M E

0 0 0 0 1 0 0 0 0 1 1

0 0 0 0 1 0 1 0 0 1 0

The exponents are not the same, so one must be modified to match
the other. The first mantissa needs to be shifted by three, and the
second by two. If we shift the first mantissa by one then it will only
need shifting by another two, meaning its exponent will match the
second.

Carrying this out gives:


S M E

0 0 0 1 0 0 0 0 0 1 0

0 0 0 0 1 0 1 0 0 1 0

Now that the exponents are the same, we can carry out binary
addition on the mantissas to get 001101. The result still needs to be
normalised though!
S the mantissa
Shift M one bit to the E
left so decrease the exponent by 1.
0 0 1 1 0 1 0 0 0 0 1

Floating Point Number Subtraction


Just like integer subtraction in binary, floating point subtraction
involves converting to two’s complement and adding.
The first stage is the same as for floating point addition: make the
exponents the same. Following this, the mantissa of the number to be
subtracted must be converted to two’s complement. This is
performed by flipping all the bits and adding one.
Now binary addition is carried out on the two numbers, before the
result is normalised.

50
Masks
A mask can be applied to binary numbers by combining them with a
logic gate.
AND – Excludes bits by placing a 0 in the appropriate bit in the mask.
OR – Reset bits by placing a 1 in the appropriate bit in the mask.
XOR – Checks to see if corresponding bits are the same.

Mask Examples
0 0 1 0 1 0 1 1

AND 1 0 1 1 1 0 1 1

0 0 1 0 1 0 1 1

0 0 1 0 1 0 1 1

OR 1 0 1 1 1 0 1 1

1 0 1 1 1 0 1 1

0 0 1 0 1 0 1 1

XOR 1 0 1 1 1 0 1 1

1 0 0 1 0 0 0 0

51
1.4.2 Data Structures
Arrays
A static data structure of the 1
same data type grouped under D
a single identifier. Individual
items can be accessed directly
using an index. Contents are
stored contiguously in memory 2
and can be multidimensional. D
Arrays can be multi-
dimensional, a 1D array is a
linear array, a 2D array can be
visualised as a table and a 3D 3
array could be visualised as a D
multi-page spreadsheet.

Records
More commonly referred to as a
row in a file and is made up of
fields. Each field in the record
can be identified by
recordName.fieldName.

Lists Tuples
A data store organised by an An immutable list that cannot be
index where the items can occur modified once set up. Elements
more than once. Lists are similar cannot be added or removed
to 1D arrays and elements can once it has been created.
be accessed in the same way. Attempting to do so will result in
The difference is that list values a syntax error. Tuples are
are stored non-contiguously. This initialised using regular brackets
means they do not have to be instead of square brackets.
stored next to each other in
memory, as data in arrays is
stored. Lists can also contain
elements of more than one data
type, unlike arrays.
52
Linked List
Dynamic data structure uses index values and pointers to sort list in
specific way and organise on more than one category. Data is added
in next available space and pointers updated accordingly. Item
removed by putting pointer in previous item set to value of item to be
removed effectively bypassing removed item. Needs to be traversed
until desired element found. Contents may not be stored
contiguously.

Adding to a Linked
List Removing from a
To add to a linked list, update Linked List
the pointer of the last node to To remove a node from a linked
be the identifier of the new list, change the pointer of the
entry. If the new entry needs to previous node (to the one being
be placed within the list, deleted) to the pointer of the
change the pointer of the node to be deleted. The node is
previous node to the new node not truly removed from the list, it
and the pointer of the new is only ignored. Although this is
node becomes what was easier, this wastes memory.
originally stored as the pointer
(of the previousthrough
Searching node). a Linked List
Involves starting at the first node and following the pointers until
either the desired value is found or the end of the list is reached.
Requires all nodes to be checked.
-The bigger the list grows, the longer the search.
-A list of size n takes on average n/2 checks.
In Big O notation, this is or linear complexity.

53
Graph
Collection of data nodes with edges
between them that can be directional/bi-
directional, directed/undirected or
weighted/unweighted.
Directed Graph: The edges can only be
traversed in one direction.
Undirected Graph: The edges can be
traversed in both directions.
Weighted Graph: A cost is attached to
each edge.

Weighted, bi-
directional graph

Stack
Dynamic LIFO data structure uses
2 pointers: top and bottom. Top is
the stack pointer and data is
added and removed from the stack
using PUSH and POP commands.
Used to reverse an action, such as
to go back a page in web
browsers. The ‘undo’ buttons that
applications widely make use of
also utilise stacks.
Push Pop Peek
Adds a new value Removes a value Reads the top value
to the top of the from the top of the of the stack but
stack and moves list (returning it to doesn’t pop it. The
the top pointer to the user) and top pointer remains
point at this value. moves the top the same.
pointer to point at
the next value
down in the stack.

54
Stack Example Description
Operations

Stack.isEmpty() Checks if the stack is empty.


isEmpty() >> True
Works by checking the value
of the top pointer.
Adds a new value to the top
push(value Stack.append(“Jack”) of the stack. Needs to check
) that the stack is not full
before pushing to the stack.
Returns the top value from
Stack.peek() the stack. First checks the
peek() >> “Jack”
stack is not empty by
looking at value of top
pointer.
Removes and returns the top
Stack.pop() value of the stack. First
pop() >> “Jack”
checks the stack is not
empty by looking at value of
top pointer.
Stack.size() Returns the size of the stack.
size() >> 2
Checks if the stack if full and
Stack.isFull() returns a Boolean value.
isFull() >> False Works by comparing stack
size to the top pointer.
Queues
Dynamic FIFO data
structure uses 2 pointers:
start and end or
Front/Rear. Start is the
queue pointer and data is
removed from the start
and added to the end
using PUSH and POP
commands. Queues can
Linear Queue be circular. Circular Queue
A data structure consisting Coded in a way that once the
of an array. Items are added queue’s rear pointer is equal
into the next available to the maximum size of the
space in the queue, starting queue, it can loop back to the
from the front. Items are front of the array and store
removed from the front of values here, provided that it 55
the queue. is empty.
Queue Example Description
Operations

Queue.isEmpty() Checks if the queue if


isEmpty() >> False
empty by comparing the
front and back pointer.
Adds a new item to the
enQueue(valu Queue.enQueue(“Ben”) end of the queue.
e) >> Increments the back
pointer.
Removes the item from
Queue.deQueue() the front of the queue.
deQueue() >> Increments the front
pointer.

Queue.isFull() Checks if the queue is full


isFull() >> False
by comparing the back
pointer and queue size.

Trees
A connected form of a graph.
Trees have a root node which is
the top node in any tree. Nodes
are connected to other nodes
using branches, with the lower-
level nodes being the children of
the higher-level nodes.

Term Explanation
Node An item in the tree.
Connects two nodes together and is also known as a branch
Edge or arc.
Root A single node which does not have any incoming nodes.
Child A node with incoming edges.
Parent A node with outgoing edges.
Subtre Subsection of a tree consisting of a parent and all the
e children of a parent.

Leaf A node with no children.


56
Binary Search Tree
A type of tree in which each
node has a maximum of two
children. These are used to
represent information for
binary searches, as
information in these trees is
easy to search through. The
most common way to
represent a binary tree is
storing each node with a left
pointer and a right pointer.
Search time in Big O notation,
this is .

Traversing a Tree
There are four methods of traversing a binary tree: Breadth-first, Pre-
order, In-order and Post-order. A simple way of remembering Pre, In
and Post is using the outline method.

Breadth-first
Traversal
Inspects each node on a
level of a tree before
continuing.

In this case: 10, 6, 15, 2, 8,


19, 4, 17, 21

Pre-order Traversal
1 – Root Node
2 – Left Subtree
3 – Right Subtree
Using the outline method,
imagine there is a dot on
the left-hand side of each
node.
In this case: 10, 6, 2, 4, 8,
15, 19, 17, 21
57
In-order Traversal
1 – Left Subtree
2 – Root Node
3 – Right Subtree
Using the outline method,
imagine there is a dot on
the bottom of each node.

In this case: 2, 4, 6, 8, 10,


15, 17, 19, 21

Post-order
Traversal
1 – Left Subtree
2 – Right Subtree
3 – Root Node
Using the outline method,
imagine there is a dot on
the right-hand side of each
In this case: 4, 2, 8, 6, 17,
node.
21, 19, 15, 10

Adding to a Binary Search Tree


1 – Start at the root node.
2 – If the value is less than the current node’s value, move to the left
child, if the value is greater than the current node’s value, move to
the right child.
3 – Repeat this process until you reach a vacant spot where the new
value can be inserted.
Removing a Value from a Binary Search Tree
1 – Search the tree for the node containing the value you want to
remove.
2 – If the node is found: a. If the node has no children (leaf node),
simply remove it from the tree, b. If the node has one child, replace
the node with its child, c. If the node has two children, find the
replacement node by:
Option 1: Find the minimum value in its right subtree (or the
maximum value in its left subtree),
Option 2: Choose either the leftmost node in the right subtree or the
rightmost node in the left subtree. Remove the replacement node58
from its original location and place it in the position of the node to be
deleted.
Hash Tables
A hash table is an array which is coupled with a hash function. The
hash function takes in data (a key) and releases an output (the hash).
The role of the hash function is to map the key to an index in the
hash table.
Each piece of data is mapped to a unique value using the hash
function. However, it is sometimes possible for two inputs to result in
the same hashed value. This is known as a collision. A good hashing
algorithm should have a low probability of collisions occurring but in
the event that it does occur, the item is typically placed in the next
available location. This is called collision resolution.
Hash tables are normally used for indexing, as they provide fast
access to data due to keys having a unique, one-to-one relationship
with the address at which they are stored.
Searching through a Hash
Table
Time it takes is dependent on how
long it takes to create the hash.
Ignoring collisions, the time taken will
stay the same regardless of the size
of the list.
In Big O notation, this is or constant
complexity.
As the list grows, collisions become
more likely, linear probing and
chaining means that once a location
has been found, the time taken grows
linearly with the number of collisions
Adding to a Hash Tablethat occurred for that location.
Involves hashing the key and placing it in the correct location. This
takes a constant amount of time unless there are collisions. In this
case, there is an overhead which grows with the number of collisions
per location.

59
1.4.3 Boolean Algebra
AND (Conjunction)
The output is true if both inputs are true.
A B Y
Notatio 0 0 0
n 0 1 0
A˄B
1 0 0
A AND B
A.B 1 1 1

OR (Disjunction)
The output is true if either or both of the inputs are true.
A B Z
Notatio 0 0 0
n 0 1 1
A˅B
1 0 1
A OR B
A+B 1 1 1

NOT (Negation)
The output is the negative of the input.

Notatio A Z
n
0 1
¬A
NOT A 1 0
Ā
~A

60
NAND (Negation)
The AND gate can be combined with the NOT gate to form another
gate:

The output is true if one or both of the inputs are false.


A B Y
0 0 1
Notatio 0 1 1
n 1 0 1
¬ (A ˄ B)
1 1 0

NOR (Negation)
The OR gate can be combined with the NOT gate to form another
gate:

The output is true if both the inputs are false.


A B Z
0 0 1
Notatio 0 1 0
n 1 0 0
¬ (A ˅ B)
1 1 0

XOR (Exclusive Disjunction)


The output is true if only one of the inputs is true, but not both.
A B Z
Notatio 0 0 0
n
A⊻B
0 1 1
1 0 1
A XOR B
A⊕B 1 1 0

Equivalence
Symbol:
≡ e.g. (A ∧ B) ≡ ¬(¬A
61
V ¬B)
Karnaugh Maps
A visual method for simplifying logical expressions. They show all
the outputs on a grid of all possible outcomes. The method is to
create blocks of 1s as large as possible so that the 1s are covered
by as few blocks as possible and no 0s are included. The blocks
can wrap around the diagram if necessary, in both directions, from
side to side or from top to bottom.

Rules:
- No 0s (zeros) allowed
- No diagonal blocks
- Groups as large as possible
- Every 1 must be within a block
- Overlapping allowed
- Wrap around allowed
- Smallest possible number of groups

¬ (¬B ˅ (B ˄
A B C B˄C Z
B C))
0 0 0 1 0 1 0
0 0 1 1 0 1 0
0 1 0 0 0 0 0
0 1 1 0 1 1 0
1 0 0 1 0 1 1
A ˄ (¬B ˅ (B ˄ C))
1 0 1 1 0 1 1
1 1 0 0 0 0 0
1 1 1 0 1 1 1

AB 0 0 1 1
C
0 1 1 0
0 0 0 0 1 A˄C
1 0 0 1 1

62
Karnaugh Maps (Cont.)

CD
AB 0 0 1 1
0 1 1 0
0
0 0 1 1
0
0 (A ˄ ¬C) ˅ (¬A ˄ C ˄ ¬D) ˅ (A ˄ C
0 0 0 0
1 ˄ D)
1
1 0 0 1
1
1
1 1 1 1
0
Simplifying Boolean Distribution
Algebra Applies to conjunction over
Just like algebra in mathematics, disjunction:
there are a variety of rules which A ˄ (B ˅ C) ≡ (A ˄ B) ˅ (A ˄ C)
can be used to simplify Boolean
OR
Algebra.
De Morgan’s Law Applies to disjunction over
Involves breaking a negation and
conjunction:
changing the operator between
two literals. A ˅ (B ˄ C) ≡ (A ˅ B) ˄ (A ˅ C)
¬(A ˄ B) ≡ ¬A ˅ ¬B
¬(A ˅ B) ≡ ¬A ˄ ¬B Note – can be carried out over
the same operator. Eg:
They are used when a negation
applies to the whole of an A ˄ (B ˄ C) ≡ (A ˄ B) ˄ (A ˄ C)
operator between two literals,
and result in two negated literals Commutation
acted upon by a different Laws of commutation show that
operator. the order of literals around the
Conjunction is replaced by operator doesn’t matter.
disjunction and vice versa. A˅B≡B˅A
Association A˄B≡B˄A
Involves the addition or removal
of brackets and reordering of Double Negation
literals in a Boolean expression. If you negate a literal twice, you
can remove both negation and
(A ˄ B) ˄ C ≡ A ˄ (B ˄ C) ≡ A ˄ B ˄
retain the same truth value.
C
¬¬A ≡ A
(A ˅ B) ˅ C ≡ A ˅ (B ˅ C) ≡ A ˅ B ˅
C 63
Clock Pulses
A clock is a regular pulse
generated by the CPU
which is used to coordinate
the computer’s
components. A clock pulse
rises and falls as shown in
the diagram, with edges
labelled rising or falling.
D-Type Flip Flops
A flip flop is a type of logic circuit which can store the value of one bit.
A flip flop has two inputs, a control signal and a clock input. The
output od a D-type flip flop can only change at a rising edge, the start
of a clock tick.
The logic circuit for a D-type flip
flop uses four NAND gates and
updates the value of Q to the
value of D whenever the clock
ticks, on a rising edge. The
value of Q is the stored value.
Remember, a flip flop is a basic
unit of memory and sets of flip
flops can be combined to form
registers.

Adders
An adder is a logic circuit which adds together the number of inputs
which are true, and outputs that number in binary.

Half Adder
A half adder has A B C S
two inputs, A and B, 0 0 0 0
and two outputs,
0 1 0 1
Sum and Carry. The
circuit is formed 1 0 0 1
from just two logic 1 1 1 0
gates: AND and
XOR.

64
Full Adder
A full adder is similar to a
half adder, but has an
additional input, allowing
for a carry in to be
represented. The logic
circuit is formed from two
XOR gates, two AND gates
and an OR gate.

A B Su
m Because the full adder has
a carry input, the circuits
0 0 0 0 0 can be chained together to
0 0 1 0 1 form what’s known as a
ripple adder. At each stage,
0 1 0 0 1
B and can be connected to
0 1 1 1 0 the previous adder’s sum
1 0 0 0 1 and can be attached to A.
Four full adders can be used
1 0 1 1 0 to add two four bit
1 1 0 1 0 numbers.
1 1 1 1 1

65
1.5.1 Computer Related
Legislation
The Data Protection Act (DPA) 1998
This law applies to information stored both on computers and in
organised paper filing systems. The law covers personal data, which
is any data which can be used to identify a living person.
Furthermore, data which can be used in combination with other data
to identify a living person is also classified as personal data.
Examples of personal data include a person’s name and address.
An individual who can be identified by personal data is referred to as
the data subject, with the law protecting them in eight specific ways
as laid out by the Government:
1. Personal data shall be processed fairly and lawfully
2. Personal data shall be obtained only for one or more specified and
lawful purpose
3. Personal data shall be adequate, relevant and not excessive for
its purpose(s)
4. Personal data shall be accurate and where necessary kept up to
date
5. Personal data shall not be kept for longer than is necessary for its
purpose(s)
6. Personal data shall be processed in accordance with the rights of
data subjects under this Act
7. Appropriate technical and organisational measures shall be taken
against unauthorised or unlawful processing of personal data and
against accidental loss or destruction of, or damage to, personal
data
8. Personal data shall not be transferred to a country or territory
outside the European Economic Area, unless that country or
territory ensures an adequate level of data protection
The Act also gives data subjects certain rights, such as the right to
request a copy of the data held about them, the right to correct the
data held about them and the right to prevent marketing using
contact details provided by the data subject.
As of 2018, The Data Protection Act has been replaced by the General
Data Protection Regulation (GDPR) and the Data Protection Act 2018.
66
The Computer Misuse Act (CMA) 1990
The Computer Misuse Act 1990 concerns the malicious use of
computers. The Act was originally created to ensure that computer
hacking was covered by law, but has since been frequently updated
to ensure it remains relevant. The Act outlines three primary offences:
1. Unauthorised access to computer materials. For example: Finding
a teacher’s password and opening their files.
2. Unauthorised access with intent to commit further offences. For
example: Finding a teacher’s password and opening their files
with the intention of increasing your mark on their markbook.
3. Unauthorised modification of computer material. For example:
Finding a teacher’s password, opening their files and increasing
your mark on their markbook.
The consequences of the second and third offences are generally
worse than the first, with each offence being punishable with
imprisonment.
The Copyright Design and Patents Act (CDPA)
1988
This act was brought in to protect people’s property online. It covers
everything from logos to music recordings. If a work is original,
copyright automatically applies and doesn’t expire until 25-70 years
after the death of the creator, depending on the type of work.
In 1992, the Act was extended to include computer programs as a
type of literary work, meaning that copyright automatically applies to
code.
If an individual believes that their work has been copied, it is their
The Regulation
responsibility of Investigatory
to take action under the Act. Powers Act
(RIPA) 2000
Sometimes referred to as RIPA, the Regulation of Investigatory Powers
Act covers investigation, surveillance and interception of
communication by public bodies. For example, the Secret Service can
legally wire-trap online conversations in the interests of national
security provided that a warrant has been issued.
Furthermore, the act enforces internet service providers and mobile
phone companies to give up information upon request from an
authorised authority and to ensure that their networks have sufficient
hardware installed to facilitate surveillance.
This Act is particularly controversial as its powers extend to small
agencies like local councils. In addition, some people feel that the Act
is an invasion of privacy, or that it is often improperly used. 67
1.5.2 Ethical, Moral and Cultural
Points to consider about all topics
- Personal Intrusion
- Invasion of privacy
- Costs of infrastructure
- Violation of civil liberties
- Recording people/data who may not want this
- Cultural sensitivities (e.g. religious beliefs)

Computers in the workforce


- Many jobs have been taken over by computers.
- Computers well suited to certain jobs and as techniques such as AI
improve the range of jobs they can do is likely to increase.
- Manual jobs (lower pay) such as working in the automotive
industry has been replaced by robots.
- Computer based systems are attractive to employers.
- They don’t require paying.
- Don’t get sick (although can break down/malfunction).
- Can work 24/7 without making mistakes.
- Computer systems can be used for work that is considered
dangerous for humans and for repetitive and menial tasks.

Automated Decision Making


- Distinguish between Artificial Intelligence and Robotic Automation.
- Currently, people have the right to have automated decisions
checked over by humans (DPA)
- Automatic numberplate recognition (ANPR)
- Makes use of optical character recognition to turn a picture
into characters.
- More reliable and produce statistical data.
- Lower costs as no humans to employ.
- Could connect to other databases like police and DVLA to check
cars are genuine.
- If connecting over the internet, susceptible to hackers.
- Can lead to improved customer satisfaction and lower costs.
- Could lead to less employment as systems take jobs.
- Some people may be afraid to use car parks due to cameras.
- Self-driving – presents lots of problems but could be more efficient.
68
Artificial Intelligence
- Study of computers displaying intelligent behaviour (usually
characterised by decision making).
- Techniques include neural networks, evolutionary
computation etc.
- Computers well suited to certain jobs and AI jobs likely to increase.
- Many jobs already taken over by computers
- Manual jobs also replaced by robots.
- Machine learning – where a machine improves its performance.
- Often contains biases in the programming.
- Machine learning bias depends on data given.
- Artificial Intelligence based systems are attractive to employers.
- They don’t require paying.
- Don’t get sick (although can break down/malfunction).
- Can work 24/7 without making mistakes.
- Can be used for work considered dangerous for humans.
- Future developments may make computers preferrable.
- Likely to assist but never take over roles.
- Laws would need to be changed as currently people have the right
to have automated decisions checked over by humans (DPA).
Environmental Effects
- Materials and fuel used in producing and transporting computers
has an environmental impact.
- Digital devices have short life spans and are quickly disposed of.
- Often end up in landfill or sent to less economically
developed countries to be dismantled due to some
components having value.
- Devices often made up of toxic materials (such as mercury).
- Can harm people disposing of the waste and damage/pollute
the area in which they are buried/burned.
- People have many digital devices that need powering/charging.
- Increase in demand for electricity.
- Increase in fossil fuel burning.
- Computers used to automate things like central heating.
- Can reduce energy consumption.
- Computers encourage a paperless approach.
- Both in the workplace and in terms of companies sending
bills to homes.
- Potentially reduces paper consumption and destruction of
trees.
- Developments in digital storage reduces the need for physical
media
- Reduces needs for plastics.
69
- Allows for working at home – reduces traffic and pollution.
- Data mining – improves efficiency of data analysis.
Censorship and the Internet
- Anyone can put content on the internet.
- Can be hard to track down who put the information up.
- People can make untrue claims or present biased information.
- Crimes have originated because of the internet –
phishing/pharming.
- Other crimes now use the internet – drugs/obscene materials.
- Laws have been written to take the internet into account – RIPA
- Traditional laws still apply to the internet.
- Laws hard to enforce when content is from outside the country.
- Education on how to use the internet is important.
- Content available to people of all ages and vulnerabilities.
Monitor Behaviour
- E.g. Monitoring employees’ actions
- Login information
- File access recording
- Monitor internet activity
- Monitor electrical communications
- Extent of the UK government’s ability to monitor communications
of its citizens – controlled by RIPA.
- Measures citizens can take to help prevent their communications
being monitored.
- Encryption – keys, symmetric, asymmetric details etc.
- Many messaging services already include end-to-end
encryption by default.
- Use of VPNs to re-route traffic and attempt to escape
monitoring where possible.
- Monitoring communication runs risk of revealing secrets but non-
illegal communications.
- Restricting encryption means that secure sites may struggle to
function.
- Legislation (RIPA) already ensures that communications can be
monitored if there is a just cause.
- Routine monitoring runs risk of false-positives.
- However, will reduce risk of illegal activities being
coordinated.
Piracy and Offensive Communications
- Fast internet speeds, peer to peer networks and dark web – make
piracy more prevalent and harder to track.
- Digital watermarking – used to track piracy.
- End-to-end encryption makes sharing pirated content harder to
track.
70
Analyse Personal Information
- Used to inform decisions.
- To find out what people do from entering data.
- Find out what people in his target age group do on other sites.
- Find out characteristics of people who use the system.
- Use of data mining.

Layout, Colour Paradigms and Character Sets


- Ensuring a website is accessible to all.
- Making it friendly for screen readers/alternate text for
images/taking into account colour blindness etc.
- Text alternatives for images.
- Using the alt attribute with the img tag allows descriptive
text to be shown where the image cannot be loaded or the
user has disabled images.
- Changing styles using CSS
- Having external style sheets allow the style of the page to be
switched.
- May change layout for smaller devices or increase
font/contrast of colours for people who are visually impaired.
- Javascript may allow people to change style sheets without
reloading a page.
- Avoid using colour combinations that may be indistinguishable by
those with colour blindness.
- Designers also need to have awareness of the cultural
meanings of colours.
- Using character sets and fonts that support different alphabets.
- Unicode.
- Using server side processing to amend the content shown.
- If the website is processed server side, the content itself can
be changed according to the user. The language used may be
determined by the user’s IP address. Cookies may be used to
save the user’s preferences.
- Writing web pages to facilitate screen readers.
- Using tables for tabular data.
- Ensuring all content can be accessed by keyboard alone.
- Avoiding CAPTCHA.
- Simple design – positive effect on accessibility.
- Use of web technologies can personalise the output to help ensure
the site is specifically accessible to the individual.

71

You might also like