0% found this document useful (0 votes)
8 views11 pages

CAIE - A2 Level - Computer Science

This document provides an overview of the CAIE A2 Level Computer Science syllabus, focusing on data representation, user-defined data types, and file organization. It discusses various data types including pointers, records, sets, and classes, as well as concepts related to floating-point numbers and communication protocols. Additionally, it covers circuit switching and packet switching methods for data transmission, emphasizing the importance of protocols in network communication.

Uploaded by

Aditya Jain
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)
8 views11 pages

CAIE - A2 Level - Computer Science

This document provides an overview of the CAIE A2 Level Computer Science syllabus, focusing on data representation, user-defined data types, and file organization. It discusses various data types including pointers, records, sets, and classes, as well as concepts related to floating-point numbers and communication protocols. Additionally, it covers circuit switching and packet switching methods for data transmission, emphasizing the importance of protocols in network communication.

Uploaded by

Aditya Jain
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

ZNOTES.

ORG

ALIGNED WITH THE 2026-2026 SYLLABUS

CAIE A2 LEVEL

COMPUTER SCIENCE (9618)


THEORY

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>

1.1. User-defined data types


// Declaring a pointer type
A data type constructed by the programmer using primitive data types. TYPE PIntPointer: ^INTEGER
User-defined data types are used to create new data types that help to extend the flexibility // Declaring a pointer variable
of a programming language as the programmer can create data types based on the DECLARE MyPointer: PIntPointer
application’s requirements.
MyPointer^ ← 3 // Sets the value at the address to
Importance of user-defined data types:
MyPointer ← 3 // Pointer points to value at the address 3
Code organization- Helps structure and group related data logically, making programs MyPointer ← @<variable_name> // Makes pointer point to value stored at t
easier to read and maintain.
Reusability- Once defined, the data type can be reused multiple times, reducing 1.2. File organization and access
redundant code and improving efficiency.
File organization
Examples include:
Record
Serial: In serial files, records are stored one after another in chronological order. Records are
appended to the next available spot. Benefits:
Set
Class No need to sort list.
Data can be appended easily.
Object
Sequential: In sequential files, records are stored one after another in the order of the key
Composite User-Defined Data Types field. Records are inserted into the correct position. A new version of the file has to be
Composite user-defined data types have a definition referencing at least one other type. created to update it. Benefits:

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.

TYPE TBook // Example


Random: In random files, records are stored in no particular order. Changes to file are done
directly.
DECLARE Name : STRING
DECLARE Isbn : INTEGER In random file organization a unique key field is passed through a hash algorithm which
ENDTYPE produces the home location for the data, if that location is empty the data is stored else
it relies on an overflow method.
DECLARE Book1: TBook // Creating a variable A collision can occur when two different records produce the same hash, this means that
[Link] = "To Kill a Mockingbird" // Accessing properties the location is already being used to store a different record. When saving a file, it
searches the file linearly for an empty spot and saves the file there or search the
Set: A set stores a finite number of unique items in no particular order allowing the program overflow area linearly for the next empty spot and save the record there. When finding a
to apply mathematical operations defined in set theory.
record, search the overflow area linearly of the matching record or start from current
TYPE <set-name> = SET OF <type> //Declaration location and search linearly and until matching record is found.
DEFINE <var-name> (value1,value2,value3,...) : <set-name> Benefits:
Fast as real time processing is used
TYPE Numbers = SET OF INTEGERS
DEFINE EvenNumbers (2,4,6,8,10) : Numbers File access

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

Non-Composite Data Type


M = Mantissa
Data types that can be defined without referencing another type.
E = Exponent
String and Char are both non-composite built-in types
Examples include: Converting from Binary Digit to Positive Float
Integers
Mantissa = 01101000Exponent = 0011
Booleans
Strings 1. Write the binary number with the decimal point

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

Therefore the answer is 6.5

Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.


[Link] This document is authorised for personal use only by Aditya Jain at Enderun Colleges on 16/05/26.
CAIE A2 LEVEL COMPUTER SCIENCE

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

Put these back into the mantissa table


Mantissa: 01101000
Exponent: 0011

Converting from Binary Digit to Negative Float


By taking two’s compliment on a postive binary float, converts it gets converted into the
negative float.
Do not take two’s compliment of the exponent.

01110000F 0010 → 10010000F 0010

+3.5 became -3.5

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).

0 ⋅ 0110000FF 0011 → \0 ⋅ 1100000FF 0010

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.

Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.


[Link] This document is authorised for personal use only by Aditya Jain at Enderun Colleges on 16/05/26.
CAIE A2 LEVEL COMPUTER SCIENCE

Ensures correct network protocols are followed. RISC CISC


Verifies the checksum when receiving a message and then sends it to the internet layer
Fewer instructions More instructions

Peer-to-peer File Sharing Simpler instructions Complicated instructions

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

3.2. Parallel Processing


