Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

EDEXCEL COMPUTER SCIENCE GCSE THEORY REVISION

CORE NOTES
Topic 1:
Decomposition:
o Breaking down a problem into smaller problems
o ... which are easier to solve (or can be broken down further)
o e.g getting ready in the morning --> clean myself, dress myself, feed myself, get into
the car

Abstraction:
o Removing unnecessary detail [for representing]
o To focus on the important aspects
o e.g. pack of cards on computer: focus on suite and number instead of physical card
dimensions/colours etc.

Benefits of subprograms
o Decomposition:
o Used to break down a complex program down to make it easier to program
o Reduces duplicate code
o Allows for easy reuse of code across more than one program
o Allows different parts of a large program to be worked on by any different
programmers at the same time
o Speeds up program development
o Makes code easier to maintain/debug/fix.

Flowcharts:
o Start/stop oval symbols
o Parallelogram is input or output
o Diamond is decision (choice) and be labelled yes/no
o Rectangle is an action (e.g increase x by 4)
o Rectangle with extra side-lines is subprogram (which is pre-assigned, it calls it and
then continues)
o Every line must have arrows

Flowchart/pseudocode algorithms:
o algorithm: a sequence of steps to solve a problem/task
o input-process-output
o sequence (ordering of code one line after the other), selection (choosing what code
to do next), repetition (count-controlled or condition controlled repeating of code),
iteration (processing every item in a data structure)
o The flowchart problem will probably iterate over a data structure e.g. Name[count]
to get each letter in a string or MyNames[count] to get each name in a list
o Constants - values don't change at runtime unlike variables
o The three data structures are strings (list of characters), records (2D with different
data types) and arrays (2D with same data types)
[records & arrays are both implemented as lists in python]
o Arrays have one data type, Record have more than one
Trace tables:
o have one column for each variable and for output usually
o usually don’t fill in / repeat cells if not assigned
o Remember to fill-in the initial values given in the code

Linear Search:
o E.g compare looking for 3 in a list of [1,2,4,5]
o Compares 3 with 1 [>]
o Compares 3 with 2 [>]
o Compares 3 with 4 [<]
o Realises that 4 has passed the target so for efficiency quits (ONLY if we know list
is ordered)

Binary Search:
o E.g. compare looking for 1 in a list of [1,2,3,4,5,6,7]
o Compares 1 with 4 (the median) [<]
o Compares 1 with 2 (median of 1,2,3) [<]
o 1 is found

Bubble Sort
o List: [13,5,10,50,4,6,20,9]
FIRST PASS
o Compares 13 with 5. Swap. 5,13,10,50,4,6,20,9
o Compares 13 with 10. Swap. 5,10,13,50,4,6,20,9
o Compares 13 with 50.
o Compares 50 with 4. Swap. 5,10,13,4,50,6,20,9
o Compares 50 with 6. Swap. 5,10,13,4,6,50,20,9
o Compares 50 with 20. Swap. 5,10,13,4,6,20,50,9
o Compares 50 with 9. Swap. 5,10,13,4,6,20,9,50

Merge Sort:
o List: [13,5,10,50,4,6,20,9]
o Split into halves. If odd, the half with 1 fewer item on the left.
13, 5, 10, 50 4, 6, 20, 9
o Split into halves again.
13, 5 10, 50 4,6 20,9
o Split until items are individualised.
13 5 10 50 4 6 20 9
o Merge items, sorting each time item are merged
5,13 10,50 4,6 9,20
o Merge again.
5,10,13,50 4,6,9,20
o Merge again (first items of the two sublists are repeatedly compared then
appended, being removed from the sublist each time).
4,5,6,9,10,13,20,50
To make an algorithm more efficient:
o reduce number of comparisons (e.g. quit a linear search if data is ordered and found
a larger value than target value)
o reduce number of passes (quit bubble sort early if a complete pass makes no
changes)
o reduce use of memory (e.g. merge sort although quicker - time efficient - is less
memory efficient because it uses more ram than bubble sort by splitting into new
lists)

