0% found this document useful (0 votes)
20 views17 pages

Knowledge Map

The document provides an overview of computer architecture, focusing on the CPU's components, performance factors, and memory types including RAM, ROM, and virtual memory. It also discusses secondary storage options such as magnetic, optical, and solid-state drives, as well as data representation in binary, denary, and hexadecimal formats. Additionally, it covers networking concepts, including peer-to-peer and client-server models, and the performance of networks.

Uploaded by

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

Knowledge Map

The document provides an overview of computer architecture, focusing on the CPU's components, performance factors, and memory types including RAM, ROM, and virtual memory. It also discusses secondary storage options such as magnetic, optical, and solid-state drives, as well as data representation in binary, denary, and hexadecimal formats. Additionally, it covers networking concepts, including peer-to-peer and client-server models, and the performance of networks.

Uploaded by

lol12160.0002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

The CPU (Central Processing Unit) is the hardware Von Neumann Architecture diagram CPU components

component responsible for processing and


executing all the instructions inside of a computer. Control Directs the instructions
Unit (CU) within the processor
The speed is measured in Hz – so a 2Ghz CPU would
Arithmetic Responsible for any
process 2 billion instructions/cpu cycles per second.
& Logic arithmetic and logic
Unit (ALU) calculations in the
processor
Cache Stores the most
frequently accessed
instructions from the
Factors that affect CPU performance RAM (faster than RAM,
but holds much less
Clock The higher the clock speed, the data)
speed faster the rate at which the CPU Registers Small amounts of high-
can execute instructions per speed memory located
second within the CPU
Number of More cores results in
cores instructions being executed in 1.1 Systems Architecture on e mann r te t re
parallel per core, resulting in ma n re sters
faster execution
Cache size A larger cache size means the Embedded Systems – a computer system built into another device. These Memory Holds the memory
CPU can access more temporary are dedicated systems produced to be efficient at carrying out its specific Address address about to
stored data which is much task. They tend to contain more ROM than RAM, as they are specialised to Register be used by the CPU
faster than if stored in RAM carry out limited functions (cheaper to design and build) (MAR)
Examples include: Washing machine, MP3 player, Dishwasher Memory olds the actual data
Data or instruction about
Register to be used by the
CPU cycle CP .
(MDR)
Fetch – o memor address rom Pro ram o nter to and Accumulator
copy instruction from the MAR to the MDR. Increment the Stores arithmetic and
logic calculations in
Program Counter to point to next instruction. the A .
Decode – The instruction is decoded by the Control Unit.
Program Stores the memory
Execute - The instruction is performed/executed. This could be load Counter (PC) address of the next
instruction to be
data/write data to or from memory, or do a calculation or logic operation fetched.
(using ALU).
Read Only Memory (ROM) Difference between RAM and ROM Random Access Memory (RAM)

The ROM is an internal hardware component A computer needs both RAM and ROM to The RAM is another internal hardware component
which is part of the computer’s main memory. function correctly. However, the ROM in a which is part of the computer’s main memory.
computer is difficult to upgrade or change, RAM is used to store any running applications
ROM is used to store the BIOS (basic input output
whereas the RAM can be easily upgraded and while the computer is ON
system) – instructions needed to turn the
changed to hold more data
computer ON or the “bootup” sequence
The RAM is volatile memory meaning the data in
(bootloader) RAM holds a lot more data than the ROM the RAM is deleted/erased when the power turns
ROM is non-volatile memory which means the data Typical RAM is 4GB and typical ROM is 4MB. off.
is saved/kept by the computer when the power
turns off.

1.1 Memory (Primary storage)

Virtual Memory Flash Memory


Virtual memory is memory which the computer uses by Flash memory is non-volatile memory which is used to store data and
allocating a section of secondary storage to store transfer this between a computer and another device. Flash memory can
running applications. This is only used when the RAM in have its contents edited and changed according to the user’s needs, and it
a computer is full and runs out of capacity. can also be electronically programmed.

How it works: CPU move data from RAM into the Examples of flash memory can be found in:
secondary storage, known as a “paging file”, so the CPU
can continue with its execution of instructions from - USB drives
RAM. This is copied back into the RAM when it is needed - SD cards
- Solid State Drives (SSDs)
The virtual memory is slower than the RAM but allows
the computer to continue functioning by using part of
the HDD or SSD to store some data from the RAM.
Secondary Storage - Purpose Secondary Storage – Magnetic

Secondary storage is needed to save data and programs that are needed after Magnetic memory is a type of secondary storage which is typically found in Hard
the computer is turned off. It is a form of non-volatile memory. Disk Drives (HDDs). Data is stored using magnetic dots which have a magnetic
polarisation, on areas of the disk called sectors which are found within circular
Secondary storage can hold much greater capacity of memory than main
tracks. The data will have a positive or negative polarity, which is read by the
memory, but is slower to access as it is not directly accessible by the CPU.
read/write head on a moving arm. The disk spins at a fast rate to ensure all the
Factors to consider when considering choice of secondary storage devices: data is read (e.g. 5400 or 7200rpm)