3. Hardware and Virtual Machines SISD
Single Instruction Single Data stream
3.1. RISC & CISC Processors Found in the early computers
RISC: Reduced Instruction Set Computers. Contains a single processor; thus, there is no pipelining
CISC: Complex Instruction Set Computers. SIMD
Single Instruction Multiple Data.
Found in array processors
Contains multiple processors, which have their own memory.

Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.


[Link] This document is authorised for personal use only by Aditya Jain at Enderun Colleges on 16/05/26.
CAIE A2 LEVEL COMPUTER SCIENCE

MISD NOT Gate: A = X

Multiple Instruction Single Data


Used to sort large quantities of data.
Contains multiple processors which process the same data
MIMD
Multiple Instruction Multiple Data.
Found in modern personal computers.
Each processor executes a different individual instruction.
Massively parallel computers A Output

Computers that contain vast amounts of processing power. 0 1

Has a bus structure to support multiple processors and a network infrastructure to 1 0


support multiple ‘Host’ computers.
Commonly used to solve highly complex mathematical problems. NAND Gate: A.B = X

3.3. Virtual Machines


Virtual machine:
Process interacts with the software interface provided by the OS. This provides an exact
copy of the hardware.
OS kernel handles interaction with actual host hardware

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

Examples and Usage:


Used by companies wishing to use the legacy software on newer hardware and server
consolidation companies A B Output
Virtualising machines allows developers to test applications on many systems without 0 0 1
making expensive hardware purchases. 0 1 1

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

XOR Gate: A.B + 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

Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.


[Link] This document is authorised for personal use only by Aditya Jain at Enderun Colleges on 16/05/26.
CAIE A2 LEVEL COMPUTER SCIENCE

Half-Adder 11 leads to no change; the initial value remains

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

11 causes an error as Q Bar is no longer the complement of Q


10 sets Q to 1
01 resets Q to 0
00 leads to no change; the initial value remains

R is "Carry In" JK Flip Flops


J is "Carry Out"
JK flip flops are only active when the clock is high.
K is "Sum"
JK flip flops use a clock pulse for synchronization to ensure proper functioning.
Advantages of JK flip flops include the validity of all input combinations, avoidance of
unstable states, and increased stability compared to SR flip flops.

Clock J K Q Q Bar
0 0 0 - -

0 0 1 - -

0 1 0 - -

0 1 0 1 1

3.5. Flip-Flops 1 0 0 No Change No Change

Flip flops can store a single bit of data as 0 or 1 1 0 1 0 1

Computers use bits to store data. 1 1 0 1 0

Flip-flops can be used to store bits of data. 1 1 1 1 1


Memory can be created from flip-flops.
3.6. Boolean Algebra
SR Flip Flops
Can be made with NAND gates or NOR gates
Double Complement: A = A
Error state exists
Identity Law
1.A = A

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

Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.


[Link] This document is authorised for personal use only by Aditya Jain at Enderun Colleges on 16/05/26.
CAIE A2 LEVEL COMPUTER SCIENCE

Distributive Law 5. Write the simplified expression.


A + B.C = (A + B).(A + C) A⋅C +A⋅B

A. (B + C ) = A.B + A.C

Absorption Law
4. System Software
A. (A + B ) = A

A + A.B = A 4.1. Purposes of an Operating System (OS)


De Morgan’s Law
Maximizing Resource Use
(A.B ) = A + B
Memory
(A + B) = A.B
Partitioning main memory into static and dynamic partitions allowing for more than one
{example}
program to be available.
Removing unused items from RAM as soon as the process is terminated and then
marking the partition as available.
Use virtual memory with paging to swap parts of the memory and the disk.
Disk
Compressing files in order to decrease the size and to allow for more larger files to be
stored.
Using defragmentation software so that files are arranged contiguously in the disk
thereby reducing access times.
Caching data that is frequently transferred to/from the disk either on the disk or in RAM.
3.7. Karnaugh Maps
Karnaugh maps: a method of obtaining a simplified Boolean algebra expression from a truth User Interface
table. They minimize the number of logic circuits, thus making it more efficient. Hides complexities of the hardware from the user
Sum of products: all the combinations that lead to 1 in the output. gives users access to the hardware/software systems depending on their needs without
involving them with the backend
Methodology
Examples include GUIs and CLIs
Try to look for trends in the output, thus predicting the presence of a term in the final
expression Multi-Tasking
Draw out a Karnaugh Map by filling in the truth table values into the table Managing the execution of multiple programs that appear to be running simultaneously.
Select groups of ‘1’ bits in even quantities (2, 4, 6, etc.); if not possible, then consider a single
input as a group Process
Note: Karnaugh Maps wrap around columns A process is the code being executed.
Within each group, only the values that remain constant are retained
Program
Example A program is the code that has been written.

4.2. Process Scheduling


The process of allocating the CPU’s time on different processes based on their needs.

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

2. Fill in the map

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

Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.


[Link] This document is authorised for personal use only by Aditya Jain at Enderun Colleges on 16/05/26.
CAIE A2 LEVEL COMPUTER SCIENCE

Interrupt Handling Example