Errors:
o syntax: errors in use of the programming language, such as missing ':', misspelled
keywords, and missing or excessive indentation
o runtime: errors which cause a program to crash, such as 'divide by zero' and 'index
out of range'
o logical: errors which cause incorrect or unwanted behaviours, such as using the
wrong arithmetic operator or mixing up two variable names

Trace tables:
o e.g. trace the following
total = 0
for ch in "24576":
num = int(ch)
total += num
print(total)
ch num total output
0
"2" 2 2
"4" 4 6
"5" 5 11
"7" 7 18
"6" 6 24 24

Truth Tables:
o Complete a truth table for X = NOT A OR NOT(B AND C)
A B C NOT A B AND C NOT(B AND C) X
0 0 0 1 0 1 1
0 0 1 1 0 1 1
0 1 0 1 0 1 1
0 1 1 1 1 0 1
1 0 0 0 0 1 1
1 0 1 0 0 1 1
1 1 0 0 0 1 1
1 1 1 0 1 0 0
Topic 2:

Use of Binary:
o all data in a computer is represented in binary (sound/images/program instructions)
o because computers made from transistors which are in one of two states on/off (1
or 0)
o 8 bits have 2^8 = 256 possibilities (0 to 255) but 4 bit have only 2 ^ 4 = 16
possibilities (0-15)

Two’s Complement:
o In unsigned 8-bit binary (0 to 255), most significant bit in a byte is worth 128
o In signed 8-bit binary (-128 to 127), the most significant bit in a byte is worth -128

Conversions:
o Convert 207 to 8-bit binary
128 64 32 16 8 4 2 1
1 1 0 0 1 1 1 1
o Always 8-bit for GCSE, remember to add left zeroes if needed
o To negate a number in two's complement form :
 flip all the bits and then add one
 (or from the right, retain all the bits up to & inc the first 1 then flip the rest)
 e.g. 0010 1100 --> 1101 0100

Binary addition & Overflow:


o Overflow: when the number of bits reserved for result are not sufficient to store the
result
o For binary addition calculations
e.g 250 + 20 in 8 bit-binary,
250 = 1111 1010
20 = 0001 0100
because the maximum for 8 bit is 255 (last is a one so is odd) and total possibilities is
256 (2^n)
So result would be:
256 128 64 32 16 8 4 2 1
1 0 0 0 0 1 1 1 0
But you lose the 256 after calc so result will be 0000 1110 which is incorrect (too
small)

Arithmetic and Logical Shifts


o Both pad with 0 when shifting left
o Arithmetic: retains the first bit, Logical: pad with 0

Hexadecimal - why used:


o more visually compact/shorter for the human
o so less likely to make errors when reading/copying
o & easier to remember
o (but still uses the same amount of storage : 1 hex digit = 4 bits)
Hex to binary:
o DF 05
 D = 13 = 1 1 0 1 and F = 15 = 1 1 1 1
 0 = 0 0 0 0 and 5 = 0 1 0 1
 1 1 0 1 1 1 1 1 0 0 0 0 0101

7 Bit Ascii:
o Characters = 2^7 = 128
o Can’t store different languages
o Limited symbols

Bitmap images in binary:


o Pixels means picture element and are the smallest block of colour in a bitmap
o [Digital]Resolution means number of pixels high and wide e.g 400 wide x(means by)
200 high
o Colour depth means number of bits used for every pixel
o Bitmaps are encoded: pixel by pixel from the top left, giving the colour code for each
pixel in turn. Essential meta data also included is the colour depth and the
dimensions (width/height)
o Physical resolution e.g. 200PPI for a 800 x 400 image would print at 4” x 2”

Sampling sound using binary:


o analogue (continuous wave) converted to digital (discrete using binary 0/1s)
o samples taking at regular intervals (in hertz as set by the sample rate)
o the sample interval is the time between each sample e.g. 10 hz sample rate ->
interval of 0.1s
o the amplitude of the analogue wave is measured at each sample
o each sample is of a certain bit depth (e.g. 8 bits per sample)

Data storage:
o bit (b) is smallest binary unit, 0 or 1
o nibble is 4 bits, 1 hex digit e.g 1111
o Byte(B) is 8 bits, 1111 1111
o Kibibyte(kiB) is 1024 bytes
o Mebibyte (MiB) is another 1024*1024 bytes
o With storage we always use binary units & bytes
(different for data transmission see below)

