0% found this document useful (0 votes)
10 views18 pages

CAIE-A2 Level-Computer Science - Theory

This document provides summarized notes on the CAIE A2 Level Computer Science syllabus, covering topics such as data representation, file organization, floating-point numbers, communication protocols, and processor types. It details user-defined data types, file access methods, and the differences between circuit and packet switching. Additionally, it discusses the TCP/IP suite and the role of routers in data transmission.
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)
10 views18 pages

CAIE-A2 Level-Computer Science - Theory

This document provides summarized notes on the CAIE A2 Level Computer Science syllabus, covering topics such as data representation, file organization, floating-point numbers, communication protocols, and processor types. It details user-defined data types, file access methods, and the differences between circuit and packet switching. Additionally, it discusses the TCP/IP suite and the role of routers in data transmission.
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
You are on page 1/ 18

ZNOTES.

ORG

UPDATED TO 2023-2025 SYLLABUS

CAIE A2 LEVEL
COMPUTER SCIENCE
SUMMARIZED NOTES ON THE THEORY SYLLABUS
Prepared for Temurmalik for personal use only.
CAIE A2 LEVEL COMPUTER SCIENCE

Record: A composite data type that is a collection of


1. Data Representation related items which may or may not have different data
types
1.1. User-defined data types TYPE TBook // Example
DECLARE Name : STRING
A data type constructed by the programmer. DECLARE Isbn : INTEGER
User-defined data types are used to create new data ENDTYPE
types that help to extend the flexibility of a programming
language as the programmer can create data types DECLARE Book1: TBook // Creating a variable
based on the application’s requirements. Book1.Name = "To Kill a Mockingbird" // Accessing
Examples include:
Record Set: A set stores a finite number of unique items in no
Set particular order allowing the program to apply
Class mathematical operations defined in set theory.
Object
TYPE <set-name> = SET OF <type> //Declaration
DEFINE <var-name> (value1,value2,value3,...) : <s
Composite User-Defined Data Types
Composite user-defined data types have a definition TYPE Numbers = SET OF INTEGERS
referencing at least one other type. DEFINE EvenNumbers (2,4,6,8,10) : Numbers

Classes: In object-oriented programming (OOP), a class


is the base for creating objects. It has methods and
properties.
// Class definition
CLASS Bird
PRIVATE Name: STRING
PUBLIC PROCEDURE NEW(pName: STRING)
Name ← pName
ENDPROCEDURE
ENDCLASS

// Implementing inheritance
CLASS FlyingBird IMPLEMENTS Bird
// Class info...
ENDCLASS