When an interrupt occurs, the process in the running state is moved to the ready state and the
interrupt is moved to the running state so that it may be serviced.
Low Level Scheduler: Decides which of the processes in the ready state should be moved to the
running state based on their priority/position.
High Level Scheduler: Decides which of the processes should be loaded from the backing store
into the ready state.

4.3. Memory Management

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.

1. The RAM is divided into frames.


2. Virtual memory is divided into same-sized blocks called pages with fixed sizes.
3. Page table created to translate logical address to physical addresses and track all the
free frames.
4. Pages are swapped between them as necessary. <variable> ::= <letter> <usigned integer>;

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.

4.4. Translation Software Advantages


No brackets or precedence of operators needed
Interpreter
Simpler to evaluate
An interpreter reads line by line and checks statements for errors, if no errors are found it is
No need for backtracking in evaluation as the operators appear in the order required for
executed otherwise a report is made and the interpreter stops execution. It is easier for
computation and can be evaluated from left to right
debugging.
A compiler does not run the code line by line but rather at the end of translation. Uses with a Stack
RPN expression is read left to right
Lexical Analysis
As values are read numbers are pushed into the stack.
Characters are converted from strings into tokens.
If an operator is read the last two values in the stack are popped, the operation is performed
Comments are removed. on them, and the result is pushed back onto the stack.
Symbol table stores identifiers and keywords. Repeated until the end of the expression is reached.
White spaces are removed
Keyword table stores the reserved words used and the matching operators.
Example
(a–b) ∗ (a + c)/7FFF ↔ FFF ab − ac + ∗7/
Tokens: Strings with an assigned meaning
ab/4 ∗ ab + −FFF ↔ FFF (a/b) ∗ 4 − (a + b)
Syntax Analysis
A parse tree is generated for Backus-Naur Form and syntax errors are reported.
5. Security
Code generation
Object code is generated. 5.1. Encryption
The process of converting of data into an unreadable format.
Code Optimization
Code is optimized to improve time for execution. Plain Text
Data before applying encryption.
4.5. Backus-Naur Form (BNF) Notation
Cipher Text
A form of expressing the grammar of a language visually.
Data after applying encryption.

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.

Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.


[Link] This document is authorised for personal use only by Aditya Jain at Enderun Colleges on 16/05/26.
CAIE A2 LEVEL COMPUTER SCIENCE

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

Is Key Shared Yes Only public key

Security Less secure as key needs to be shared More secure

Complexity Simple Complex

Speed Fast Slow

Key Length Short Longer

Security concerns relating to a transmission:


Confidentiality: Only the intended recipient should be able to decrypt the message.
Authenticity: Receiver must know who sent the ciphertext.
Integrity: Message must not be modified during transmission.
Use of Graphs
Non-repudiation: Neither the sender nor the receiver should be able to deny involvement in
the transmission. Graphs provide relationships between different nodes.
Allows AI problem to be defined as the most efficient route between two nodes
Quantum Cryptography Analyzed by machine learning algorithms such as A* to perform calculations
Quantum Cryptography is used to produce a virtually unbreakable encryption system using the Graphs can also be used to represent neural networks.
properties of photons.
Advantages: 6.2. A* & Dijkstra’s Algorithm
More secure. These algorithms are used to find the shortest route between two nodes based on the distance.
Eavesdropping can be detected.
How to Implement A Algorithm?
Longer keys can be used.
Below is an example of the implementation of the A* Algorithm:
Almost un-hackable.
Cannot be copied and decrypted at a later time. h is the heuristic value
g is the movement cost
Disadvantages:
F is the sum of g and h values.
Only works for short distances.
High cost for maintenance and setup.
Lacks important features like digital signature, certified mail etc.
High error rate due to being new.
Polarization of light may be altered during transmission.

5.2. Encryption Protocols

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.

5.3. Digital Certification

Digital Certificate

1. An organization sends a request to Certificate Authority (CA).

Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.


[Link] This document is authorised for personal use only by Aditya Jain at Enderun Colleges on 16/05/26.
CAIE A2 LEVEL COMPUTER SCIENCE

Regression
Regression is finding a mathematical function that best fits output data based on the previous
results in order to predict the future value.

6.3. Neural Networks & Machine Learning

Neural Networks

Neural networks are modelled on the human brain.


They contain input and output nodes as well as one or more hidden layers.
Each input node is assigned a specific weight, these weights are summed, and an activation
function calculates a value for the output.
Repeated for each layer within the network thereby allowing reinforcement learning to take
place.
Use of Hidden Layers:
Allow deep learning to take place
Allows the network to make decisions independently
Helps to improve the accuracy of the output

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.

Back Propagation of Errors


An algorithm identifies errors with the machine learning and is then used to adjust the model
for improved accuracy by starting at the output layer and working backwards through the
hidden layers to the input layer.
For example, if you threw a ball and missed your target. You'd check how far off you were from
the target and then adjust things like angle and strength the next time you threw the ball.

Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.


[Link] This document is authorised for personal use only by Aditya Jain at Enderun Colleges on 16/05/26.
[Link]

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).

You might also like