Storage Calculations:
o e.g. 2048 by 800 pixels, 24 colour depth in mebibytes: always give expressions
o (2048x800x24)
-------------------
(8x1024x1024)
Data compression:
o Definition: Algorithm to reduce file or transmission size
o Purpose: Reduces storage on device, saves data transmission amount (so less costs
and less buffer in streaming)
o Example of utility software [software installed on OS to help it run smoothly]
o Lossy:
Permanently removes unnecessary detail that humans can’t easily notice
Cannot be restored
Reduces quality
Achieves smaller file size
o Lossless:
Original file can be fully restored
Same quality as original (have to uncompress before looking at)
Two ways of doing it: Run Length Encoding [RLE] e.g BBBB = Bx5, has to for
consecutive runs
OR Dictionary Encoding [DE] Replace repeated patterns with an index number
e.g replace word rabbit with 1, at start: have dictionary

Topic 3:

Von Neumann stored program concept:


o Program instructions and program data are stored in the same RAM
(loaded from secondary storage before execution starts)
o CPU fetches, decodes and executes one instruction after another
o The Control Unit (inside the CPU) coordinates the FDE cycle by sending signals on
the control bus
o The Arithmetic Logic Unit (inside the CPU) performs mathematical operations and
logical comparisons
o Ultra-small & fast memories inside the CPU are called registers and can store
temporary results whilst being used by the CPU
o The system clock synchronises all components (including the CPU) by emitting
regular clock pulse signals
o Fetching an instruction or data at RAM location X
 The CU loads X onto the address bus (which is unidirectional)
 The CU sends READ signal on the control bus (which is bidirectional)
 The RAM then loads the contents of X onto the data bus (which is
bidirectional)
o Writing a data value to RAM location X:
 The CU loads X onto the address bus (which is unidirectional)
 The CU loads the new contents to be stored onto the data bus (which is
bidirectional)
 The CU sends WRITE signal on the control bus (which is bidirectional)
Secondary storage:

Magnetic: HDD and old style tapes


o Solid spinning metal disk with chemical coating (platter)
o Dots of magnetic polarity, north = 1, south = 0
o Dots are arranged in concentric(circles within circles) tracks, and split into sectors
(part of a track)
o Floating read/write head either reads or changes the polarity of a dot

Solid state drive: SSD


o Blocks of NAND flash built of floating gate transistors
o Which trap charge, trapped = 0 because they prevent voltage flow, non trapped = 1
because they allow voltage flow
o Separate controller chip

Optical: CD, DVD, Blue-ray


CD:
o Laser is shone on a spinning disk
o Reflected light is measured, reflect = 1, no reflection = 0
o Single spiral track
o Disk is burnt into pits[0] and lands[1] for CD-ROM
CD – R
o If recordable CD: uses burnt dots of dye instead of making physical pits and lands
CD – RW
o Can relight dye after being burnt to rewrite disk

Uses & comparisons:


Optical: Portable, cheap, durable (but can be scratched), out of computer
Hard disk drives: Cheaper PER GIBIBYTE than SSD, available in large capacities, don’t have
limited read and writes (SSDs do) – might be used on web servers
SSD: faster read/writes, more durable as no moving parts, low power usage so less battery
used [but have limited read writes] – typically used in laptops or embedded systems

Embedded systems:
o Small computer which is part of a wider machine
o ONE specific function, not general purpose
o Have input/sensor, process the input, output [motor]
e.g. washing machines, automated headlights and windscreen wipers
o characteristics: cheap/physically small on one board (microcontroller)/ limited
memory / limited processing speed / limited user interface/ programmed with very
simple & reliable robust single program.

User management for OS:


o Authenticates valid users using login (e.g. username and password or biometric)
o OS checks the credentials against list of users
o Gives access to the device if valid

File management by OS:


o files are stored in a hierarchy of folders & files
o files can be named/renamed/moved/edited/deleted
o files have metadata maintained like the file name, file type, date edited etc
o control who has file access (access control file permissions)

Peripheral management by OS:


