Aqa A Level Computer Science Theory v1
Aqa A Level Computer Science Theory v1
ORG
AQA A LEVEL
COMPUTER
SCIENCE
SUMMARIZED NOTES ON THE THEORY SYLLABUS
AQA A LEVEL COMPUTER SCIENCE
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
00110010 00010100
10110101 + 11110011 +
11100111 ANSWER 00000111 ANSWER
11 carry 111 carry
Multiplying unsigned binary: multiply the binary by the The answer can be checked by converting the final
first digit of the second number. Repeat for the next digit, answer into denary
shifting the answer along by 1. Then add the resultant In this case there is an overflow bit. It is handled
numbers together for the answer. separately to the calculation
Calculate range: using 8 bits, 256 numbers can be
11011 represented (-128 to 127)
11 * Arbitrary number of bits: 2n numbers can be represented
11011 Unsigned binary: 2n-1 (as 0 is representable)
110110 + Two’s complement range
1010001 ANSWER Minimum representable value = (-2n-1)
Maximum representable value (2n-1-1)
1111 carry
Fractional Parts
Two’s Complement (Signed Binary)
Fixed point
A method that can be used to represent negative
integers, where the most significant bit is negative. Representing a fractional part using a fixed decimal point.
After the point, digits become fractions
Converting to denary Smallest representable number using 8-bit fixed point
is 0000.0001 = 1/16 = 0.0625. 256 combinations can
An 8-bit two’s complement number has -128 as the most be produced.
significant bit.
Write out denary equivalents (with sufficient columns 8 4 2 1 1/2 ¼ 1/8 1/16 ANS
(doubles each time) for the length of the binary string) 0 1 1 0 0 1 1 0 6.375 or 6 3/8
Enter binary string in (eg. 10011100)
Add up values (eg. = -100)
Negative numbers can be made by making the MSB
negative.
-128 64 32 16 8 4 2 1 ANS
eg. (-8) + 4 + 2 + ½ + ¼ = -1.25
1 0 0 1 1 1 0 0 -100
-8 4 2 1 1/2 1/4 1/8 1/16 ANS
Converting from denary 1 1 1 0 1 1 0 0 -1.25 or -1¼
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
Vital in the age of international communication so Analogue: uses continuously values which produces a
that data does not arrive corrupted continuously changing waveform
Digital: discrete (discontinuous) values to represent
1.8. Error Checking and Correction values
ADC: an analogue to digital converter turns real world
Parity Bits: an additional bit added onto a binary string to continuously changing waveforms into a digital signals for
make total number of 1s/0s even or odd. In a byte, 7 bits computers
are sent + the additional parity bit Samples analogue signals at set time values and
Even Parity: parity bit added to make total number of records amplitude
1s an even number. Checked on receiving end Quantization rounds amplitude up or down so value
Odd Parity: parity bit added to make total number of fits in bit resolution
1s an odd number. Checked on receiving end Required so that computers can interpret the
Majority Voting: each bit in a binary code is sent a set analogue signals that sensors produce
number of times, and then checking if the binary digit is DAC: turns a digital signal into an analogue waveform
the same each time. that real world devices can use
10 sent as [4] = 11110000 Required to turn a digital audio signal into an
An invalid transmission of 10 as [4] could be: analogue signal for speakers
11010001
Checksums: is the result of a cryptographic hash function 1.10. Images
ran on a piece of data to return a value. If the value
returned is equal to the value provided by the source Bitmapped Graphics
data, then transmission was successful
Check Digits: digit is added on the end of binary data to Pixel: the smallest picture element of an image
check it is accurate. Modulo-11 is a common way to Pixel Grid: a bitmap image is made up of a grid of many
calculate a check digit pixels. Each pixel is assigned a binary value that controls
Eg. 23045 is sent as 230456, so check digit is added, its colour
and then ‘modded’ until the value reaches 0. If Resolution: an image’s size. Can be represented by
calculation performed on receiving end does not Pixels/Dots Per Inch, which is how many pixels/dots there
match, and error message is created are in each square inch
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
path then has values for stroke colour, shape, curve, When to play/stop a note
thickness, fill colour… Note length/volume/velocity/pitch
Effects to apply to notes
Bitmap Vectors Timing notes to play with other sounds/notes or with
Common file types, other MIDI devices
Small file size,
allows any Advantages
Advantages complete scalability
complexity, suited for Smaller file size than a pure sound file – load faster
with no quality loss
popular IO devices Fully editable – each note/instrument can be changed
Memory intensive, Cannot reproduce Supports a huge range of instruments
Disadvantages when enlarged, continuous tone, may High quality and authentic sound/instrument
pixilation occurs need special software reproduction
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
2.3. Translators
Assembler: turns assembly code (source) into machine
code (object)
Compiler: converts entire source code into object code
before execution. Produces full error report once
compiled
Advantages Disadvantages
Takes a long time to debug,
No translator needed once
since whole program must be
compiled (.exe file)
translated
Object code only runs on the
Hard to reverse engineer
same platform
Portable
Fast to execute, object code
ran immediately
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
Boolean Algebra
2.5. Roles of an OS
The operating system acts as an interface between the
hardware and the software to manage the computer’s
operation. A virtual machine is created that hides the
complexity of the computer from the user and other
software.
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
Architecture ALU
Performs arithmetic calculations - add, subtract,
multiply etc.
3.1. Internal Components Logical decisions - Boolean decisions based on binary
patterns
Processor: a device that performs computation on data Control Unit: synchronises fetch-execute cycle and
by following instructions to produce an output ensures that data being processed is correctly routed
Main memory: used to store data and instructions that Clock: signal generator that synchronises the fetch-
the processor has fetched, ready to be used execute cycle and computer components.
RAM: random access memory that is extremely fast and General-Purpose registers: small but extremely fast piece
volatile. All, or part of a running program will be stored of on-chip memory that stores data or instructions during
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
fetch-execute cycle An 8-bit bus would allow for 256 data items (256
Are outside the IAS, therefore allow faster access to bytes). Adding another wire doubles capacity. 32-bit
the data they store now standard, allows 4GB of addressable memory
Registers
PC: stores memory location of next instruction 3.6. Fetch-Execute Cycle
needed by processor, so it can be placed in the CIR
CIR: stores the instruction currently being executed by Fetch
the processor PC contains address of next instruction to be fetched
MAR: stores memory location of where data or Next instruction address passed to the MAR
instruction in the MBR is about to be written to or Address bus transfers address to main memory
read from Contents transferred along the data bus
MBR (MDR): holds anything copied from memory PC incremented (ready for next fetch)
ready for processor. Stores data that has just been/is Contents of addressed memory location loaded into
about to be written to main memory MBR
SR: stores the result of comparisons for decisions Contents of MBR transferred to CIR.
later on; such as immediate arithmetic results or Decode
errors (overflow), and keeps track of various parts Instruction in CIR passes to the Control Unit
Accumulator: single general-purpose register in ALU. Control Unit splits instruction into the opcode and
Stores values when processed by arithmetic and operand
logical operations Opcode decoded using CISC (complex-) or RISC
Interrupt Register: stores any interrupts received from (reduced instruction set).
I/O controllers or other components attached to Execute
processor Data fetched if necessary
Index Register: used to modify operand addressed Opcode identifies what type of instruction it is
during program run if address is indirect. Constant Instruction is actually executed
from instruction added to Index Register contents to Will vary depending on instruction being passed
form address to operand/data through
Result stored in accumulator
3.4. Architecture Status register updated.
If instruction is a jump/branch instruction, address is
Harvard architecture: has physically separate memories loaded into PC and cycle restarted.
(and buses) for instructions and data
Advantages: instructions and data is handled much 3.7. Instruction Set
quicker. Faster and more efficient execution.
Optimised chips have lower power requirements Every processor has its own instruction set; a pattern of
Uses: embedded systems with a specific use. Digital 0s and 1s that represent particular commands and
signal processing compresses analogue data and for associated meanings
faster processing. Can either be RISC (reduced) or CISC (complex)
Von-Neuman architecture: data and instructions are Opcode: mnemonic that represents what the statement
stored in the same memory and accessed with the same does
busses Operand: a value, memory address or register
Uses: general-purpose computing systems Addressing mode: defines which addressing mode to use
Comments: may be included to make program clearer
Defined as: ‘comment’
Number of bits assigned to the opcode defines how many
opcodes are possible:
Eg. 24 = 16
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
frequently used instructions and data in a program For colour each pixel has multiple cells, each with a
Clock speed: defines how fast each instruction will be filter to only allow R/G/B through. This forms a picture
executed. Increasing clock speed increases rate of for each colour, which are then combined
execution Note: RAW files are uncompressed, and contain all the
Word length: 32- or 64-bit means that 32/64 bits can be ‘raw’ light data. A Bayer filter has colour filters
handled in one pulse of the clock. 64-bit word length 2G1R1B, which is closer to how human see colour
needs 64-bit busses
Word: collection of bits that can be addressed and
manipulated as one unit
Address bus width: increasing will increase the amount of
memory that can be accessed and therefore the amount
that can be installed
Data bus width: increasing allows more bits to be passed
down it with each clock pulse, so more data can be
processed within a given time interval
CCD CMOS
High quality Susceptible to noise
4. External Devices Lower light sensitivity due to
Low noise
transistor density
4.1. Barcode Reader Consumes 100x more power
Consumes little power
than CMOS
Characteristics: handheld input device that uses light to Matured technology Rolling shutter
read dark portions of a barcode/QR code Global shutter
Purposes: to input a number into a computer system
quicker and more accurate than manual input. Used by
shop POSs to match stock to database 4.3. Laser Printer
Suitability: reduces RSIs, easy to use, reduced error
Operation Characteristics: output device that produces
IR LED passed over code, reflected light from white monochrome/colour prints using a laser and powdered
sections detected by CCD or photodiode toner
Analogue waveform converted to a digital signal using Purposes: produce whole page prints at once. Used in
ADC. Computer converts signal to binary to represent offices/schools due to clear text
the code Suitability: fast page production (20-200ppm vs 5ppm
Eg: 0 = black, 1 = white with inkjet). Not good photo reproduction, more reliable
Error detection applied (parity bits and check digits). than inkjet. No risk of bleed-through or ink spills, as toner
Reader will scan multiple times/second until is dry powder. Prints last a long time
computer confirms correct code Operation
Drum is made positively charged by coating with an
electric charge holding chemical
4.2. Digital Camera Laser beam is reflected by mirror to discharge certain
sections of drum – leaving an impression. The mirror
Characteristics: captures digital photographs by turning
moves instead of the laser to reduce complexity
analogue light data to a digital bitmap file, that can be
Toner roller dispenses negatively charged toner on
transferred to a computer to be manipulated or printed.
drum. Opposite charges attract, so toner coats
Lens focusses light onto sensor, shutter regulates light
positive
hitting sensor
Positively charged paper passes under the negatively
Purposes: capture digital video or photographs
charged toner, so toner transfers
Suitability: now small enough to be pocketable,
Fusers heat the toner to make it fuse to the paper
implemented in smartphones – produce lower resolution
Drum is discharged by corona wires
images (JPEG/TIFF), ideal for social media. Professional
Note: for CMYK, process is repeated for the colours
cameras have higher quality and more capabilities
with different rollers and coloured toners
Operation
Shutter opens allowing light through camera
Lens focusses light on CCD or CMOS sensor
Light hits cell, representing a pixel, converted to a
charge and value recorded
Recorded values put together to form an image,
stored on solid state storage as JPEG/PNG files
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
5. Consequences of Using
Computers
5.1. Development of Computing
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
5.9. CDPA
Copyright, Design and Patents Act: creators of material
have a right to grant them control on how their material
is being used
Applies to: all creative works, regardless of format. Serial transmission: data is transmitted one bit at a time
Covers accessing, copying, adapting, selling and
down a single wire
renting Advantages: low cost (one wire), no skewing risk – can
Illegal to: produce copies of software or run more be used for long-distance communication
versions than have licences for. Downloading films or Disadvantages: slower data transfer as only one bit
audio without permission from copyright holder sent per clock pulse
Techniques
Digital Rights Management: uses access control
software to limit how users use, control, copy, edit
or print content
Licensing of Software: requires paper-
based/digital proof of legal purchase/license, and
installation within terms of licence Synchronous: data is transmitted where clock pulses are
in sync or both devices share a common clock
Asynchronous: data can be transmitted between two
5.10. Other Laws
devices that have a synced clock signal only for the time
of transmission
The Official Secrets Act: prevents disclosure of
Start/Stop bits: used to indicate the start and end of a
government data that relates to national security
The Defamation of Character Act: prevents people from unit of data in asynchronous data transmission
Start bit causes syncing of receiver clock
making/creating untrue statements about others that
could lead to reputation damage Devices agreed number of bits to follow, if/what
parity is used, number of stop bits
The Obscene Publications Act: prevents the dissemination
of pornographic/violent images Stop bit indicated data has arrived
Next data prefaced with start bit
The Protection of Children Act: schools and public access
computers should filter web content. Indecent images of Data sent without waiting for clock pulse or
synchronisation message
children is a criminal offence
Health and Safety Regulations Act: provides regulation of
correct use of screens and is an addition to the Health
and Safety at Work Act, which contains more general
regulation for employee safety
Equality Act: makes discrimination against anyone based
on sexuality, gender, ethnicity, religion, disability or age
illegal. Includes dissemination of derogatory material Baud rate: number of times a signal in a communication
channel changes state
Differentiate: bit rate can be higher than baud rate if
6. Fundamentals of more than one bit is encoded in each signal change.
Bit rate and baud rate will only be equal if the bit rate
Communication and is 1bps
Bit rate = Baud rate x number of bits per signal
Networking Bit rate: the number of data bits transmitted per second –
measured in bits per second
Bandwidth: measure of a communication channel’s
6.1. Communication maximum capacity. Greater bandwidth means greater
volume of data can be transmitted. Speed is defined by
Parallel transmission: data is transmitted several bits at a
bit rate
time, along multiple wires
Bit rate relationship: bit rate is directly proportional to
Advantages: very fast transfer due to bits being sent
bandwidth
simultaneously – connects processor and memory
Latency: the time delay before a computer component
Disadvantages: more wires = more expensive,
responds to an instruction
degraded signal over distance (interference between
Protocol: a set of rules relating to communication
wires), skewing of bits occurs
between devices. Where the same protocol is used,
communication can happen
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
6.4. TCP/IP
A suite of protocols for sending information around the
Internet or a network
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
Trojans: program that may allow unauthorized access or Advantages: efficient for large data transfers, data
cause harm to a computer that is packaged into another recovery, resume/schedule transfers, allows different
file, or as useful software host configurations (PC/MAC)
Do not replicate, may go undetected for a while Disadvantages: not secure, no encryption, should be
Some are annoying; change background etc used on a limited basis or only on secure networks
Some are permanently damaging, create a backdoor HTTP: allows web-based applications to exchange images,
by offering remote access to a hacker – allowing text, videos, documents… It is stateless, meaning client
further crimes and server only know each other during the request.
Viruses: malware designed to cause damage to a system HTTP plain text message contains start line, headers and
or data body
Attaches itself to another program or file, enabling it Request-response cycle: physical connection à URL à
to spread from one computer to another HTTP message request à HTTP message response
Acts like a human virus – leaves infections as it travels, Port: 80
but must be ran on system to infect it. Advantages: adapted to allow most file types,
Low level severity: annoying pop-ups convenient and reliable
Severe virus: destroy whole networks and databases Disadvantages: vulnerable to interception – no
Worms: virus subclass that does not need a host file or encryption
human action to spread HTTPS: uses SSL/TLS to authenticate certificates, then
Replicates and is designed to spread itself, maybe by proceed with encryption
sending itself to all contacts, or spreading on a Port: 443
network POP3: method of retrieving email from an email
Normally consume all resources and bandwidth so server by downloading the inbox folder. Default: once
systems and servers stop responding stored locally, deleted from server; but most clients
Famous examples such as ‘Iloveyou’ and ‘Melissa’ offer option to keep on server
spread via email Ports: 110 or 995 (secure)
Protection Advantages: email viewable offline, as downloaded.
User precautions Saves space on email server. Fast to view since
Use anti-virus software and firewall already downloaded
Keep software up to date Disadvantages: backup needed in case emails lost
Use a whitelist from device, more vulnerable to viruses as emails are
Use strong passwords fully downloaded
Ensure encryption/HTTPS IMAP: method of retrieving email from an email server by
Do not open attachments unless trusted caching emails on a client’s device, and not deleting them
Programmer precautions from the server
Use a language with built in security Ports: 143 or 993 (secure)
Use encryption Advantages: allows multiple users and device access
Set admin rights Disadvantages: must trust and rely on provider for
Don’t load internet services into code security, servers need large quotas to deal with many
Test for exploits accounts, provider gives user small set space to store
Keep program up to date emails
Never trust the user SMTP: simple mail transfer protocol is a set of commands
System precautions that authenticates and directs the transfer of email.
Ensure requests are from authorised users Sends email to SMTP server, and is used to transfer email
Use firewalls and encryption to recipient’s email server. Message contains headers and
Keep anti-virus protection updated a body
Update software and network OS often Ports: 25 and 587
Advantages: guarantees delivery if address is correct,
6.8. Standard Application Protocols otherwise returns error message. Encryption can be
added with SSL/TLS.
FTP: used to transfer files over a network, and allow web Disadvantages: limited receive ability, both clients
designers to upload their files to web servers – with must be online
guaranteed file delivery Normal computers can be FTP SSH: set of rules for secure remote computer access, to
servers. FTP client software has a GUI. May require a execute commands and manage. Provides several
username/password options for strong authentication, protects
Ports: port 21 to establish connection and control communications security and integrity with strong
data. Port 20 to transfer data. Port 22 for SFTP encryption. Uses both symmetric and asymmetric
(encrypts with secure shell) encryption. Uses client server model
Port: 22
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
Advantages: very good encryption Dynamic Host Configuration Protocol: a set of rules that
Disadvantages: not available until system starts, issues unique IP addresses on a LAN, as devices connect
unable to log in if misconfigured, if private key to it
lost/deletes, unable to transmit. CLI hard to use Static: IP address remains the same
Other uses: used to make a TCP connection to a Dynamic: IP address is automatically allocated for the
remote port to send commands to it, using session (by a program upon logging on), but might be
application level protocols such as GET for HTTP reserved/reused for later use
Email server: stores, and manages the transfer of email Very efficient for busy networks as an admin doesn’t
files until they reach their destination have to manually assign IP addresses to each device
Web server: returns web pages in text form Dedicated server: manages a list of assignable IP
Web browser: retrieves web pages/resources and renders addresses and gives them to devices. A device may
them for the user using CSS files for styling receive the next item in the list, or their last used one
DHCP
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
SQL operators
= Equals to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
<> Not equal to
IS NULL Check for null values
The concept of database creation that uses tables of CREATE DATBASE <database-name>
Entity: an object about which data will be stored ColumnName DATATYPE NULL/NOT NULL,
Use of normalisation
Remove data duplication ALTER TABLE <table-name>
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
WHERE <condition>
Atomicity: any change must be fully completed or
data returns to original state
Insert data Consistency: values in database should not change
between devices
INSERT INTO <table-name> (field1, field2...)
Isolation: each operation must occur in isolation, with
VALUES (value1, value2...)
no interruptions
Durability: any changes must be maintained, with no
Delete data
data loss
DELETE FROM <table-name>
DBMS responsibilities
WHERE <condition>
Controls where data is stored,
The database structure,
DELETE * FROM <table-name>
Access permissions,
Data integrity,
DELETE FROM <table-name>
What data programs can see.
Managing concurrent access: reading is OK, issues come
TRUNCATE TABLE <table-name>
FROM <table-name>
GROUP BY <field-name>
8. Big Data
HAVING <condition>
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
fields/records)
Machine learning: required to decipher patterns in
qualitative data in order to extract any useful information
Pattern recognition: in a review system; looks for
positive/negative words to reach conclusion
Artificial intelligence: computer learns for itself given
large amounts of data – predictive analysis
Size: relative to all applications, impact is most significant
when multiple servers are required to store data (eg.
relational databases do not scale well across multiple
servers and are therefore not appropriate)
Constant data streaming and change: sensors, clicks,
keyboard inputs, personal data etc…
Power demands: intense processing and storage
Correlations: do not always mean a result is found
Function Application
WWW.ZNOTES.ORG
AQA A LEVEL COMPUTER SCIENCE
Passing through less than the full number of arguments odd and even can be used in addition to numerical
to a function that takes multiple arguments conditions
The function takes one argument after another in order filter (>3) [1, 2, 3, 4, 5..]
to produce a result = [4, 5..]
Example: add takes two integers and produces an integer Fold (reduce): reduces a list of values to a single value by
result repeatedly applying a combining function to the values
‘Add 4’ produces a function Returns: a single value
This function is then applied to another integer (3) Operator: (operator)
So 4 is added to 3 to produce an integer result of 7 Start value: number between operator and list
add :: Int → Int → Int fold (+) 0 [1, 2, 3, 4, 5..]
add x, y = x + y = 15
add 4 = 4 + y
add (4 + y), 3 = 4 + 3 = 7 9.3. Lists in Functional Programming
Composition of Functions Lists are powerful data structures, where all the elements
are homogeneous
Combining multiple functions to produce a new one
A list is always written in square brackets; []
Composition of g and f (g ○ f)
Identifier: the name of the list
g: B → C
myList = [1,2,3,4,5] or myList = [1..5]
f: A → B
Head: single first element in a list
g ○ f is a new function
Tail: remainder list once head has been removed
Domain: A
Head:tail: lists can be represented as a combination of
Co-domain: C
the list tail prepended onto the head
F is applied first, then g
1:[2, 3, 4, 5]
f(x) = x + 2
Empty list: a list can be empty, show by []
g(y) = y³
List operations
g ○ f = (x + 2)³
Return list head
head myList = 4
9.2. Writing Functional Programs Return list tail
tail myList = [2, 3, 4, 5]
Higher order function: takes a function as an argument, Test for an empty list
or returns a function as a result, or both null myList = false
Map: applies a given function to each element of a list Return length of list
Returns: a list length myList = 5
map (^2) [1, 2, 3, 4, 5..] Construct an empty list
= [1, 4, 9, 16, 25..] let myList2 = []
Filter: processes a list in an order to produce a list Prepend to list (must be element)
containing exactly the elements from the original list that 6:myList = [6, 1, 2, 3, 4, 5]
match given conditions Append to list (must be list)
Returns: a sublist myList ++ [6, 7, 8] = [1,2,3,4,5,6,7,8]
WWW.ZNOTES.ORG
AQA A LEVEL
Computer Science