CAIE - A2 Level - Computer Science
CAIE - A2 Level - Computer Science
ORG
CAIE A2 LEVEL
Authorized for personal use only by Aditya Jain at Homeschooled generated on 16/05/26
CAIE A2 LEVEL COMPUTER SCIENCE
Pointer Data Type: A user defined non-composite data type that is used to reference a
memory location.
1. Data Representation
TYPE <Name> = ^<Type>
Record: A composite data type that is a collection of related items which may or may not Allows for batch processing.
have different data types Allows the data to be stored and sorted in a specific order.
Classes: In object-oriented programming (OOP), a class is the base for creating objects. It has Sequential: In sequential access records are read in the order that they are stored in.
methods and properties. It is read record by record until the record is found or the key field value is exceeded.
// Class definition This is used for serial and sequential file organization.
CLASS Bird Direct/Random Access: In random access you can directly access the data needed.
PRIVATE Name: STRING
This is used in both sequential and random file organisation.
PUBLIC PROCEDURE NEW(pName: STRING)
Name ← pName In sequential, index of all the key fields is used, while hash algorithm is used in random file
ENDPROCEDURE organization.
ENDCLASS
1.3. Floating-point numbers, representation and manipulation
// Implementing inheritance
CLASS FlyingBird IMPLEMENTS Bird Floating point representation
// Class info... Mantissa: Represents the numbers. If we increase the bits allocated to the mantissa, we
ENDCLASS increase accuracy.
// Creating an object
Exponent: Represents the number of times the decimal place needs to move. If we increase
the bits allocated to exponent, we increase the range.
<name> ← NEW <class_name>(<parameter1>, <parameter2>, ...)
MyPet ← NEW Bird("Kiwi") M × 2E
Enumerated Data Type: A user defined non-composite data type that contains an ordered 0 ⋅ 1101
list of all possible values.
2. Multiply with 2 to the power of the exponent (Move the decimal point the same number
TYPE <name> : (<value1>, <value2>, ...)
of places as the exponent)
TYPE Days: (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday)
TYPE Numbers: (1..10) // Inclusive 0 ⋅ 1101 x 23 \0110 ⋅ 1
DECLARE Today: Days // Declaration
Today ← Sunday 3. Convert to decimal by multiplying
Today ← Today + 1 // Value is now Monday
1
(4 × 1) + (2 × 1) + ( × 1)
2
Converting from Float to Binary Digit TCP maintains connection between two nodes and ensures delivery of data between the two
nodes.
6.5
IP provides rules of exchange for packets and decides the route for sending packets.
Make the float into an integer by multiplying by factors of 2 tilt it becomes a whole number.
13
6.5 =
2
Now multiply the denominator by multiples of 2 till it is larger than the numerator.
13 1 13 2 13 3 13
2 4 8 16
So we get exponent as 3 which in binary is 0011. Now for mantissa, we slowly split 13
16 into
factors of 12 .
13 1 12 1 6 1 3 1 1 2 1 1 1
= + = + = + = + + = + +
16 16 16 16 8 16 4 16 4 4 16 4 2
Normalization
For a positive binary digit, the first two bits need to be different. (Removing extra zeros before in
between the decimal and the first 1 digit).
Benefits:
Avoids two of the same number being represented differently.
Maximizes the potential precision.
Allows us to store the maximum range of numbers in the minimum number of bits.
Negative binary numbers
For negative binary digit, the first bit needs to be 1.
The mantissa are shifted until we arrive at 1.0, then the exponent must be changed to reflect
the change.
Application Layer:
For example:
The application layer provides user services.
1.1101100 --> 1010
Encodes data in an appropriate format when sending a message
1.0110000 --> 1000
Performs the action requested by the user when receiving a message
Unlike positive normalisation, the number of changes are subtracted from the exponent.
There are the main types of protocols:
Important values HTTP and HTTPS (Hypertext Transfer Protocol): Used to transfer webpages from server to
client. HTTPS is more secure.
Largest positive number 0111 1111 0111
FTP (File Transfer Protocol): Used for sending and receiving files over the network between
Smallest positive number 0000 0001 1000
two devices.
Smallest normalized positive number 0100 0000 1000
POP3 (Post Office Protocol): Used for receiving emails.
Largest magnitude negative number 1000 0000 0111 IMAP (Internet Message Access Protocol): Also used for receiving emails. The email client
retrieves the emails from the mail server.
Errors
SMTP (Simple Mail Transfer Protocol): Used for sending emails
Rounding Error: When numbers can’t be represented be represented exactly in binary, an Transport Layer:
approximate value is used which is either more or less than the needed value. When these
numbers are then used in operations, the inaccuracies get added to the point where they Handles packets.
are visible in the final answer. Like 0.1 + 0.2 = 0.3000000000004 Converts the data received from the application layer into individual packets when sending a
Underflow: Underflow occurs when a number is too close to zero to be accurately message.
represented in binary, leading to a loss of precision. Adds packet headers and then sends these packets to the internet layer.
Overflow: Overflow happens when a number's magnitude exceeds the limit that can be Controls the flows of packets and handles packet loss or corruption.
represented in a given number of bits. When receiving a message, it reads the header and determines which application layer the
data must be sent to, then strips the header and forwards it
Internet Layer:
2. Communication and Internet Technologies
Handles the transmission of data using IP addresses.
2.1. Protocols Identifies the intended network and host and then transmits the packets through the data
link layer.
A protocol sets the rules of the communication. Protocols allows for devices to communicate
Routes each packet independently through the best route available
across different platforms. If two devices attempted to communicate while using different
protocols, the communication would fail. TCP/IP is the dominant protocol suite for internet IP Addresses, of the sender and receiver, and checksum are added when sending messages
usage. When receiving a message it reassembles the fragments, strips the IP header and sends it to
the transport layer
TCP/IP Suite
(Data) Link Layer:
A layered model (stack) with 4 layers; Application. transport, internet and data link. The Suite Converts the electrical data into analog signals and sends it, allowing the upper layers access
uses a set of protocols for the transmission of data in these layers like TCP (Transport to the physical medium.
Control Protocol) and IP (Internet Protocol).
Formats data into frames for transmission and maps IP addresses to MAC (hardware)
addresses.
BitTorrent uses Peer-To-Peer file sharing model. A small number of instruction formats Many instruction formats
A BitTorrent client software is made available to the public. Single-cycle instructions whenever possible Multi-cycle instructions
Swarm: All connected peer computers that have all or parts of file being Fixed-length instructions Variable-length instructions
downloaded/uploaded.
Only load and store instructions to address memory Many types of instructions to address memory
Tracker: A central server that stores information on which computers have which files and
which parts of those files. It also shares the IP addresses of computers to allow them to Fewer addressing modes More addressing modes
connect to each other. Multiple register sets Fewer registers
Seed: is the peer computer that uploads the file that is being downloaded. Hard-wired control unit Microprogrammed control unit
If a user wishes to join this network, they need to use a BitTorrent client to load the torrent
Pipelining easier Pipelining much difficult
descriptor file. When a user wishes to download a file, pieces of this file are downloaded and
uploaded at the same time. When a user has even a single piece of a file they become a seed. To
be able to download this file, a complete copy needs to exist on one of the peer computers.
Pipelining: Instruction level parallelism
Used extensively in RISC processor-based systems to reduce the time taken to run
2.2. Circuit Switching, Packet Switching processes
Multiple registers are employed
Circuit Switching
Interrupt handling in CISC and RISC Processors:
Circuit Switching: Method of transmission in which a dedicated circuit lasts throughout the
As soon as the interrupt is detected, the current processes are paused and moved into
duration of the communication.
registers
Dedicated circuit is selected before the communication starts and is used to send all the
The ISR (Interrupt Service Routine) is loaded onto the pipeline and is executed.
data through this route. - Uses the whole bandwidth.
When the interrupt has been serviced, the paused processes are resumed by bringing them
Releases circuit once the communication ends.
back from the registers to the pipeline
Used for live video broadcasts or calling
RISC processors allow for providing efficient pipelining. Pipelining is instruction-level
Data arrives in order so it doesn’t need to be reassembled.
parallelism. Its underlying principle is that the fetch-decode execute cycle can be separated
Whole bandwidth is available. into several stages.
Data can’t get lost.
One of the possibilities include:
Less secure as it only uses one route.
No alternative route in case of failure. 1. Instruction fetch (IF)
Bandwidth can’t be shared. 2. Instruction decode (ID)
3. Operand fetch (OF)
Packet Switching 4. Instruction execution (IE)
Method of transmission where the message is broken down into packets which can be sent 5. Result write back (WB)
along independent paths
Data is split into multiple packets and the best route is calculated for each packet. Pipelining for Five-Stage Instruction Handling
Each packet contain a header, which has a source IP address and destination IP address,
and a payload.
Calculates the most efficient path for each packet.
Used when sending large files that don’t need to be live streamed or when it is necessary to
be able to overcome faulty lines by rerouting like emails, text messages, sending documents,
etc.
Harder to intercept as new route is used each time.
Packets need to be reassembled.
If there’s a missing packet, a request is sent to retransmit the data.
Role of Router:
Examines the header and finds the destination IP address.
Decides the best route for the packet, with the help of the information from the routing
table, and sends it towards the next hop.
Comparison
For pipelining to be implemented, the construction of the processor must have five
Circuit Switching Packet Switching independent units, each handling one of the five identified stages.
Nature Dedicated channel Data segmented into packets Therefore, it's important for RISC processors to have many register sets. Each processor unit
Setup Requires pre-established channel No prior setup needed must have access to its own set of registers. The representations 1.1, 1.2, and so on are used
to define the instruction and the stage of the instruction. Initially, only the first stage of the
Data handling Message remains intact Message gets split into packets
first instruction has entered the pipeline. At clock cycle 6, the first instruction has left the
Transmission Single Path Path recalculated each time pipeline, the last stage of instruction 2 is being handled, and instruction 6 has just been
Order In order May need reassembly entered. Once underway, the pipeline is handling 5 stages of 5 individual instructions. At
each clock cycle, the complete processing of one instruction is finished. Without the
Layer (Data) Link Layer Network Layer
pipelining, the processing time would've been 5 times longer.
Bandwidth Makes full use of bandwidth Bandwidth can be shared
One disadvantage is interrupt handling. There will be 5 instructions in the pipeline when an
Error handling Communication ends incase of an error Allows packets to be resent interrupt occurs, so it needs to remove those previous instructions and then handle the
interrupt.
Complexity Simple More complex
Pros Cons
Allows more than one OS to run on a system Performance drop from native OS
Allows multiple copies of the same OS The time and effort needed for implementation is high
1 0 1
3.4. Logic Gates & Circuit Design
1 1 0
Logic Gates: A component of a logical circuit that can perform a Boolean operation
AND Gate: A.B = X NOR Gate: A + B = X
A B X
0 0 0
A B Output
0 1 0
0 0 1
1 0 0
0 1 0
1 1 1
1 0 0
1 1 0
OR Gate: A + B = X
A B Output
0 0 0
A B Output
0 1 1
0 0 0
1 0 1
0 1 1
1 1 1
1 0 1
1 1 0
A half adder adds two binary digits and outputs the sum (s) and their carry (c).
A XOR gate acts like a half adder.
Input Output
A B S C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
S R Q Q Bar
Full-Adder
0 0 No Change No Change
A full adder adds three binary digits and outputs the sum and their carry.
0 1 0 1
1 0 1 0
1 1 0 0
Clock J K Q Q Bar
0 0 0 - -
0 0 1 - -
0 1 0 - -
0 1 0 1 1
0+A = A
Null Law
0.A = 0
1+A = 1
Idempotent Law
A.A = A
A+A=A
Inverse Law
S R Q Q Bar A.A = 0
0 0 1 1 A+A = 1
0 1 1 0 Commutative Law
1 0 0 1 A.B = B.A
A+B = B+A
1 1 No Change No Change
Associative
00 causes an error as Q Bar is no longer the complement of Q (A.B).C = A.(B.C)
01 sets Q to 1 (A + B) + C = A + (B + C)
10 resets Q to 0
A. (B + C ) = A.B + A.C
Absorption Law
4. System Software
A. (A + B ) = A
Importance
Allows for multi-tasking to take place
Ensures the CPU is busy at all times
Makes sure that all programs have fair access to the CPU so that they can be executed
efficiently.
Prevents starvation
1. Sum of Products
A⋅B⋅C +A⋅B⋅C +A⋅B⋅C
Process States
Ready: The process is not currently being executed. It is in the queue waiting for the
processor’s attention.
Running: The process is being executed and currently has the processor’s attention.
Blocked: The process is waiting for an event before it can continue running like a user input.
Terminated: The process has finished execution and has been removed from the queue.
3. Circle the largest group containing an even number of 1s. Scheduling Algorithms
Shortest Job First: Processes are executed in ascending order based on the time needed to
execute the task with smaller jobs being executed first. This allows the CPU to execute more
processes in a smaller amount of time. This is non-preemptive.
Round Robin: Each process is allocated a specific amount of time from the CPU. Their
execution takes place within these time frames. This helps prevent starvation.
First Come First Served: No complex logic involved; processes are executed in the order they
are requested. There is less processor overhead due to its simplicity.
Shortest Remaining Time: Processes are executed in order of shortest remaining time for
execution. It ensures there is smaller waiting times between process execution. This is
4. Take the common values from both preemptive.
In the first group, A ⋅ B is common
In the second group, A ⋅ C is common
Virtual Memory
Temporarily using secondary storage to simulate additional main memory, as only part of a
program needs to be in RAM. Data is swapped between the two.
Paging
A large process is divided into pages of equal sizes.
5. When there is no empty space in the memory, a page gets replaced with the new one.
<usigned integer> ::= <digit> | <digit> <digit>;
The replacement algorithm is either first in first out, least used page and recently least
used page.
<letter> ::= X | Y | Z;
Page
<digit> ::= 1 | 2 | 3;
Virtual memory is divided into equal blocks called pages.
<operator> ::= + | - | *;
Page Frame
Main memory is divided into parts equal in size to a page. <assignment statement> ::== <variable> = <variable> <operator> <variable>;
Page Table
Contains the mappings of pages to page frames. Notations
< > : used to enclose an item
Segmentation :: == : separates an item from its definition
A large process is divided to segments, the segments need not be the same size. | : between items, indicates a choice
; : the end of each rule.
Disk Thrashing
When pages are needed in the RAM as soon as they are moved to the disk leading to a
4.6. Reverse Polish Notation (RPN)
continuous swapping of the same pages because the pages being swapped in and out are inter- Reverse Polish notation (RPN): An unambiguous method for representing an expression left to
dependent. right without needing rules of precedence or brackets.
Key Encryption:
To ensure a message is authentic.
To ensure a message isn’t altered during transmission.
To ensure that only the intended receiver can understand the message.
To ensure that neither send nor receiver can deny involvement in the transmission.
Public Key 2. They send their public key, information to prove their identity as well as any additional
information required by the CA.
A public key is shared. It is used to encrypt data so that it can be decrypted with its matching
private key. 3. The CA then verifies their identity and then issues the certificate after encrypting it with
their private key.
Private Key
Digital Signature
A private key is never shared. It is used to decrypt data that was encrypted with its matching
public key. The message is put through a hashing algorithm to produce the digest. This is then encrypted
with the sender’s private key. This is the digital signature.
Symmetric Encryption When the message is received, the digital signature is decrypted using the public key. The digital
A single key is used for both encryption and decryption. The key is shared between the sender signature is then decrypted with the sender’s public key. The decrypted message is put through
and the receiver. the same hashing function to output a digest. The two digests are compared and if they are the
same then the message was not tampered with.
Disadvantages:
Key has to be exchanged securely.
Once compromised, it can decrypt sent and received messages. 6. Artificial Intelligence (AI)
Cannot ensure origin or integrity of data.
6.1. Graphs
Asymmetric Encryption
A graph is an abstract datatype that contains a collection of nodes. These nodes are connected
Two keys are used: public key and private key. The message is encrypted with the public key and to each other with edges. A node usually has a name, and an edge usually has a numerical
decrypted using the matching private key. value.
Symmetric VS Asymmetric One example of graphs is A* or Dijkstra's algorithm. The nodes represent locations, and the
edges represent the distance between them.
Symmetric Asymmetric
Number of Keys 1 key for both 2 keys
Purpose
Allow for more security when communicating over the internet as it allows two parties
identify and verify each other and communicate confidentially with integrity
Provides encryption.
Working
Start from the Home. The cost from Home to Home is 0, so g= 0. The heuristic cost of a
An SSL/TLS connection is initiated between two applications.
home is 14, so h=14 and f=g+h=14.
The one initiating it is the client. The one receiving it is the server.
Now, there are three immediate nodes from home: A, B, and C. Calculate the values of g, h
Session begins with a handshake. and f for A, B and C from home and write them in the table.
Server sends its digital certificate and public key Select the node whose f value is the shortest (in this case, Node A).
Client confirms the server’s identity. From A, there are two immediate nodes, B and E. Calculate the g value for each node and
Encryption algorithm is agreed upon and the symmetric session keys are generated. add the g value of A. Then, add the corresponding h values to get f for each node.
From E, there are two immediate nodes, School and F. Calculate the g value for each node
Use Cases
and add the g value of E. Then, add the corresponding h values to get f for each node.
Transmitting passwords or session cookies. From F to School, add the g value (3) to the g value of F (8) and calculate f.
Online shopping and banking websites. Final path = Home → A→E→F→School.
Digital Certificate
Regression
Regression is finding a mathematical function that best fits output data based on the previous
results in order to predict the future value.
Neural Networks
Machine Learning
Machine learning is a field of artificial intelligence in which computers learn from provided data
and past experiences in order to improve its performance in a given task without explicitly being
programmed to know how to do the task. For example, rather than telling the computer that
emails that advertise free products are most likely scams we feed it a lot of data and it identifies
that pattern on its own.
Deep Learning
A subset of machine learning that simulates the decision making and data processing abilities of
the human brain.
Benefits:
Good with extremely large sets of data
Good with unstructured data
Can identify hidden patterns
Reinforcement Learning
Reinforcement learning allows the computers to make decisions that maximize the reward, it is
then graded based on how well it performed. Over time the computer learns the correct
decisions it needs to make based on its past experiences.
Supervised Learning
In supervised learning the computer is fed labelled test data, and it identifies the patterns that
led to the data being labelled in a specific way. This allows it to then predict labels for new
unseen data.
Unsupervised Learning
In unsupervised learning the computer is fed unlabeled test data, and it identifies hidden
patterns.
CAIE A2 LEVEL
COMPUTER SCIENCE (9618)
THEORY
© ZNotes Education Ltd. & ZNotes Foundation 2026. All rights reserved.
This version was created by Aditya Jain on 16/05/26 for strictly personal use only.
These notes have been created by Talal Aamer for the 2024-2025 syllabus
The document contains images and excerpts of text from educational resources available on the internet and printed books.
If you are the owner of such media, test or visual, utilized in this document and do not accept its usage then we urge you to
contact us
and we would immediately replace said media. No part of this document may be copied or re-uploaded to another website.
Under no conditions may this document be distributed under the name of false author(s) or sold for financial gain.
"ZNotes" and the ZNotes logo are trademarks of ZNotes Education Limited (registration UK00003478331).