- Capacity (how much data can be stored)


- Speed (how fast the data can be read/written)
- Portability (is the device easy to move around and take with you)
- Durability (how will it be affected by drops, shocks, water etc) Advantages: largest storage capacity, cheaper to produce than solid state drives
- Reliability (chances of data always loading correctly)
Disadvantages: more likely to be damaged by dropping due to moving parts, not
- Cost (how much is the cost per GB)
as fast to read/write data as a solid state drive

1.1 Storage (Secondary)

Secondary Storage – Optical Secondary Storage – Solid State

Optical memory is a type of secondary storage which uses lasers to read and Solid State memory is a type of secondary storage which uses electricity and flash
write data. Examples of optical memory include CDs, DVDs and Blu-ray disks. memory to store data. There are no moving parts in a solid state device, and the
data is stored using electrical switches – open switch represents a 1 (keeps charge)
Data can be read by using a laser which reads a series of pits and lands. The laser
and a closed switch represents a 0.
is shone onto the disk surface which is reflected, and this represents 0s and 1s.

Advantages: very cheap to produce (good for program distribution), much more
lightweight and portable than magnetic disks, unaffected by shocks and water Advantages: fastest type of storage (reading and writing), much more lightweight
and less prone to damage than magnetic disks (no moving parts)
Disadvantages: limited storage capacity (CDs hold around 700MB and DVDs
upto 4.8GB), can also be damaged by scratches or by excessive use over a long Disadvantages: most expensive form of storage (per GB of data)
period of time
Binary, Denary and Hexadecimal conversion Units of Data Binary Arithmetic
Binary  Denary OR Denary  Binary There are 4 main rules when adding numbers using
binary:
Write out the binary number under the following
headings:
128 64 32 16 8 4 2 1

Then add the columns where there is a 1!


For denary to binary, start from 128 and minus The numbers at the top in red have been carried to
from the number, then see which columns require the next column (e.g. 1+1 =2 which is 10 in binary
a 1 to make the number so 1 gets carried)

Hexadecimal is a 4 bit number system used as it is Example