o OS uses device drivers, which contain instructions on how to control each device
o Any device can be used with OS, as long as a driver is available for it
o Drivers can be updated, removes bugs and improves performance

Process management by OS:


o Managing processor allocation (Processor management):
 Using a scheduler. Processes can be assigned processor utilisation times
based on factors such as sequence of process arrival (first come first served),
round robin (each process assigned fixed amount of time before being
suspended), or a priority based algorithm which judges the priority of tasks
based on the amount of memory they use and how long they will take.
o Managing memory allocation & virtual memory (Memory management):
 Used when RAM is full, created on secondary storage and acts like RAM
(temporary storage)
 Paging algorithm, divides memory up into small blocks (pages) and allocates
enough pages to hold a program
 Multitasking, ensures that more than one program run at the same time

User Interface management by OS:


o Graphical user interface: powerful and easy to use, require a lot of processing power
o Command line interface: text-based, require little processing power but takes longer
to learn how to use

Robust software:
o Software which if experiencing an unexpected input/event ...
o ...doesn’t crash, give out an incorrect result or reveal secure information

Methods of identifying vulnerabilities:


o audit trails
 record of what has been done and by who and when
 Used to keep track/record of changes to the code
 Aids in being able to restore system to previous state if needed
 increases accountability

o code reviews
 checks of source code by other experienced programmers or by AI review
 Helps identify bad programming practice
 Check the efficiency & security & robustness of the code

HLL:
o English like words
o 1 line translated into multiple machine code instruction
o Easier to read, write and debug than LLL
o Portable between different computers/CPUs

LLL:
o Machine or Assembly code
o Machine = binary, assembly = mnemonics e.g ADD 2
o One line of LLL = one CPU instruction
o Specific to that one CPU
o Gives complete control of RAM/CPU so likely to be faster

Compiler:

Interpreter:

Topic 4:

Why do we network:
o To share between users/computers:
 files,
 messages (communication)
 and hardware (e.g. printers/internet connections)

LAN :
o Small geographic area
o All equipment owned and configured by one business/person

WAN:
o Wide geographic area (Internet is the biggest example)
o The networking connections between areas are leased / not all owned by the
business

IP Address:
o Uniquely identifies a device whilst connected to the internet
o Four byte format e.g. 217.156.102.84
o Added to each packet (sender IP address & destination IP address)
o ....which are used by routers (checking their routing tables at the network layer) to
direct packets

Wired v Wireless:
o Speed is higher on wired (measured in bps bits per second transferred)
o Latency is higher on wireless (the delay between sending/receiving measured in
seconds)
o Wireless has more interference between competing traffic & also encrypts which
increases latency / reduces speed

Measuring Network Speeds


o In denary units and bits e.g. Mbps
o Network speed (in bits per second) = File size in bits / time taken in seconds
o expressions given again e.g. time to transmit 2 MiB file at a rate of 4 Mbps:
2 x 1024 x 1024 x 8
------------------------ seconds
4 x 1000 x 1000

Application Layer Protocols:


for email
o POP3: to retrieve emails & delete them from the mail server
o IMAP: to retrieve emails but leave a copy on the mail server
o SMTP: to send emails
for web browser:
o HTTP: to request a web-page (HTTP REQUEST) / send the response from the web-
server (HTTP RESPONSE)
o HTTPS: (secure - encrypted)
for file-transfer:
o FTP: governs the transmission of files across a network and the internet

4 layer TCP/IP model:


o Application:
 top-level network request on behalf of the application/user
 e.g. POP3 to request emails
o Transport:
 establishes a channel between sender/receiver
 splits the message into numbered packets (with packet sequence number)
 add detects errors in transmission (using checksums added to each packet)
o Internet: adds IP address of sender/receiver to each packet & used by routers at
each hop which extract the destination IP and looks it up in its routing tables to
choose next hop
o Link: physically encodes onto the cable (with ethernet protocol) / or radio
waves (wifi protocol)
Topologies:
o Star: all devices are connected to a central hub/switch
 Switch receives each packet, looks at its destination (MAC) address and
sends it to the correct device
 Fewer collisions (if a switch not a hub) but the switch is a central point of
failure
 Limited in extending the network to the number of connector ports on the