// Creating an object
<name> ← NEW <class_name>(<parameter1>, <paramete
MyPet ← NEW Bird("Kiwi")

Non-Composite Data Type

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE
A data type that references only one data type. Examples
include: Serial: In serial files, records are stored one after
another in chronological order. Records are appended to
Integers the next available spot. Benefits:
Booleans No need to sort list.
Strings Data can be appended easily.
Enumerated Data Type: A user defined non-composite Sequential: In sequential files, records are stored one
data type that contains an ordered list of all possible after another in the order of the key field. Records are
values. inserted into the correct position. A new version of the
file has to be created to update it. Benefits:
TYPE <name> : (<value1>, <value2>, ...) Allows for batch processing.
TYPE Days: (Sunday, Monday, Tuesday, Wednesday, T Allows the data to be stored and sorted in a specific
TYPE Numbers: (1..10) // Inclusive order.
DECLARE Today: Days // Declaration Random: In random files, records are stored in no
Days ← Sunday particular order. Changes to file are done directly.
Days ← Days + 1 // Value is now Monday In random file organization a unique key field is
Pointer Data Type: A user defined non-composite data passed through a hash algorithm which produces the
home location for the data, if that location is empty
type that is used to reference a memory location and
indicates data type of value stored. the data is stored else it relies on an overflow
method.
TYPE <Name> = ^<Type> A collision can occur when two different records
produce the same hash, this means that the location
// Declaring a pointer type is already being used to store a different record.
TYPE PIntPointer: ^INTEGER When saving a file, it searches the file linearly for an
// Declaring a pointer variable empty spot and saves the file there or search the
DECLARE MyPointer: PIntPointer overflow area linearly for the next empty spot and
save the record there. When finding a record, search
MyPointer^ ← 3 // Sets the value at the address t the overflow area linearly of the matching record or
MyPointer ← 3 // Pointer points to value at the a start from current location and search linearly and
MyPointer ← @<variable_name> // Makes pointer poi until matching record is found.
Benefits:
1.2. File organization and access Fast as real time processing is used

File access
File organization
Serial: In serial access records are read in the order that
they are stored in. It is read record by record until the
record is found or the key field value is exceeded. This is
used for serial and sequential file organization.
Direct/Random Access: In random access you can
directly access the data needed.

Deciding which method to use

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE
+3.5 became -3.5
When there is no advanced processing and all files need
to be read, serial is generally used Normalization
When there is batch processing, sequential is generally
used For a positive binary digit, the first two bits need to be
When we need one specific file, random is used different. (Removing extra zeros before in between the
decimal and the first 1 digit).
1.3. Floating-point numbers, 0 ⋅ 0110000 0011 →
0 ⋅ 1100000 0010
representation and manipulation Benefits:
Floating point representation Avoids two of the same number being represented
differently.
Mantissa: Represents the numbers. If we increase the Maximizes the potential precision.
bits allocated to the mantissa, we increase accuracy. Allows us to store the maximum range of numbers in the
Exponent: Represents the number of times the decimal minimum number of bits.
place needs to move. If we increase the bits allocated to
exponent, we increase the range. Important values
Converting from Binary Digit to Positive Float Largest positive number 0111 1111 0111
Smallest positive number 0000 0001 1000
Smallest normalized positive number 0100 0000 1000
Mantissa = 01101000 Largest magnitude negative number 1000 0000 0111
Exponent = 0011
Errors
1. Write the binary number with the decimal point
Rounding Error: When numbers can’t be represented be
0 ⋅ 1101 represented exactly in binary, an approximate value is
2. Multiply with 2 to the power of the exponent (Move used which is either more or less than the needed value.
the decimal point the same number of places as the When these numbers are then used in operations, the
exponent) inaccuracies get added to the point where they are
visible in the final answer. Like 0.1 + 0.2 =
0 ⋅ 1101 x 23 0.3000000000004
0110 ⋅ 1 Underflow: Underflow occurs when a number is too
close to zero to be accurately represented in binary,
3. Convert to decimal by multiplying leading to a loss of precision.
Overflow: Overflow happens when a number's
(4 × 1) + (2 × 1) + ( 12 × 1)

magnitude exceeds the limit that can be represented in a


Therefore the answer is 6.5 given number of bits.

Converting from Float to Binary Digit


2. Communication and
3.5

1. Keep the values of 2n in mind


Internet Technologies
3.5 = 21 + 20 + 2−1 = 3.5 2.1. Protocols
0011 ⋅ 1000 0000
A protocol sets the rules of the communication. Protocols
2. Now we need to normalize it, for each place you allows for devices to communicate across different
move the decimal point increment the value of the platforms. If two devices attempted to communicate while
exponent using different protocols, the communication would fail.
TCP/IP is the dominant protocol suite for internet usage.
0 ⋅ 1110000 0010
There are the main types of protocols:
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.

01110000 0010 → 10010000 0010

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE

HTTP and HTTPS (Hypertext Transfer Protocol): Used Handles packets.


to transfer webpages from server to client. HTTPS is Converts the data received from the application layer
more secure. into individual packets when sending a message.
FTP (File Transfer Protocol): Used for sending and Adds packet headers and then sends these packets to
receiving files over the network between two devices. the internet layer.
POP3 (Post Office Protocol): Used for receiving emails. Controls the flows of packets and handles packet loss or
IMAP (Internet Message Access Protocol): Also used corruption.
for receiving emails. The email client retrieves the emails When receiving a message, it reads the header and
from the mail server. determines which application layer the data must be
SMTP (Simple Mail Transfer Protocol): Used for sent to, then strips the header and forwards it
sending emails
Internet Layer:
TCP/IP Suite Handles the transmission of data using IP addresses.
A layered model (stack) with 4 layers; Application. Identifies the intended network and host and then
transport, internet and data link. The Suite uses a set of transmits the packets through the data link layer.
protocols for the transmission of data in these layers like Routes each packet independently through the best
TCP (Transport Control Protocol) and IP (Internet route available
Protocol). IP Addresses, of the sender and receiver, and checksum
TCP maintains connection between two nodes and are added when sending messages
ensures delivery of data between the two nodes. When receiving a message it reassembles the fragments,
IP provides rules of exchange for packets and decides strips the IP header and sends it to the transport layer
the route for sending packets. (Data) Link Layer:
Converts the electrical data into analog signals and sends
it, allowing the upper layers access to the physical
medium.
Formats data into frames for transmission and maps IP
addresses to MAC (hardware) addresses.
Ensures correct network protocols are followed.
Verifies the checksum when receiving a message and
then sends it to the internet layer

Peer-to-peer File Sharing


BitTorrent uses Peer-To-Peer file sharing model.
Application Layer: A BitTorrent client software is made available to the
public.
The application layer provides user services. Swarm: All connected peer computers that have all or
Encodes data in an appropriate format when sending a parts of file being downloaded/uploaded.
message Tracker: A central server that stores information on
Performs the action requested by the user when which computers have which files and which parts of
receiving a message those files. It also shares the IP addresses of computers
to allow them to connect to each other.
Transport Layer: Seed: is the peer computer that uploads the file that is
being downloaded.

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE
If a user wishes to join this network, they need to use a
BitTorrent client to load the torrent descriptor file. When a Comparison
user wishes to download a file, pieces of this file are
Circuit Switching Packet Switching
downloaded and uploaded at the same time. When a user Nature Dedicated channel Data segmented into packets
has even a single piece of a file they become a seed. To be Setup Requires pre-established channel No prior setup needed
Data handling Message remains intact Message gets split into packets
able to download this file, a complete copy needs to exist on Transmission Single Path Path recalculated each time
one of the peer computers. Order In order May need reassembly
Layer (Data) Link Layer Network Layer
Bandwidth Makes full use of bandwidth Bandwidth can be shared
2.2. Circuit Switching, Packet Switching Error handling
Complexity
Communication ends incase of an error
Simple
Allows packets to be resent
More complex

Circuit Switching
3. Hardware and Virtual
Dedicated circuit is selected before the communication
starts and is used to send all the data through this route. Machines
- Uses the whole bandwidth.
Releases circuit once the communication ends.
Used for live video broadcasts or calling 3.1. RISC & CISC Processors
Data arrives in order so it doesn’t need to be
reassembled. RISC: Reduced Instruction Set Computers.
Whole bandwidth is available. CISC: Complex Instruction Set Computers.
Data can’t get lost. RISC CISC
Less secure as it only uses one route. Fewer instructions More instructions
Simpler instructions Complicated instructions
No alternative route in case of failure. A small number of instruction formats Many instruction formats
Bandwidth can’t be shared. Single-cycle instructions whenever possible Multi-cycle instructions
Fixed-length instructions Variable-length instructions
Only load and store instructions to address
May types of instructions to address memory
Packet Switching memory
Fewer addressing modes More addressing modes
Multiple register sets Fewer registers
Data is split into multiple packets and each packet a Hard-wired control unit Microprogrammed control unit
Pipelining easier Pipelining much difficult
route is calculated for each packet.
Each packet contain a header, which has a source IP Pipelining: Instruction level parallelism
address and destination IP address, and a payload. Used extensively in RISC processor-based systems to
Calculates the most efficient path for each packet. reduce the time taken to run processes
Used when sending large files that don’t need to be live Multiple registers are employed
streamed or when it is necessary to be able to overcome Interrupt handling in CISC and RISC Processors:
faulty lines by rerouting like emails, text messages, As soon as the interrupt is detected, the current
sending documents, etc. processes are paused and moved into registers
Harder to intercept as new route is used each time. The ISR (Interrupt Service Routine) is loaded onto the
Packets need to be reassembled. pipeline and is executed.
If there’s a missing packet, a request is sent to retransmit When the interrupt has been serviced, the paused
the data. processes are resumed by bringing them back from the
Role of Router: registers to the pipeline
RISC processors allow for providing efficient pipelining.
Examines the header and finds the destination IP Pipelining is instruction-level parallelism. Its underlying
address. principle is that the fetch-decode execute cycle can be
Decides the best route for the packet, with the help of separated into several stages.
the information from the routing table, and sends it
towards the next hop. One of the possibilities include:

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE

1. Instruction fetch (IF) SISD


2. Instruction decode (ID) Single Instruction Single Data stream
3. Operand fetch (OF) Found in the early computers
4. Instruction execution (IE) Contains a single processor; thus, there is no
5. Result write back (WB) pipelining
SIMD
Pipelining for Five-Stage Instruction Handling Single Instruction Multiple Data stream.
Found in array processors
Contains multiple processors, which have their own
memory.
MISD
Multiple Instruction Single Data stream
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.
For pipelining to be implemented, the construction of the Massively parallel computers
processor must have five independent units, each Computers that contain vast amounts of processing
handling one of the five identified stages. power.
Therefore, it's important for RISC processors to have Has a bus structure to support multiple processors
many register sets. Each processor unit must have and a network infrastructure to support multiple
access to its own set of registers. The representations ‘Host’ computers.
1.1, 1.2, and so on are used to define the instruction and Commonly used to solve highly complex
the stage of the instruction. Initially, only the first stage mathematical problems.
of the first instruction has entered the pipeline. At clock
cycle 6, the first instruction has left the pipeline, the last 3.3. Virtual Machines
stage of instruction 2 is being handled, and instruction 6
has just been entered. Once underway, the pipeline is Virtual machine:
handling 5 stages of 5 individual instructions. At each Process interacts with the software interface
clock cycle, the complete processing of one instruction is provided by the OS. This provides an exact copy of
finished. Without the pipelining, the processing time the hardware.
would've been 5 times longer. OS kernel handles interaction with actual host
One disadvantage is interrupt handling. There will be 5 hardware
instructions in the pipeline when an interrupt occurs, so
Pros Cons
it needs to remove those previous instructions and then Allows more than one OS to run on a system Performance drop from native OS
handle the interrupt. Allows multiple copies of the same OS
The time and effort needed for implementation
is high

3.2. Parallel Processing Examples and Usage:

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE

Used by companies wishing to use the legacy software


on newer hardware and server consolidation companies
Virtualising machines allows developers to test
applications on many systems without making expensive
hardware purchases.

3.4. Logic Gates & Circuit Design


Logic Gates: A component of a logical circuit that can
perform a Boolean operation

AND Gate: A.B = X


A Output
0 1
1 0

NAND Gate: A.B = X

A B X
0 0 0
0 1 0
1 0 0
1 1 1

OR Gate: A + B = X
A B Output
0 0 1
0 1 1
1 0 1
1 1 0

NOR Gate: A + B = X ​

A B Output
0 0 0
0 1 1
1 0 1
1 1 1

NOT Gate: A = X

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE

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

Full-Adder
A full adder adds three binary digits and outputs the sum
and their carry.
A B Output
0 0 1
0 1 0
1 0 0
1 1 0

XOR Gate: A.B + A.B = X

R is "Carry In"
J is "Carry Out"
K is "Sum"

A B Output
0 0 0
0 1 1
1 0 1
1 1 0

Half-Adder
3.5. Flip-Flops
Flip flops can store a single bit of data as 0 or 1
Computers use bits to store data.
Flip-flops can be used to store bits of data.
Memory can be created from flip-flops.

SR Flip Flops

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE

Can be made with NAND gates or NOR gates JK flip flops are only active when the clock is high.
Error state exists 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.

S R Q Q Bar
0 0 1 1
0 1 1 0
1 0 0 1
1 1 No Change No Change

00 causes an error as Q Bar is no longer the complement


of Q
01 sets Q to 1 Clock J K Q Q Bar
10 resets Q to 0 0 0 0 - -
0 0 1 - -
11 leads to no change; the initial value remains 0 1 0 - -
0 1 0 - -
1 0 0 No Change No Change
1 0 1 0 1
1 1 0 1 0
1 1 0 Toggle Toggle

3.6. Boolean Algebra

S R Q Q Bar
0 0 No Change No Change
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

JK Flip Flops

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE

Double Complement: A = A Karnaugh maps: a method of obtaining a simplified


Identity Law Boolean algebra expression from a truth table. They
1.A = A minimize the number of logic circuits, thus making it
0+A = A more efficient.
Null Law Sum of products: all the combinations that lead to 1 in
the output.
0.A = 0
1+A = 1 Methodology
Idempotent Law
A.A = A Try to look for trends in the output, thus predicting the
A+A=A presence of a term in the final expression
Inverse Law Draw out a Karnaugh Map by filling in the truth table
A.A = 0 values into the table
A+A = 1 Select groups of ‘1’ bits in even quantities (2, 4, 6, etc.); if
Commutative Law not possible, then consider a single input as a group
A.B = B.A Note: Karnaugh Maps wrap around columns
A+B = B+A Within each group, only the values that remain constant
Associative are retained
(A.B).C = A.(B.C)
Example
(A + B) + C = A + (B + C)
Distributive Law
A + B.C = (A + B).(A + C)
A. (B + C ) = A.B + A.C
Adsorption
A. (A + B ) = A
A + A.B = A
De Morgan’s Law
(A.B ) = A + B
(A + B) = A.B

{example}

1. Sum of Products
A⋅B⋅C +A⋅B⋅C +A⋅B⋅C
2. Fill in the map

3.7. Karnaugh Maps

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE

3. Circle the largest group containing an even number Hides complexities of the hardware from the user
of 1s. gives users access to the hardware/software systems
depending on their needs without involving them with
the backend
Examples include GUIs and CLIs

Multi-Tasking
Managing the execution of multiple programs that appear to
be running simultaneously.

Process
4. Take the common values from both
In the first group, A ⋅ B is common A process is the code being executed.
In the second group, A ⋅ C is common
Program
5. Write the simplified expression.
A⋅C +A⋅B A program is the code that has been written.

4. System Software 4.2. Process Scheduling


The process of allocating the CPU’s time on different
4.1. Purposes of an Operating System processes based on their needs.
(OS)
Maximizing Resource Use
Memory
Partitioning main memory into static and dynamic
partitions allowing for more than one 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. Importance
Disk
Allows for multi-tasking to take place
Compressing files in order to decrease the size and to
Ensures the CPU is busy at all times
allow for more larger files to be stored.
Makes sure that all programs have fair access to the CPU
Using defragmentation software so that files are
so that they can be executed efficiently.
arranged contiguously in the disk thereby reducing
Prevents starvation
access times.
Caching data that is frequently transferred to/from
Process States
the disk either on the disk or in RAM.
Ready: The process is not currently being executed. It is
User Interface 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.

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE

Scheduling Algorithms 1. The RAM is divided into frames.


2. Virtual memory is divided into same-sized blocks
Shortest Job First: Processes are executed in ascending called pages with fixed sizes.
order based on the time needed to execute the task with 3. Page table created to translate logical address to
smaller jobs being executed first. This allows the CPU to physical addresses and track all the free frames.
execute more processes in a smaller amount of time. 4. Pages are swapped between them as necessary.
Round Robin: Each process is allocated a specific 5. When there is no empty space in the memory, a page
amount of time from the CPU. Their execution takes gets replaced with the new one. The replacement
place within these time frames. This helps prevent algorithm is either first in first out, least used page
starvation. and recently least used page.
First Come First Served: No complex logic involved;
processes are executed in the order they are requested. Page
There is less processor overhead due to its simplicity.
Shortest Remaining Time: Processes are executed in Virtual memory is divided into equal blocks called pages.
order of shortest remaining time for execution. It
ensures there is smaller waiting times between process Page Frame
execution.
Main memory is divided into parts equal in size to a page.
Interrupt Handling
Page Table
When an interrupt occurs, the process in the running state is
Contains the mappings of pages to page frames.
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
Segmentation
ready state should be moved to the running state based on A large process is divided to segments, the segments need
their priority/position. not be the same size.
High Level Scheduler: Decides which of the processes
should be loaded from the backing store into the ready Disk Thrashing
state.
When pages are needed in the RAM as soon as they are
4.3. Memory Management moved to the disk leading to a continuous swapping of the
same pages because the pages being swapped in and out
Virtual Memory are inter-dependent.

Temporarily using secondary storage to simulate additional 4.4. Translation Software


main memory, as only part of a program needs to be in
RAM. Data is swapped between the two. Interpreter
Paging An interpreter reads line by line and checks statements for
errors, if no errors are found it is executed otherwise a
A large process is divided into pages of equal sizes. report is made and the interpreter stops execution. It is
easier for debugging.

Lexical Analysis
Characters are converted from strings into tokens.
Comments are removed.
Symbol table stores identifiers and keywords.
Keyword table stores the reserved words used and the
matching operators.

Tokens: Strings with an assigned meaning

Syntax Analysis
A parse tree is generated for reverse polish notation and
syntax errors are reported.

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE

Code generation Uses with a Stack


Object code is generated. RPN expression is read left to right
As values are read numbers are pushed into the stack.
Code Optimization If an operator is read the last two values in the stack are
popped, the operation is performed on them, and the
Code is optimized to improve time for execution. result is pushed back onto the stack.
Repeated until the end of the expression is reached.
4.5. Backus-Naur Form (BNF) Notation
Example
A form of expressing the grammar of a language visually.
(a–b) ∗ (a + c)/7 ↔ ab − ac + ∗7/
Example ab/4 ∗ ab + − ↔ (a/b) ∗ 4 − (a + b)

5. Security
5.1. Encryption
The process of converting of data into an unreadable
format.

Plain Text
Data before applying encryption.

<variable> ::= <letter> <usigned integer>


Cipher Text
Data after applying encryption.
<usigned integer> ::= <digit> | <digit> <digit>
Key Encryption:
<letter> ::= X | Y | Z
To ensure a message is authentic.
<digit> ::= 1 | 2 | 3 To ensure a message isn’t altered during transmission.
To ensure that only the intended receiver can
<operator> ::= + | - | * understand the message.
To ensure that neither send nor receiver can deny
<assignment statement> ::= <variable> = <variable> < involvement in the transmission.

Public Key
4.6. Reverse Polish Notation (RPN)
A public key is shared. It is used to encrypt data so that it can
Reverse Polish notation (RPN): An unambiguous method be decrypted with its matching private key.
for representing an expression left to right with needing
rules of precedence or brackets. Private Key

Advantages A private key is never shared. It is used to decrypt data that


was encrypted with its matching public key.
No brackets or precedence of operators needed
Simpler to evaluate Symmetric Encryption
No need for backtracking in evaluation as the operators
appear in the order required for computation and can be A single key is used for both encryption and decryption. The
evaluated from left to right key is shared between the sender and the receiver.
Disadvantages:
Key has to be exchanged securely.
Once compromised, it can decrypt sent and received
messages.
Cannot ensure origin or integrity of data.

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE

Asymmetric Encryption Allow for more security when communicating over the
internet as it allows two parties identify and verify each
Two keys are used: public key and private key. The message other and communicate confidentially with integrity
is encrypted with the public key and decrypted using the Provides encryption.
matching private key.
Working
Symmetric VS Asymmetric
An SSL/TLS connection is initiated between two
Symmetric Asymmetric applications.
Number of Keys 1 key for both 2 keys
Is Key Shared Yes Only public key
The one initiating it is the client. The one receiving it is
Security Less secure as key needs to be shared More secure the server.
Complexity Simple Complex
Speed Fast Slow
Session begins with a handshake.
Key Length Short Longer Server sends its digital certificate and public key
Client confirms the server’s identity.
Security concerns relating to a transmission: Encryption algorithm is agreed upon and the symmetric
session keys are generated.
Confidentiality: Only the intended recipient should be
able to decrypt the message.
Use Cases
Authenticity: Receiver must know who sent the
ciphertext. Transmitting passwords or session cookies.
Integrity: Message must not be modified during Online shopping and banking websites.
transmission.
Non-repudiation: Neither the sender nor the receiver
should be able to deny involvement in the transmission. 5.3. Digital Certification
Quantum Cryptography Digital Certificate

Quantum Cryptography is used to produce a virtually 1. An organization sends a request to Certificate


unbreakable encryption system using the properties of Authority (CA).
photons. 2. They send their public key, information to prove their
Advantages: identity as well as any additional information
required by the CA.
More secure. 3. The CA then verifies their identity and then issues the
Eavesdropping can be detected. certificate after encrypting it with their private key.
Longer keys can be used.
Almost un-hackable. Digital Signature
Cannot be copied and decrypted at a later time.
The message is put through a hashing algorithm to produce
Disadvantages: the digest. This is then encrypted with the sender’s private
key. This is the digital signature.
Only works for short distances. When received the message and the digital signature are
High cost for maintenance and setup.
decrypted with the receiver’s private key. The digital
Lacks important features like digital signature, certified
signature is then decrypted with the sender’s public key. The
mail etc.
decrypted message is put through the same hashing
High error rate due to being new.
function to output a digest. The two digests are compared
Polarization of light may be altered during transmission. and if they are the same then the message was not
tampered with.
5.2. Encryption Protocols
Purpose 6. Artificial Intelligence (AI)
6.1. Graphs

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE
A graph is an abstract datatype that contains a collection of
nodes. These nodes are connected to each other with edges.
A node usually has a name, and an edge usually has a
numerical value.
One example of graphs is A* or Dijkstra's algorithm. The
nodes represent locations, and the edges represent the
distance between them.

Start from the Home. The cost from Home to Home is 0,


so g= 0. The heuristic cost of a home is 14, so h=14 and
f=g+h=14.
Now, there are three immediate nodes from home: A, B,
and C. Calculate the values of g, h and f for A, B and C
from home and write them in the table.
Select the node whose f value is the shortest (in this
Use of Graphs case, Node A).
From A, there are two immediate nodes, B and E.
Graphs provide relationships between different nodes. Calculate the g value for each node and add the g value
Allows AI problem to be defined as the most efficient of A. Then, add the corresponding h values to get f for
route between two nodes each node.
Analyzed by machine learning algorithms such as A* to From E, there are two immediate nodes, School and F.
perform calculations Calculate the g value for each node and add the g value
Graphs can also be used to represent neural networks. of E. Then, add the corresponding h values to get f for
each node.
6.2. A* & Dijkstra’s Algorithm From F to School, add the g value (3) to the g value of F
(8) and calculate f.
These algorithms are used to find the shortest route
between two nodes based on the distance. Final path = Home → A→E→F→School.

How to Implement A Algorithm?


Below is an example of the implementation of the A*
Algorithm:

h is the heuristic value


g is the movement cost
F is the sum of gand h values.

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 LEVEL COMPUTER SCIENCE

6.3. Neural Networks & Machine Reinforcement Learning


Learning Reinforcement learning allows the computers to make
decisions that maximize the reward, it is then graded based
Neural Networks 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
Neural networks are modelled on the human brain. data, and it identifies hidden patterns.
They contain input and output nodes as well as one or
more hidden layers. Back Propagation of Errors
Each input node is assigned a specific weight, these
weights are summed, and an activation function An algorithm identifies errors with the machine learning and
calculates a value for the output. is then used to adjust the model for improved accuracy by
Repeated for each layer within the network thereby starting at the output layer and working backwards through
allowing reinforcement learning to take place. the hidden layers to the input layer.
For example, if you threw a ball and missed your target.
Use of Hidden Layers: You'd check how far off you were from the target and then
adjust things like angle and strength the next time you threw
Allow deep learning to take place the ball.
Allows the network to make decisions independently
Helps to improve the accuracy of the output Regression
Machine Learning Regression is finding a mathematical function that best fits
out output data based on the previous results in order to
Machine learning is a field of artificial intelligence in which predict the future value.
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

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Temurmalik at Presidential School In Andijan on 18/03/25.
CAIE A2 Level
Computer Science

© ZNotes Education Ltd. & ZNotes Foundation 2024. All rights reserved.
This version was created by Temurmalik on Tue Mar 18 2025 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