easier to remember than binary (1 character = 4
bits in binary)
0-9 = 0-9 but 10=A upto 15=F
Binary  Hexadecimal OR Hexadecimal  Binary 1.2 Data Storage (Data and Binary)
Separate each 4 digits in binary and then add them Anything above the original number of bits gives
up. If its 0-9 then keep it the same but if its 10 or you an OVERFLOW error
above, convert into the corresponding letter (for Character Sets
Binary Multiplication (Left shift) and Division
hex to binary just do the opposite – separate both A character set is a predefined set of characters, (Right shift)
characters and then convert into the re o n sed b a om ter’s ard are and so t are
corresponding number and then use the 4 digit Left shift = multiplying by 2n
grids to write the binary number Right shift = dividing by 2n
Main Character Sets:
where n = number of bits
ASCII – 7 bits per character so 128 characters in total
Unicode – more than 8 bits per character E.g. Do right shift of 2 on 01101000 means the
ASCII can be quicker to process, as it uses less bits per number is divided by 4, so shift the numbers to the
character however, it cannot represented as many right – Answer = 00011010
Examples characters (languages) as Unicode How can you double a number by shifting bits?
Convert 11000101 into denary = 128+64+4+1 = 197
NOTE: Character sets come in sequences, so if A = 65 Double means multiply by 2, so you shift by 1 bit
Convert 225 into hexadecimal = 11100001 which is 12 (01000001) then B = 66 (01000010) etc to the left - as 21 = 2
and 1 (split each half) so answer = C1
Text file size = bits per character x number of characters Check digit – adding an extra bit to check for any
SOMETIMES THEY GIVE YOU NUMBERS WITHOUT errors when transmitting data (to create even/odd
LEADING 0s e.g. 00111100 is same as 111100 E.g. “hello” will be 7 bits x 5 characters = 35 bits file size bit number)
Images Calculating file size (bits) for Images and Sound Sound
Sound file size = sample rate (Hz) x duration (s) x
Bitmap images are made up of a grid of pixels. Each Sound is stored in digital format on a computer. The
bit depth
pixel is given a unique binary code depending on its analogue sound is picked up by a microphone,
Image file size = colour depth (bits) x width (p) x
colour. Each colour has a unique and different binary which then uses an ADC (Analogue to Digital
height (p)
code. The metadata such as height/width/location Converter) to convert the sound into an electrical
taken is also stored on the computer. Quality of image decreasing analogue sound wave. This is then sampled at
regular intervals (sampling frequency) and these
Image quality depends on two main factors:
values are rounded to nearest whole number. The
 Colour depth (number of bits used to binary of this number is then stored on the
represent each colour) computer.
 Pixel Resolution (total pixels in an image) Sound quality depends on two main factors:

 Sample rate (how many samples of audio


are taken each second – measured in Hz)
 Bit Depth (number of bits used to store
1. 2 Images, Sound and Compression each sample e.g. 16 bit audio)

Increasing any of the above two factors (or the


duration of the sound will mean an increase in the
Compression file size too and vice versa)
Compression allows us to reduce the file size of So if any of these three factors increase, the quality
stored data to make it quicker to transfer (takes up of the sound file as well as the overall file size will
less storage space too) also increase (and vice versa)
The higher the pixel resolution and colour depth, the
greater the quality of the image will be. This means Lossy compression examples – JPEG, MP3, MP4
that the resulting file size of the image will also be
Lossless compression examples – PNG, GIF
greater (so if less pixel resolution or lower colour depth
are used, then the image quality and file size will also Lossy compression compresses the file size by a
reduce as seen above). considerable amount, so it takes up much less
storage space, however the change is irreversible
and the quality of the data is lowered significantly
Example
Lossless compression compresses the file size by a
An image of 4 bits per pixel can use a total of 16 smaller amount so file may not be as fast to transfer
colours (24 = 16 different bit patterns) but the changes are reversible so the original
quality of the image is not affected when original
So 0001 could be for black, 0010 could be for white etc file is obtained back.
Peer-to-Peer network (P2P) Local Area Networks (LANs) Client-Server network
A LAN covers a small geographical location on a single site e.g.
In P2P networks, all devices are EQUAL, A Client-Server network is managed by one
school, office, shop, home and can be connected either by wired
connected to every other device (no central main server, and it is connected to all its
(using Ethernet) or wireless (using WiFi) connections
location) devices (clients)

Files are stored individually on machines and Files and software are stored on the server,
then share with others instead of individual client machines

P2P is common when sharing files online, LANs allow sharing of files and hardware (e.g. printers) across all Clients send requests for data to the server,
especially when video streaming e.g. Skype connected devices and the server processes this and responds
(client-server relationship)
Install and update software on all connected computers in one
go, instead of one-by-one Much more common than P2P networks

User accounts can be stored centrally, so users can log in from


any device on the network

1.3 Wired and Wireless


Networks – Part 1
Benefits: Benefits:
Wide Area Networks (WANs)
1. Cheaper to set up than Client Server 1. Easily perform back up of all stored
network A WAN connects multiple LANs spread across multiple
data
2. Easier to set up and maintain and no geographical locations
2. Easier to install and manage software
expertise required WANs are connected by using copper or fibre optic cabling 3. Easier to manage network security
4. Central location for all files and data
Drawbacks: The organisation doesn’t own all the infrastructure, it hires it
from telecommunication companies as it is more expensive to Drawbacks:
1. No centralised location (requires
manual back-ups and updating of set up a WAN than a LAN
1. Expensive to set up and maintain
software) (required expertise and specialists)
2. Copying files creates duplicates of 2. If server fails, then ALL connected
files, so harder to keep track of latest devices will stop working
versions WANs allow further and widespread connectivity e.g. offices
3. Less reliable and data may be lost if within multiple countries
one machine fails
The internet is the BIGGEST WAN!
Network Hardware Performance of networks Collection of Computer Networks

Wireless A device that creates a Bandwidth – higher bandwidth means The internet is a worldwide (largest) collection of
Access wireless LAN which other better network performance as more data computer networks.
Point devices can connect to can be transferred at any given time. More
(WAP) The World Wide Web (WWW) is a collection of websites
users sharing bandwidth can slow down
Router A device which transmits the hosted on web servers, which we can access using the
performance.
data between multiple HTTP protocol. Each website contains a URL (uniform
networks (at least 2 Connection type – wired connections are resource locator) which we can access using a Domain
networks) – allows more reliable/faster than wireless, but are Name System (DNS – contains multiple Domain Name
connection from a LAN to not as portable and require more cabling Servers).
the internet to connect more devices
Switch A device which connects The DNS translates a website’s domain name into its IP
other devices on a LAN – Number of devices – the more devices address, so we don’t need to remember IP addresses.
they receive data from one connected, the slower the network may When the domain name is valid, and successfully
device and transmit to perform translates to the correct IP address, we can then access
another device, with the the resources/data on that website.

Network
correct MAC address
An internal component that
1.3 Wired and Wireless
Interface allows a device to connect to Networks – Part 2
Controller/ a network
Card (NIC)
The Cloud
Twisted Made up of 4 pairs of
A Cloud host stores the data of another
Pair twisted copper wires -
organisation, using its own servers, storage
cabling mainly used to physically
(Ethernet) connect devices on a LAN and software, accessible only via the
internet. Wired vs Wireless Networks comparison (Ethernet vs
(examples are CAT 5e/CAT 6)
Coaxial Made up of a single copper Similar concept of client-server network WiFi and Bluetooth)
cabling wire surrounded by a plastic where the server is the ‘cloud’ company.
Wired: much more reliable, faster and stable connection
layer (insulation) and metal (not affected by interference) and also less like to be
Benefits: access data from any connected
mesh (shielding) – mainly
device, easy to increase storage, no need affected by hacking. However, wired connections affect
used by phone companies
to pay extra for IT staff, provides auto portability/movement and are cost more to add
and internet providers
Fibre Optic Made up of a glass core updates and back-ups additional devices.
cabling which refracts light as data Drawbacks: MUST need internet to access, Wireless: easier to connect more devices, can move
travels, over long distances – around and costs less vs wired. However, more devices
dependency on the cloud host for security
used for high speed internet
and back-ups, often subscription based so means affected by interference, it is not as fast or stable
and cable TV services
more expensive as a wired (Ethernet) connection and is more prone to be
affected by hacking.
Star Network Topology WiFi (Frequency/Channels & Encryption) Mesh Network Topology
A topology is just a name used to describe how a network Main standard used for wireless connections In a Mesh topology, there is no central location as each
has been set up (layout of the network). – two main radio frequency bands (2.4GHz device is directly or indirectly connected to another
which has longer coverage but slower device. Data is sent across the fastest route from one
Star topology – all the devices are connected to a central transmission speeds or 5GHz which gives less device to another.
switch or server that controls the network. coverage but faster transmission speed.)

Each band is split into numbered channels,


each covering a small frequency range
(overlapping each other)
Advantages:
Advantages:
If one device or cable fails, the rest of the network will not
be affected. Easier and simpler to add more devices (just No single point where network can fail (unlike star) – just
connect to central). Limited or no data collisions as devices use another route to send data
Encryption – provides security when
have independent connections
accessing a network (passwords/keys Easily detect a fault in the network
Disadvantages: required to connect) otherwise unauthorised
users may access (examples include WEP, Disadvantages:
If wired, then each device requires separate cable/wire so WPA, WPS)
Not as scalable as star topology, because adding one
can be expensive with many devices. If the main
device means having multiple connections to the other
server/switch fails then the entire network will fail (unable
to access any data). Additional cabling required for every 1.3 Network topologies, Each device will need many I/O ports which is not always
device protocols and layers possible

Network Layers – small sections (divisions) of network Network Protocols – sets of rules used by devices for Packet Switching – used by routers to direct data packets
functionality communication across a network across networks

Layers are SELF CONTAINED, so developers can work on TCP/IP (transmission control protocol/internet protocol) – How it works?
one aspect of the network without affecting the split data into packets and then reassemble into correct order 1 – data is split into packets (given headers which contain
remaining layers. (check for errors). IP is responsible for packet switching source and destination IP address) and a number to show
HTTP/HTTPS (hyper-text transfer protocol (secure)) – used by order
Also allows companies to have a set/consistent standard, web browsers to access websites 2 – Routers direct the packets through the best/fastest
so developed hardware and software will work in the FTP (file transfer protocol) – move files between a network route depending on amount of traffic. Each packet can take
same way, even if made by different companies. POP (post office protocol) – retrieve emails from a server. a different route.
Email is held until downloaded, then it is deleted 3 – As they arrive, the packets are rearranged into correct
IMAP (internet message access protocol) – similar to POP but order.
only deleted when you choose to do so. 4 – If any packets were lost during sending, sends signal
SMTP (simple mail transfer protocol) – send emails between back to resend the packet and then sends receipt
servers confirmation when all the packets have arrived.
Network security threats Forms of Network attacks Identifying and Preventing vulnerabilities
Malware – malicious software which causes damage Passive Attack – monitoring data across network and Penetration testing – testing the vulnerability of a
(e.g. Editing/deleting files) when it is run intercepting any sensitive information they find network by paying authorised users (internal or
(through the use of network monitoring hardware and external) to try and find weaknesses to exploit, and then
Phishing – luring people into giving personal data
software. fixing these to improve network security.
through email/SMS messages sent from source that
looks legitimate Physical security – having physical restrictions, such as
Active Attack – attacking a network with malware or
ID cards, locks and keys to ensure sensitive data cannot
Pharming – redirects network traffic to a fake website other planned attacks
be leaked/stolen
which is intended to collect persona;/sensitive data
Insider Attack – an insider who exploits their network Network policies – having thorough sets of rules in place
Social Engineering – the art of manipulating people into to steal/expose information to reduce the chances of employees giving accidental or
giving up their personal/sensitive data
deliberate access to data
Brute Force Attack – trying to gain access by using
Data interception and theft – data sent to another many password combinations (using automated Anti-malware software – downloading an active
device is intercepted by a 3rd party (unauthorised user)
software) program which protects data from malware by blocking
malware from entering a system/network or finding and
Denial of Service (DoS) Attack – stopping users from deleting/quarantining the malware to reduce impact
accessing part of a network by flooding the network
with many requests.

1.4 Network Security


The concept of SQL injection – inserting malicious SQL
statements into a database to edit/steal personal data

Poor Network Policy – limited/no security rules to Firewalls – monitors incoming and outgoing network
follow so easier for unauthorised users to gain access to traffic to protect against unauthorised connections
data (e.g. no access rights, no back up of data etc) to/from the internet

Weak passwords – passwords that do not consist of User access levels – granting different levels of access
upper/lower case characters, minimum length based on role in company to prevent access to
requirement, symbols and are not updated regularly sensitive/personal data

Out of date software – software prone/not protected Passwords – string of characters used to verify the
from the latest threats and malware identity of a person trying to gain access to a
system/data (preventing unauthorised access)
Ransomware – prevents access to files and data unless a
ransom is paid to the hacker/3rd party Encryption – using algorithms to change the form of
data sent across a network to make it difficult for
unauthorised users to access or recognise, and can only
access using the encryption key
Operating System What is system software? Utility Software

The operating system (OS) is a system software that System software is software which is designed to Utility software is software designed to maintain and
allows the hardware and software to communicate help a computer run and communicate. It optimise the running of a computer system, to
with each other and run other software (programs) controls the hardware, software and any increase/enhance performance.
connected peripheral devices by providing a user
It provides a user interface which allows the user to The main examples of utility software:
interface where all these can interact with each
interact with the computer system (examples include
other. 1 – Encryption software: software designed to use
Apple iOS, MAC OS, Android OS, Windows 10…)
cryptography (keys) to prevent unauthorised access
The OS is responsible for: to data

1 – Memory management/multitasking: allows the 2 – Defragmentation: physically rearranges and


computer system to run multiple programs at once, organises the files and storage into continuous
managing how much memory they will each require. regions, for faster disk access (useful after many files
Break memory up into fixed size blocks (pages) and are created and deleted leaving gaps on the disk).
allocate enough pages for each program to run (in
3 – Data compression: software designed to reduce
the RAM). When the program is closed, the pages
the file size of data/files in order to make them faster
are freed up for use by another program.
to transfer across a network and take up less
2 – Peripheral management and drivers: allows 1.5 Systems Software memory on the hard drive
communication between input/output devices
4 – Anti-virus/malware: software designed to
through use of device drivers (instructions on how to
protect data from malware by blocking malware
control the device). Drivers can be updated to 6 – Back up software: designed to make copies of from entering a system/network or finding and
increase performance or to fix bugs. existing files and data, in case the data is loss or deleting/quarantining the malware to reduce impact
3 – User management: allows creation of multiple corrupted.
5 – Disk cleaner: software designed to free up space
user accounts which can easily be managed by the FULL BACK UP - backs up ALL the data and files, on a hard drive by deleting temporary files which
admin account. Different access levels can be given which may take significant amount of time if entire have no further purpose or use
to each user (e.g. admin/standard) and allows the OS system is to be backed up with many changes
to keep track of who created/edited/deleted files. between back up versions. However, LESS time
4 – File management: allows the user to create files required to restore the back up.
which can be structured into folders and directories INCREMENTAL BACK UP – only back up the
to make it easier to locate. Information such as time CHANGED files/data since last FULL back up, so less
created, last modified can be seen and the files can time taken to back up the data. However, MORE
be edited/changed/moved/deleted as well as sorted time taken to restore the data from previous FULL
into different categories (e.g. size, type) back up version.
Ethical Issues – what is considered “right” or “wrong” by Open Source vs Proprietary software Legislation (laws)
society and people
1 – companies store personal data about us (what is it used for Open Source – free software that can be used and The Data Protection Act 1998/ GDPR 2018
and how secure is it?) modified by anyone (no cost involved) and you can access Any data stored about someone needs to be kept safe and
2 – can you trust every company which stores data about you secure from unauthorised access, ensuring it stays private.
– what can go wrong?
the source code. Can often be developed by many people
Data MUST be:
so can be updated continuously over time.  fairly and lawfully processed
Legal issues – what is actually right or wrong in the eyes of the  obtained for specified purposes (make user aware)
law However, no guarantee that it would be fully functioning  adequate, relevant and not excessive
1 – how can our data be exploited by companies/individuals and effective, and support may not always be available if  kept accurate and up-to-date
2 – The government argues they need access to our personal it’s not used by many people.  Handled in safe and secure way
data to help keep us “safe”?  NOT kept longer than necessary

1.6 Ethical, Legal, Cultural and


Cultural issues – how groups of people (e.g. beliefs, languages Computer Misuse Act 1990
or practices) are affected such as religions, cultures or Defines the list of offences and crimes linked to computer

Environmental concerns
countries usage.
1 – Are people influenced into getting latest technology even 1 – ILLEGAL to access data stored on a computer unless
when not needed? permission is granted (hacking)
2 – How has technology affected our social interaction with 2 – ILLEGAL to access data when that material will be used to
each other and mental wellbeing? commit further illegal activity e.g. blackmail and fraud
3 – Can everyone afford the same technology (digital divide)? 3 – ILLEGAL to make changes to any data stored on a
computer, unless permission is granted. Also ILLEGAL to install
Environmental issues – how technology has a positive or malware/programs which can automatically cause this change
negative impact on the environment around us to happen
1 – increasing power consumption has negative impact on
technology (fossil fuels)… Copyright Designs and Patents Act 1988
2 – disposing of devices causes e-waste (sent to Asia and Africa Current copyright law which gives the creators of work the
to cut costs) right to control how their material is used (owns the right to
3 – Are there ways in which our consumption or usage can be the work/material) and cannot be used by anyone unless
reduced? permission is granted. So people are NOT able to make copies,
publish/sell it without permission, distribute it or sell copies to
Proprietary – software that is developed by other people  unless license is granted.
Privacy issues – how “protected” is our data by
companies/individuals companies/individuals (referred to as “off the shelf”)
1 – is all the information we have online “safe” and “secure”? which is copyrighted so can only be used by obtaining Software Licences (Open source and Proprietary)
2 – what can our data be used for? Documentation which provides legally binding guidelines for
permission (buying a license)
the use of and distribution of software. Allows users with the
Topics include (smartphones, software/games, locations, Help is provided by the actual individual or company who rights to use/edit/change software without violating
wireless technologies, wearable devices, cloud storage…) (breaking) copyright laws.
created it, and often free of bugs/glitches and when these
REMEMBER to ALWAYS link points made back to the
do occur they are fixed for free. EXAM: You need to be able to recommend a license for a
QUESTION e.g. Having GPS always kept active on a
smartphone can cause ethical issues because… given scenario in the given, including any advantages or
However, it is costly to purchase/subscribe to and cannot disadvantages
be adapted to meet individual needs. Cannot be
redistributed to other users.
Searching Algorithms An Algorithm is a sequence of instructions Sorting Algorithms
used to solve a problem/complete a task
Linear search – searches for the target value on ANY list Bubble sort – sorts the values by comparing two values at a
(ordered/unordered) in a sequence starting from the first Algorithms can be represented using two time and swapping them if they are not in order. Repeat
value and going through the list until it finds the target main methods: process until you have gone through the values (this is called
(returns true) or the list is complete (returns false). a pass). When the required value is at the end, start back
1 – Flowcharts from the beginning. Only stops when a pass returns 0 swaps.
Linear search is easier to understand than binary and works
Bubble sort is easier to understand that merge sort, but very
on any list, but is much more inefficient when searching 2 – Pseudocode inefficient when sorting longer lists/datasets
longer lists compared with binary search.
Decomposition – breaking a large problem
down into smaller more manageable sub-
problems

Abstraction – removing the unnecessary 6


detail from a problem to leave only the 3
important details
Binary search – searches for the target value on SORTED lists
only, by comparing the target with each midpoint in the erge Sort – divide the dataset into smaller sub sets (halving
dataset. If the target is higher, then cancel the LEFT hand side 2.1 Algorithms each time until you end up with individual values). Then
of the list, and if target is lower, then cancel the RIGHT hand compare subset values and re-order in correct order,
side of the list (also cancel midpoint). When the midpoint merging each subset until you reach the full dataset (in
matches the target return true, otherwise when there are no Insertion Sort – simplest sorting algorithm which order).
values left, return False. arrives at the final sorted list, by inserting each Merge sort is more efficient than the bubble and insertion
value in its correct place from left to right (values sort with longer lists, but is more difficult to understand and
MIDPOINT = (LowestIndex + HighestIndex) DIV 2 are inserted towards left only). uses more memory.
Binary search is more efficient with longer lists than linear Insertion sort is the simplest sorting algorithm to
search, but is harder to understand and can only work on understand, but it is very time consuming and
sorted lists. ineffective with longer lists.
Programming basics Structured Query Language (SQL) Programming basics II

When displaying something - print() SQL is used to query a database to search for data. We can use Data Structures – an organised and structured set of
SQL commands to retrieve data from a database table by using data, which can easily be edited and changed
When user is asked to enter value/entering a value – the following format:
input() Data structures are mainly created using the [ ] set of
SELECT fields brackets so 1 set of [ ] = 1 dimensional and 2 sets of
When repeating a set of instructions a fixed number FROM tableName [ ][ ] = 2 dimensional OR [x,y] where x and y would
of times - for x in range(0,10): WHERE condition represent the index of the row and column in a 2D data
(if you want to repeat 10 times) Using the * wildcard will return ALL the records for a given structure (1D = 1 loop needed and 2D = 2 loops needed)
condition
When repeating a set of instructions until a condition colours = [“red”, “blue”, “green”]
becomes false/as long as condition is true –
Data structures indexing position starts at 0 (left to right)
while number <= 0: and -1 (right to left)
(if you are looking for numbers greater than 0)
e.g. colours[2] would give you “green” and so
Variable assignment = changing the value of a would colours[-1]
variable
E.g. if you write To iterate through a list of values, you MUST use a loop (for
Initialisation – assigning a variable with its first value SELECT StudentName from Students WHERE or while) in the exam, but for loop is preferred as it will
Points < 0; know how many values there are in the list e.g.
Variable – a temporary memory location which holds [Link] would give you the integer 3
This will give you “Kirstie” and “Marian” as your returned results
a value that can change (during program execution)
Sub-programs – a predefined block of code with a unique
Constant - a temporary memory location which holds
a value that stays the same (during program
2.2 Programming Fundamentals I name, that can be called at any time by writing its name

Two types of sub-programs:


execution)
 Procedure (no return value)
Selection – choosing the path a program will follow, Operators (arithmetic and boolean)  Function (has a return value)
based on a condition (if, elseif, else) and = when you need TWO conditions in an if statement
Sub-programs can be called by writing the name followed
or = when you need to check at least one condition is by () e.g. linearSearch() would call the function
Iteration – repeating a set of instructions (count
valid linearSearch and carry out the code within that sub-
controlled = for loop and condition controlled =
while loop)
== when you want to check if two values are the SAME program
!= or ≠ when you want to see if two values are NOT the Parameters – input variables needed to create a sub-
String Manipulation same program

String concatenation – joining strings together e.g.


< - when you want to check if a value is LESS than
Arguments – input values passed into already created sub-
“a” + “b” = “ab” something program
> - when you want to check if a value is GREATER than
String slicing – cutting a section of a string e.g. Local variable – variables only accessible within a section of
something code or a sub-program
subject = “mathematics” and so
<= and >= same as above except the value is included!
subject[2:4] will give “the” Global variable – variables that can be accessed throughout
the entire program/multiple sub-programs
Pseudocode/Python code Reading from Files Flowcharts – ALL symbols are connected with
file = openRead(“[Link]”) – this will ARROWS
Enter a number:
open the file and allow the program to read lines from it
number = input() Symbol used Purpose
[Link]() - will read the first line from the Used to represent the
file opened beginning and end of a
display the number: flowchart
while [Link]() == False: Terminal
print(number)
(use a while loop to read ALL the lines) Used to call a sub-program
[Link]() – will close the file so no more reading (e.g link to another
display the number, with a suitable message: flowchart)
print(“Your number is”, number) can take place Sub-Program
Used to represent taking a
Writing to Files user input, or displaying
Check if the number is between 5 and 10: some output/message
if number >= 5 and number <= 10: file = openWrite(“[Link]”) – this Input/Output
will open the file and allow the program to write data in it Used to represent any
[Link](“message”) - this will write the background process or
Repeat the number until it is between 5 and 10: instruction which is carried
while number < 5 or number > 10: word “message” into the file opened Process out e.g. adding
number = input() (using writeLine() on an opened file overwrites the Used to indicate any path
current content of the file if it contained anything) the program will follow,
based on a certain
check if the number exists within a specific condition
Decision
positon in a list of numbers:
if number == numbers[i]: 2.2 Programming Fundamentals II Used to connect all the
symbols (in a sequence)
Arrow
NOTE – i is used when checking using a loop
(can also use other counters such as x, count This
etc) Data types and Casting flowchart is
There are 5 main data types used in programming: used to
1. String (default) – used when entering any combination input two
Writing a NEW sub-program name: or letters, numbers or symbols numbers. If
function uniqueName (parameter1,
2. Integer – used to enter any WHOLE number they are the
parameter2…)
3. Real – used to enter any DECIMAL number same,
Calling a sub-program with arguments: 4. Boolean – used when assigning True or False TRUE output the
uniqueName(5, 10…) 5. Char – used when specifying any one INDIVIDUAL sum
character otherwise
FALSE
Random Number generation: output the
random_int(5, 10) will generate a random Casting – converting from one data type to another product of
number between 5 and 10 (inclusive) e.g. str(3) returns “3” as a string, int(“5”) returns the two
5 as a number numbers.
Defensive design considerations Testing and Selecting/Using suitable test data
There are many considerations programmers make and
Programs often contain errors (bugs) which need to be
take when creating solutions to problems
removed and resolved to prevent problems from
Input Sanitisation – to clean up input data, removing occurring.
any unwanted data such as extra spaces, or removing Testing allows the programmer to test the function of
special characters/symbols. This also helps prevent SQL programs to make sure they work as expected.
injection.
There are two main types to testing:
Validation – validating the data entered so that it fits a
range of values, or is of a specific type. Entered data
Iterative testing – carried out while the program is being
must fit criteria to prevent logical errors and unexpected
developed (ongoing) so different sections of code are
outcomes.
tested out by the programmer.
Authentication – only allowing authorised users to
access data through use of usernames and passwords Final/Terminal testing – carried out when all the
etc. 2.3 Producing Robust sections of the program and code have been completed
and developed. The program is tested as a whole to
Maintainable code – this allows other programmers to Programs make sure it functions as expected.
also understand the code, especially when dealing with
large programs Test data chosen to test how the program performs
There are 4 ways used to maintain code: should be chosen appropriately:

 Comments – annotating the code to make it 1 - Normal test data: selecting valid/expected values to
easier to understand and read see if the program accepts these without causing errors
 Indentation – spacing the code appropriately, so e.g. if the valid numbers are 1-10 then choose a
it is easily to follow different sections of the number within this range
program and what they do
 Meaningful identifier names – using 2 – Invalid/Erroneous test data: selecting data which
appropriate names for identifiers (variables, the program should not accept such as entering “six”
constants etc.) linked to the purpose so it does as string instead of 6 as integer so it should be rejected
not cause confusion
 Use of sub-programs – allows programmer to 3 – Boundary test data: selecting values which lie on the
structure code so parts can be developed and boundary of the accepted range of values e.g. if 1-10 are
changed independently without affecting the valid values then entering 0,1,10,11 are boundary
rest of the program data
Logic Gates and Truth tables Computing Related Mathematics Interpreting and Drawing Logic Gate Diagrams
Systems and circuits consist of different inputs that can MOD = remainder division Below is the logic diagram for the following expression:
give varying outputs. DIV = integer division
* = Multiply Z = (A AND B) OR (NOT C) which can also be written as
¬ = NOT ∧ = AND ∨ = OR ^ = exponent/power of
Z = (A ∧ B) ∨ (¬C)
/ = divide
The 3 main logic gates used within circuits:
NOTE: use a = 5 and b = 2 below
NOT gate (inverts the input value)
 a + b = 7
Can be written as Z = NOT A but also Z = ¬A  a – b = 3
 a / b = 2.5
 a * b = 10
 a ^ b = 25
 a MOD b OR a % b = 1
 a DIV b OR a // b = 2

AND gate (BOTH inputs must be on for output to be ON)

2.4 Computational Logic If completing the truth table for this circuit/diagram, I
added a letter for each output to make it easier….

2n = total rows/combinations needed


Why do computers represent all data in
(where n = number of inputs) and the inputs are just
binary form?
binary numbers from 0 – 7  see left hand side
Computers are made up of many electrical
Can be written as Z = A AND B but also Z = A ∧ B
switches, and each switch can be ON or
OR gate (At least one input must be on for output to be OFF (2 states) which is represented as 1s
ON). and 0s

Can be written as Z = A OR B but also Z = A ∨ B


Programming Languages Translators Integrated Development Environments (IDEs)
Computer programs are written in both high and low level A translator converts programming An IDE is a software program which provides
languages, depending on the task required. language and instructions into machine programmers with many different tools and features to
code, to be executed by the computer help aid program and software development.
High Level Languages (HLLs) – easier to write and program
(using binary).
as no expertise is needed (closest to human language and The 4 main features are:
understanding). More translation needed to convert into There are TWO main types of translators
machine code (for HLLs): 1 – Code editors (allowing program code to be written
and edited, often highlighting keywords and syntax with
Examples include: Python, Java, C++ 1 – Compiler colours
Advantages: 2 - Interpreter e.g. for while if print range
“hello”
 easier to program and modify
 programs can be written much faster 2 – Debugging (find/diagnose and fix errors and also show
 code can be debugged easily information about the errors e.g. syntax or runtime errors
 code is portable across multiple platforms as well as where they occur). Some IDEs also suggest

Disadvantages:
2.5 Translators and Facilities solutions

 requires more memory than low level languages


of Languages
 translation takes longer and less control over
hardware Compiler vs Interpreter

Low Level Languages (LLLs) – programs written related to 1 – Compiler (HLL) - translates all the code
specific computer hardware and architecture, so less into machine code in one go, producing an
translation needed to convert into machine code executable file which can be run.

Examples include: Assembly language, machine code Much faster to run than an interpreter, but
not as effective to debug for errors
Advantages: 3 – Run Time Environment (enables the program to be
run straight after you have written it, to check for run
 assembly language uses English like statements time errors). Also allows testing of the program
 translated programs require less memory 2 – Interpreter (HLL) - translates the code
one line at a time, into machine code
Disadvantages: during program execution.
4 – Translators (built in translators to convert the high
 machine code is difficult to understand and takes Much more effective to debug for level code into machine code, allowing the code to be
longer time to write programs individual errors, but interpreter code is executed/run).
 code is machine dependant (not portable) far less slow than compiled code.

You might also like