switch
o Bus:
 Devices connected to a central backbone cable (with terminators at each
end)
 If the backbone breaks then all the devices loss their connection
 Lots of collisions will slow down achieved network speed
 Adding a device disrupts the network (to break the backbone to insert the
new link)
o Mesh:
 Every device is connected to multiple other devices (every other device if
fully connected)
 If you break any of the connections you can still route your traffic via
another route
 A lot more cabling required which will add to the cost
 Used on the Internet which is a WAN mesh network (mesh of routers)

Importance of network security:


o protecting the system against hackers / malicious software
o protecting data

Ways to identify network vulnerabilities:


o ethical hacking:
 Ethical hackers (white hat hackers) carry out penetration testing on behalf of
a company
o penetration testing:
 Attempting to gain access to resources without knowledge of usernames,
passwords and other normal means of access
 White box penetration testing
 Simulates a malicious insider who has knowledge of and often basic
credentials for the system being targeted
 Black box penetration testing
 Simulates an external hacking attempt to a company or organisation
or a cyber warfare attack

protection methods:
o Firewalls:
 Checks all packets in and out of the network
 Blocks those packets that don’t meet the configured rules
 Can help prevent hacking / unauthorised access and also Worms/malware
spreading or employees accessing unsafe/unwanted sites
o Physical security:
 CCTV
 Security guards
 Door locks / Secure access areas/ staff passes / fences
o Access control:
 Only someone with a valid username and password can gain access to
device
 Network manager might insist on password rules
 Authentication is the process of establishing the identify of the user by a log-
on process
 Different users can have difference access levels once established
(administrator/user etc)

Topic 5:

Environmental for use of digital devices


o energy consumption:
 consumed when manufactured & transported
 consumed when used (e.g. cloud storage farms use lots for processors & for
cooling)
 consumed when disposed of e.g. for recycling process
 (all energy use produces carbon emissions unless renewable energy source)
o manufacture:
 uses up precious metals / finite resources (e.g. silicon)
 carbon emissions in manufacture
 ROHS: legislation which restricts/bans uses of certain limited or dangerous
materials for certain uses.
o replacement cycle:
 encourage users & businesses to extend lifetime of devices (reduce their
replacement cycle)
 have devices repaired not replaced - and ensure they get passed on e.g.
donated or sold for more use
 this means less resources & energy will be used in too frequent
replacements/upgrades
o disposal
 landfill - scars the landscape
 and leaks toxins into nearby water supplies (human/animal/plant health
implications)
 burning - releases fumes/emissions
 human waste processors (often poorer countries) handling dangerous
toxins/contamination or poisoning
 encourage responsible disposal via:
 WEEE directive (companies who manufactured must take back and
recycle)
 recycling plants should recover valuable materials/metals & safely
dispose of the rest

Ethical/legal for personal data collection/use:


o privacy: user's rights/expectations of privacy (e.g. at home / in communications)
which companies should not invade and also ensure their customers' data stays
private
o ownership: the user is still the owner of their own data & the company is the
steward of that data with responsibilities
o consent:
 Must be freely given and fully understood (not hidden)
 Can be withdrawn
 A record of it should be kept & continued consent periodically updated
o misuse issues (e.g. used for a different purpose or shared with a third party without
consent or for malicious purpose)

o data protection:... principles of the Data Protection Act (GDPR)


 Keep data secure (e.g. encrypted)
 Keep data accurate / up to date
 Don’t keep data longer than needed or keep more data than needed
 Use it only for its declared purpose and use lawfully
 Don’t share it with other third parties without consent
 Allows users to view the data held on them / update it

Ethical/legal for AI/machine learning & robotics


o Algorithmic Bias:
 Programmer bias
 Machine learning bias due to
 Training data used is biased
 Training data used is too limited / insufficient
 Training data used is non-aspirational
o Accountability:
 difficult/impossible to tell why a machine learning algorithm made the
decision it did
 are programmers/software companies accountable for the software they
program - how about if new training data is used or the software develops
further / makes different decisions under real-life usage?

o Legal liability:
 who is responsible for mistakes (the owner / the manufacturer / insurance
companies?)
o Safety:
 does the AI/algorithm pose social risk?

