Computer Science All In One Paper 1
Computer Science All In One Paper 1
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).
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.
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.
SIMD MIMD
9
1.1.3 Input, Output, Storage
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.
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.
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.
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
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
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.
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.
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.
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.
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
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
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
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.
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;
}
<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>
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.
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
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.
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.
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
Next, convert the exponent to decimal (you don’t need this again
after this). In this case = 5
0 1 1 0 0 1 0 0 1 1 1
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
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.
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.
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
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
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.
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.
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.
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
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:
NOR (Negation)
The OR gate can be combined with the NOT gate to form another
gate:
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)
71