Methods of IP (intellectual property) protection:


Protects (type of Length of time Conditions to have
design) protection
Copyright Original works (books, Life of creator + 70 Work must be original
music) years after death of
creator
Patent An idea or design of Over 20 years Invention must be new and
an invention non-obvious (to some
"skilled in the art")
Trademark Words, phrases, Length of the time Must be distinctive
designs attached to a that the trademark is
buisness in use
o Licensing:
 Allowing other people to utilise the IP without gaining ownership. For
example, users can access a free license to use a programme, but some
features are paywalled by paid licensing.

Cybersecurity:

Understand threats from malware


o viruses
 Malicious code which can replicate itself (from one host program to
another)
 and has a detrimental effect such as corrupting the system or destroying
data
 Requires human interaction (e.g. opening an application / attachment) to
spread
o worms
 Worm can self-replicate to spread without the need for human interaction
e.g. through a network connection or by sending emails to address book
contacts
 Doesn't require a host application to be emedded in (standalone program)
o trojans
 Program that appears harmless & useful even but is in fact malicious
 Trojans are recieved when people download software, games, patches, or
other data off the internet from unreliable sources
 Trojan can install backdoors into your system for external hackers to bypass
computer security.
o ransomware
 Form of malware which encrypts a victims files.
 The attacker demands for a ransom to restore access to the data upon
payment
 Users are shown instructions for how to pay a fee to get a decryption key.
 Often payable in bitcoin
o key loggers
 Software that obtains covert information about another's computer
activities by silently monitoring and recording keystrokes.
 Often installed via a trojan
 Monitoring:
 Email addresses
 Web pages visited
 Passwords
 Credit card numbers
 Internet surfing habits

Understand how hackers exploit technical vulnerabilities:


o unpatched software:
 can exploit new weaknesses that have come to light since release
o out-of-date anti-malware:
 malware that is not yet identified in the malware (signature/behaviour)
library
o social engineering attacks:
 phishing - messaging designed to redirect victim to a specific form, site or
checkout to enter private information.
 blagging / pretexting. Using pieces of known information to drive victims to
reveal more information utilising a false identity. e.g. using your birthdate
and full name to ask for your credit card number, pretending to be your
bank.
 baiting. taking advantage of a victim's curiosity or greed, e.g. plugging in a
USB you found on the ground.
 quid pro quo. favour granted in return for something.
o How to protect against these attacks:
 Train/educate employees and users:
 to check sources and ids // not open unrequested attachments or
click links in emails
 to have clear security protocols and use passwords
 Communicate between departments

Methods of protecting digital systems

Anti-malware
o Helps keep your computer and files safe from many types of malware
o Virtually all OS come with malware protection prebuilt

Encryption:
o Process of turning plain text into an unreadable form
o Encrypted using an encryption algorithm (a cipher) and a unique key
o Only user with appropriate key will be able to translate the cyphertext back into
readable form.
o Doesn't stop hacking but makes the data unreadable if obtained or intercepted

Acceptable use policies:


o Protect users by clearly stating what use of a network systems resources is
acceptable
o Doesn't stop employee from misusing the computer system, but does provide a way
of easily dealing with such actions and puts off an employee from misusing the
system as they know what consequences they will face.

Backup & Recovery:


o Full backup: all files on the system vs Incremental: only those changed since last
backup
o Should be backed up often, regularly (scheduled)
o ...and to disconnected storage (i.e. a portable hard drive or to the cloud)
o Recovery: restoring files/data to its original state
o Possible advantages/disadvantages (e.g. cloud backup can have scalable storage &
can access anywhere but internet transmission makes it slower to restore and could
also be internet security issues)

Exam Technique:
o 75 marks in 90 mins
o Over a min per mark
o 1 question per topic (with different parts)
o Relax at the START in particular and pick your own first question to slowly get into it
o Look at one clear point made per mark in explanations
o Cover yourself with extra points on explain / describe but not on state questions (e.g
don’t give 3 reasons if it asks for 2 but you can still cover yourself with explanation in
brackets e.g. SSDs are more robust (since they have no moving parts).)

You might also like