0% found this document useful (0 votes)
166 views

Caie As Level Computer Science 9618 Theory 65e5a37b2cf0b64dda328103 684

Uploaded by

Harum
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)
166 views

Caie As Level Computer Science 9618 Theory 65e5a37b2cf0b64dda328103 684

Uploaded by

Harum
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/ 19

ZNOTES.

ORG

UPDATED TO 2024-2025 SYLLABUS

CAIE AS LEVEL
COMPUTER
SCIENCE
SUMMARIZED NOTES ON THE THEORY SYLLABUS
Prepared for AgatePuppet Dark for personal use only.
CAIE AS LEVEL COMPUTER SCIENCE

Convert binary number to two’s complement (add 1)


|1010101 + 1 = 11010110
1. Information Representation Converting binary two’s complement into denary (ex.
11010110)
Flip all the bits | 00101001
1.1. Data Representation
Add 1 | 00101010
The basis of any number system consists of: Convert binary to denary and put a –ve sign) | -42
A base: the number of digits that a number system Maximum positive number in 8 bits: 127
can use to represent numbers Maximum negative number in 8 bits: -128
Place value for each digit: digits in certain positions Hexadecimal Systems - Base 16
have a specific value Possible digits: 0 to 9 and A to F, where A to F
Denary - Base 10 integer digits represent denary digits 10 to 15
Binary Systems - Base 2 Practical applications:
Possible bits (binary digits): 0 and 1 Defining colours in HTML
All data and characters are represented in binary Defining Media Access Control (MAC) addresses
Assembly languages and machine code
128 64 32 16 8 4 2 1 Debugging via memory dumps
0 0 0 0 0 0 0 0 E.g. A5 in Denary = (16×10) + (1×5) = 165
E.g. 65 in Hexadecimal = 65÷16=4 Remainder 1∴ = 41
Character Sets
E.g. 65 in binary is 0100001
A character set generally includes upper & lower case
Denary vs. Binary prefixes:
letters, number digits, punctuation marks and other
DenaryPrefix factor value BinaryPrefix factor value characters.
Character sets use different binary representations
kilo- (k) ×10^3 kibi- (Ki) ×2^10
for each character via character encoding
mega- (M) ×10^6 mebi- (Mi) ×2^20 Character Encoding Standards:
giga- (G) ×10^9 gebi- (Gi) ×2^30
tera- (T) ×10^12 tebi- (Ti) ×2^40 ASCII Extended ASCII Unicode
ASCII’s extension - Superset for ASCII
Binary Coded Decimal (BCD) Only the English Also includes most & extended ASCII -
Binary representation where each positive denary alphabet can be European recognized by
digit is represented by a sequence of 4 bits (nibble) represented languages’ various global
Only certain digits are converted to BCD, because alphabets languages
particular digits represent a digit greater than 9. It has an excellent
Ex. 429 in BCD: Each character ASCII extended to 8
range of
Convert each digit to their binary equivalents encoding takes up 7 bits, hence 256
characters, using 2
4 = 0100 | 2 = 0010 |9 = 1001 bits, hence 128 possible
or 4 bytes per
possible characters characters.
character.
Concatenate the 3 nibbles (4-bit group) to produce BCD: 0100
0010 1001 2 or 4 times more
Smaller storage
storage space per
space.
Practical applications character.
A string of digits on any electronic device displaying
numbers (eg. Calculators)
Accurately measuring decimal fractions
1.2. Multimedia - Graphics, Sound
Electronically coding denary numbers
Bitmap Images
Two’s Complement
Data for a bitmapped image is encoded by assigning a
We can represent a negative number in binary by
solid colour to each pixel, i.e., through bit patterns.
making the most significant bit (MSB) a sign bit, which
Bit patterns are generated by considering each grid
indicates whether the number is positive or negative.
row as a series of binary colour codes corresponding
Converting negative denary into binary (ex. -42)
to each pixel’s colour.
Find the binary equivalent of the denary number (ignoring
These bit patterns are ‘mapped’ onto the main
the -ve sign) | 42 = 101010
memory.
Add extra 0 bits before the MSB, to format binary number
Pixels: smallest picture element whose colour can be
to 8 bits | 00101010
accurately represented by binary
Convert binary number to one’s complement (flip the bits)
Bitmap images also contain the File Header, which
| 11010101
has the metadata contents of the bitmap file,

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

including image size, number of colours, etc. Bit Rate = Sampling Rate × Sampling Resolution
Image Resolution File Size=Bit Rate * Length of Sound
Pixel density, which is measured by no. of pixels/cm
If image resolution increases, then the image is
1.3. Compression
sharper/more detailed
Screen Resolution
Compression is the process of reducing file size without a
Number of pixels which can be viewed horizontally & significant loss in quality, which results in
vertically on the device’s screen Reducing the time needed to search for data.
Number of pixels = width × height
Faster transfer of compressed files, which uses less
E.g. 1680 × 1080 pixels bandwidth than uncompressed files.
Colour depth: number of bits used to represent the colour Lossless Compression
of a single pixel
Type of compression that allows original data to be
An image with n bits has 2 n colours per pixel. perfectly reconstructed from a compressed file when
E.g. 16-colour bitmap has 4 bits per pixel ∵ 2 4 = 16 the file is opened by utilizing some form of
Colour depth↑: colour quality↑ but file size↑ replacement.
File Size = Number of Pixels × colour depth E.g. bitmap (.bmp), vector graphic (.svg) and .png
Convert bits to bytes by dividing by eight if necessary. images, text file compression, database records
Applications: scanned images and general computer Run-length Encoding (RLE)
usage, small file size and can be easily manipulated. Form of lossless compression, which is used for
Vector Graphics compressing text files and bitmap images.
Made up of drawing objects Reduces file size of a sequence of elements with
Drawing Objects: a mathematically defined construct adjacent, identical elements (characters in a text
(of shapes like rectangles, lines, circles, etc.) file and pixels in bitmap images).
Drawing list: a set of commands defining the vector Repeating sequence of elements encoded in two
The properties of each object are the basic geometric values: run count and run value.
data which determine the shape and appearance. E.g. RLE of bitmap image:
Data is encoded using mathematical formulas to Lossy Compression
generate properties to draw lines & curves to create Type of compression which irreversibly eliminates
the image. unnecessary data
If the object is resized, properties are recalculated. File accuracy/quality is lower than lossless, but file size
is lower (~10% of lossless).
∴ Scalable without losing quality, unlike bitmaps
E.g. Sound files (.mp3), .jpeg images
Applications: company logos Sound file compression (.mp3) utilizes Perceptual
Sound Coding to remove certain parts of sound that are less
Analogue data is continuous electrical signals, audible/discernible to human hearing.
whereas digital data is discrete electrical signals.
Sound signals are vibrations through a medium.
Hence is analogue in nature as there can be infinite
2. Communication
detail for sound.
Analogue signals converted (encoded) to digital 2.1. Networks, including the Internet
signals by sampling:
Sound wave’s amplitude (height) sampled at set Networking devices are interconnected devices that allow
time intervals a fast means of data transmission within the network.
These samples (amplitudes) are encoded as a Networking benefits:
binary number sequence File sharing - you can easily share data between
This sequence provides a digital representation of different interconnected devices
the sound wave Resource sharing - using network-connected output
Sampling Rate devices like printers or can share the same software
Number of samples taken per unit of time within the network
Increasing the sampling rate increases the accuracy Higher storage - can store files in network-connected
of digitized sound wave representation but increases storage mediums.
the file size. LAN(Local Area Network) vs. WAN(Wide Area Network)
Sampling Resolution
Number of bits used to encode each sample LAN WAN
Increasing sampling resolution increases the accuracy A network that connects A network that connects
of digitised sound waves but increases the file size. devices within a small devices within a larger
Bit Rate: no. of bits for storing 1 second of sound geographical area geographical area

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

LAN WAN Client-server Peer-to-peer


Only private ownership Private or public ownership Improved security: files are Can work even if a device
Transmission medium: stored on central server goes down, but Client-server
Transmission medium: PSTN which would be regularly model can’t work if server
twisted pair cable, coaxial
or satellite link scanned for malware goes down
cable or Wi-Fi
Higher data transfer rate Lower data transfer rate
Network Topologies
Lesser congestion Higher congestion
Bus
Single line (bus) connecting all devices with
Client-server Model
terminators at each end.
Server-based network: A dedicated server provides an
Other computers can read the data being sent
application (administration of users, security and
from one to another computer.
resources) for the client computer to utilize
Unsuitable for heavy traffic since collisions occur.
Client-server Applications
Star
Printer: manages print jobs from client computers
Consists of a central server (‘Switch’) and all other
File Sharing: the client accesses software and user’s
computers connected with a dedicated connection
data files stored on the server
to each. Hence server can send packets to
Proxy server
different devices simultaneously and bi-
Email server: for sending, receiving & storing emails
directionally.
Database server: manages DBMS
No collisions are possible.
Domain controller server
Mesh
Management of user accounts (IDs & passwords)
Network setup where every device (node) is
Client sends a login request to the server which
directly interconnected to each of the other
processes and grants request if user ID &
devices (nodes)
password recognized
It is commonly used for wireless networks (such as
Thin Clients vs. Thick Clients
the Internet) via the mesh connection of routers
Thin Clients Thick Clients Hybrid
Combination of two or more topologies.
A client that solely runs on the
An independent client that E.g. when there is a connection between 2 or more
resources provided by the
does not require the server to LANs of different topologies
server and has no local
run Wired Networks: use (copper (twisted-pair cable or
storage
coaxial cable) or fibre-optic) cables connected to an
Only provides input and Ethernet port on the network router
Thick client processes most of
receives output; processing
the application
done by the server Benefits Drawbacks
Smaller purchase cost: Less expensive and Doesn’t perform well
Can function even if no server
expensive, demanding easier to with small charges.
is connected (works offline) Copper Cable
hardware is not required install. Flexible. Easier Affected by
Improved security: cannot run to make terminations electromagnetism
No lag related to network
unauthorized, harmful Greater bandwidth,
problems
software improved security,
lightweight, easy to Needs expensive
Fiber-Optic
Peer-to-peer network model (P2P) install, and less signal optical transmitters
Cables
Decentralised network where each connected boosting are required; and receivers.
computer stores data and operates independently as used in long-distance
a ‘peer’, and can act as both a client & server. communications.
Applications: Internet and Ad hoc networks
Client-server vs. Peer-to-peer models Wireless Networks: use radio waves (including WiFi),
microwaves, and satellites to connect devices to networks
Client-server Peer-to-peer without cables.
Centralized backup Lesser initial setup cost
Benefits Drawbacks
Lesser network traffic: each
Files & resources centralized
peer can simultaneously
in server: prevents illegal
receive data from different
resource usage
sources

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

Benefits Drawbacks Real-time On-demand


They can travel over Encoded video signal The data is streamed to a
large distances since uploaded from computer to a buffer in the user’s computer,
A low frequency, so it
they have the largest dedicated streaming server and the buffer stops the video
transmits less data at
Radio range of wavelengths. via cables or high-speed from being paused as the bits
one time. Affected by
waves They are relatively wireless internet connection are streamed
radio stations with
inexpensive. Used for The server then sends live As the buffer is emptied, it’s
similar frequency
TV signals & mobile images to all users requesting filled again, thus providing
phone comms. them as a real-time video continuous viewing
Emitting towers is It cannot be paused, fast- Can be paused, fast-
Larger bandwidth can
expensive to forwarded, etc. forwarded, etc.
Microwaves transfer more data at a
build. Physical
time
obstacles can interfere Importance of high broadband speed / bit-rate
Cheap with long User has to download and display bits at same time
Easy to
distance for Satellite If media is of higher quality, then higher broadband
Satellites interfereExpensive set-
phones, satellite radio speed needed since each “frame” is of a larger size
up
broadcast Real-time needs faster broadband speeds as
compared to on-demand, since there are a greater
Ethernet number of users simultaneously requesting same
The most common wired medium of transmission that data
can be used to transfer data between LANs or WANs Cloud Computing
Usually used in bus topology, since all data travelled Refers to the on-demand provision of computing
on a single wire, there is a possibility of data services through the internet
corruption by the “collision” of signals Services provided include
This collision is prevented by the CSMA/CD (Carrier Infrastructure: Storage capacity and higher
Sense Multiple Access Collision Detection) method: processing power
Before transmitting, the device checks if the Platform: Software, testing & debugging resources
channel is busy
If busy, the device calculates a random wait time Public cloud vs. Private cloud
and waits that time, after which it begins Public cloud private cloud
transmission 3rd-party cloud service A private cloud is owned by
Then, during transmission, the device listens for provider grants access to one organization and is not
other devices also beginning transmission multiple parties, accessible shared with any other
If collision, transmission is aborted and both via a browser organization
devices wait different random times, then try The private cloud can either
again. Cloud service provider owns,
be created and maintained by
Bit Streaming develops and manages the
the organization itself, or it
The sequence of digital signals (bits) transferred over public cloud through large
can outsource these tasks to
a communication path at high speeds server farms
a third party
Requires a fast broadband connection and some form
of buffers (short-term memory) Benefits and drawbacks of cloud computing
Bits arrive in the same order they are sent
Bit rate: number of bits transmitted per second Benefits Drawback
Two methods of bit streaming: Cannot access the
Relatively less technical
resources/data stored on the
Real-time On-demand knowledge is required, and
cloud if there are bandwidth
Existing digital files are easy to implement
issues
converted to encoded bit-
Event is captured live via a Poor data privacy, since there
streaming format for Flexibility: Cloud Can Be
video camera that is may be data leakage in the
broadcasting on the internet Scaled To Match The
connected to a computer multi-tenant architecture
by uploading to a dedicated Organization’s Growth
(public clouds)
server
A link for encoded video is
Video signal converted to an World Wide Web (WWW)
placed on the website and the
encoded streaming video Collection of web pages stored on websites
user clicks on the link to view
signal Protocols are used to transmit data across the WWW
encoded streaming video
Internet (Interconnected network)

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

Massive, open network of networks the receiving device can understand the data.
Uses TCP/IP protocol, which uses IP addresses to PSTN (Public Switched Telephone Network)
identify devices connected to the internet Refers to all telephone networks
Access provided by Internet Service Provider Channel used between 2 endpoints for the call
Communication used: wired, radio and satellite duration via circuit switching
Router in a network Lines are active even during a power outage
Connects two networks together which operate under Bi-directional communication
the same protocols Dedicated lines
Allows internal connections between LANs OR allows Telecommunication path between endpoints
external connection from the main LAN to a WAN Not shared with multiple users; it’s bought/leased
The router acts as a gateway & firewall Able to host websites as well as carry phone calls
Usually, it will be attached to a server or switch in a Allows continuous, uninterrupted access to Web
LAN Cell phone network
The router translates private IP addresses to public IP Wireless networks spread over land areas divided
addresses AND vice versa. into (hexagonal) ‘cells’
LAN-supporting hardware Each cell is served by at least one base station
Switch: Connected to all devices in a LAN and can (transceiver), which uses a different frequency
simultaneously broadcast information to all devices range, as compared to adjacent cells, to transmit
Server: device/software provides specific functions for data
computers in the network Larger capacity is possible since the same
Network Interface Card (NIC) frequencies can be used in non-adjacent cells
Provides each device (an end-system) in the wired Radio waves are usually used for transmission
LAN with a unique (MAC) address to uniquely It can be broadcast in all directions over a wide
identify it on the network area
Allows each individual device to connect to the Portable transceivers (e.g. mobile phones) are
network able to communicate and access the internet via
Wireless Network Interface Card (WNIC): Provides base stations
each end-system of a wireless (WiFi) LAN a unique IPv4 vs. IPv6
network address to identify it.
Wireless Access Points (WAP): IPv4 IPv6
Allows devices to connect to the LAN via WiFi 32 bit address, split into 4 128 bit address divided into
(wireless radio communication) instead of using a blocks by “.” eight 16-bit blocks by “:”.
cable Each block could have a value Each block can have 4 hex
Usually built into the router between 0 and 255 (00 to FF values ranging from 0000 to
Cables: A wired transmission medium that allows in hex). FFFF
communication in wired networks
IPv6 can be shortened by
Bridge
removing >=2 blocks
Connects two LANs which work using the same
E.g.255.0.1.255 containing solely
protocol, which can be two segments of the same
zeroesE.g.2001:0db8:85a3::8a
network
2e:0070:7334
Stores network addresses for all devices (end-
systems) between the 2 networks
IPv4 functionality
A bridge looks for the receiving device before it
each IP address has 2 parts:
sends the message.
Network Identifier (netID)
Repeater
Identifies the network to which the host (device) is
Connects two cables
connected to
regenerates the sent data signal over the same
Host Identifier (hostID): Identifies the host within
network before the signal weakens (attenuation) to
the network
prevent it from being corrupted
‘Classfull’ addressing is used for IPv4 where different
Internet-supporting hardware
bit lengths for identification and impose restrictions on
Modems
available address
Allows a device to connect to the Internet via a
Subnetting
telephone line.
Practice of dividing a network into two or more
A transmitter uses a modem to convert digital
networks
signals (from the transmitting device) to analogue
IP addresses are broken down to 3 parts by not
signals sent down the telephone line.
changing the netID but partitioning the host ID into a
A receiver uses a modem on the other end to
subnet ID and host ID
convert the analogue signals to digital signals so

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

These subnet ID bits are used to identify each subnet Secondary storage: non-volatile storage for noncritical
within the network. data that will not be frequently accessed
Subnet masks are numbers that hide (mask) the netID Removable secondary storage:
of a system's IP address and leave only the host part File backup and archive
as the machine identifier, allowing data to be routed Portable transfer of files to the second device
within the subnet to the appropriate host. Embedded systems
Public and Private IP address Miniature computer systems such as microprocessors
Public IP is provided by the ISP, while Private IP is that are often a part of a more extensive system
issued by the LAN’s router Each embedded system performs a few specific
Public IP is unique and can be across the internet, functions, unlike general-purpose computers
whereas Private IP is only unique within LAN and
hence can only be accessed within LAN Benefits Drawbacks
NAT (Network address translation) is required for Difficult to program functions
Reliable since there are no
private IP addresses to access the internet directly. since there is either no
moving parts
Private IP is more secure than public IP since they are interface
not directly accessible on the Internet and are hidden Expensive expert help is
by NAT Require less power
needed for the repair
Range of IP addresses used for private IP addressing
Cheap to mass-produce
can never be assigned to public IP addresses
Static vs. Dynamic IP addresses
Principle Operations of Hardware Devices
Static Dynamic Laser printer
A laser beam and rotating mirrors are used to
The IP address will change at
IP address never changes. draw an image of the page on a photosensitive
regular time periods.
drum
Static IP addresses are useful Dynamic IP address is The image is converted into an electric charge,
when websites need to relatively more secure, hence which attracts charged toner such that it sticks to
remember a device for a long used where data privacy is the image
time. Eg) VPNs whitelisting important Electrostatic-charged paper rolled against the
Faster upload/download Maintaining the cost of the drum
speeds dynamic IP address is a lesser Charge pulls toner away from drum and onto
paper
URL (Uniform Resource Locator) Heat applied in the fuser to fuse toner to the paper
Unique reference address for the exact location of an The electrical charge was removed from the drum,
internet resource on the WWW and excess toner was collected
3D printer
The process starts with a saved digital file that
Protocol: enables the browser to know what protocol is
holds the blueprint of the object to be printed
used to access info in the domain
The object is then built by sequentially adding
Hostname: Domain name
layers of a material (e.g. polymer resin) until the
Location of server: path
object created
Domain Name Service (DNS)
The object is then cured (e.g. resin-made objects
naming system used for computers or resources
are hardened by UV light)
having an internet connection
Microphone
Consists of a hierarchy of DNS servers which have a
Incoming sound waves enter the screen and cause
URL database and their corresponding IP addresses
vibrations in the diaphragm
Vibrations cause the coil to move past a magnetic
3. Hardware core
Electrical current is generated, which is then
digitized
3.1. Computers and their Components Speaker
Takes electrical signals and translates them into
A general-purpose computer system comprises a physical vibrations to create sound waves
processor, memory, and I/O functionality. The electric current in the voice coil generates an
Understanding the need for electromagnetic field
Input: take in data from the outside world Change in digital audio signal causes current
Output: display data for humans’ understanding direction to change, which changes field polarity
Primary storage: computer’s main memory, which
stores a set of critical program instructions & data

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

Electromagnet is either attracted or repelled to a padding


permanent magnet, causing a diaphragm that is The display provides a simulation of a 3D environment
attached to the coil to vibrate generated by a 3D graphics package
Vibration transmitted to air in front of the speaker The user can ‘move’ in the virtual environment by
The degree of vibration determines the amplitude moving their head or using controllers
and frequency of the sound wave produced Buffers: a queue that temporarily stores data to balance
Magnetic Hard Disk input/output speed of data, while the cache is the short-
Hard disks have platters whose surfaces are covered term memory storage that stores frequently used data.
with a magnetisable material. Random Access Memory vs. Read-Only Memory
Platters are mounted on a central spindle and rotated
at high speed RAM ROM
The surface of platters is divided into concentric tracks Volatile memory: loses Non-volatile memory: does
& sectors, where data is encoded as magnetic content when power is turned not lose content when power
patterns off is turned off
Each surface is accessed by read/write heads It can be read and altered It can only be read
When writing, current variation in the head causes
Used to store currently Used for storing OS kernel
magnetic field variation on the disk
executing program and boot-up instructions
When reading, magnetic field variation from the disk
produces current variation in the read head
Types of RAM - Static RAM vs. Dynamic RAM
Solid State (Flash) Memory
Most use NAND-based flash memory SRAM DRAM
Consist of a grid of columns & rows that has 2
Doesn’t need to refresh; Has to be refreshed; it has
transistors at each intersection
hence, it uses less power and slower access times and
Two transistors:
faster access time needs higher power
Floating Gate: stores electrons, and the presence or
absence of charge (electrons) represents either 1 or 0 Only a single transistor &
More complex circuitry, hence
Control Gate: controls charge (electrons) flow for capacitor, hence less
more expensive
read/write expensive to purchase
Optical Disc Reader/Writer Each bit is stored in a flip-flop Each bit is stored as a charge
The disc surface has a reflective metal layer and is Has lower data density Has higher data density
spun Used in cache memory Used in main memory
The tracking mechanism moves the laser assembly
The lens focuses laser onto the disc
Types of ROM – PROM vs. EPROM vs. EEPROM
A laser beam shone onto a disc to read/write
Tracks have sequences of amorphous and crystalline PROM EPROM EEPROM
states on the metallic layer
Electrically
When reading, the reflected light from the different Erasable
Programmable Erasable
states on the track is encoded as bit patterns Programmable
ROM Programmable
When writing, the laser changes surface to crystalline ROM
ROM
and amorphous states along the track, corresponding
to 1s or 0s. It can be It can be erased by It can be erased by
Touchscreen programmed only UV light exposure an electrical signal
Considered as both an input & output device once after it is and can then be and can then be
2 types: created reprogrammed reprogrammed
Chip has to be Can update data
Data cannot be
Resistive Capacitive removed for without removing
erased or deleted
Consists of two charged Made from materials that reprogramming the chip.
plates store electric charge
Pressure causes plates to When touched, the charge is Monitoring and Control Systems
touch, completing the circuit transferred to the finger Monitoring System
Monitors some state external to the computer
Point of contact registered
system
with coordinates used to
No changes were made to the environment by the
calculate the position
system, and hence, no feedback
Control System
Virtual (Reality) headset
Regulates the behaviour of other devices or
Virtual headsets consist of 2 lenses, (an LCD) display,
systems.
a circuit board with sensors, a cover and foam

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

Event-driven system: the controller alters the


system's state in response to some event.
Time-driven system: the controller takes action at
a specific point in time
Hardware typically used in a system
Sensor: measures an (analogue) property and
transmits it to a processing unit, generally as an
electrical or optical signal.
Actuators: switch on/off heavy appliances (e.g.
heater to heat/fan to cool)
ADC: converts analogue signals to digital signals
Transmission cable: to transfer signals
Feedback Systems
Output from the system affects the input of
sensors. NOT gate: an inverter (A)
Ensures the system operates within the given
criteria A Output
Enabling the system output to affect subsequent 1 0
system inputs may cause a change in the actions 0 1
taken by the system
This enables the system to adjust conditions in a
continuous process automatically

3.2. Logic Gates and Logic Circuits


Logic Gates: use one or more inputs and produce a single
logical output
AND gate: If both inputs are high, the output is high ( A•B) A B Output

A B Output 0 0 1

0 0 0 0 1 1

0 1 0 1 0 1

1 0 0 1 1 0

1 1 1
NAND gate: (A•B) \n

\n

A B Output

A B Output 0 0 1

0 0 0 0 1 0

0 1 1 1 0 0

1 0 1 1 1 0

1 1 1

OR gate: If either input is high, the output is high ( A+B)

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

NOR gate: (A+B) \n Memory Address Register (MAR): Holds the


address of the memory cell of the program which
is to be accessed
Accumulator (ACC): holds all values that are
processed by arithmetic & logical operations.
Index Register (IX): Stores a number used to
change an address value
Current Instruction Register (CIR): Once program
instruction is fetched, it is stored in CIR and allows
the processor to decode & execute it
A B Output Status Register: holds results of comparisons to
0 0 0 decide later for action, intermediate and
erroneous results of arithmetic performed
0 1 1
The Processor (CPU)
1 0 1 Arithmetic and Logic Unit (ALU): part of the processor
1 1 0 that processes instructions which require some form
of arithmetic or logical operation
XOR gate: ( A ⨁B) \n Control Unit (CU): part of the CPU that fetches
instructions from memory, decodes them &
synchronizes operations before sending signals to the
computer’s memory, ALU and I/O devices to direct
how to respond to instructions sent to the processor
Immediate Access Store (IAS): memory unit that the
processor can directly access
System Clock: a timing device connected to a
processor that synchronises all components.
Buses
set of parallel wires that allow the transfer of data
4. Processor Fundamentals between components in a computer system
Data bus: bidirectional bus that carries data
instructions between processor, memory, and I/O
4.1. Central Processing Unit (CPU) devices.
Architecture Address bus: unidirectional bus that carries the
address of the main memory location or
Von Neumann model input/output device about to be used, from
Von Neumann realized data & programs are processor to memory address register (MAR)
indistinguishable and can, therefore, use the same Control bus
memory. Bidirectional
Von Neumann's architecture uses a single processor. used to transmit control signals from the control
It follows a linear sequence of fetch–decode–execute unit to ensure access/use of data & address buses
operations for the set of instructions, i.e. the program. by components of the system does not lead to
To do this, the processor uses registers. conflict
Registers: smallest unit of storage of microprocessor; Performance of Computer System Factors
allows fast data transfer between other registers Clock Speed
General Purpose registers number of pulses the clock sends out in a given
Used to temporarily store data values which have time interval, which determines the number of
been read from memory or some processed result cycles (processes) the CPU executes in a given
Assembly language instructions can use it time interval
Special Purpose Registers usually measured in Gigahertz (GHz)
Some are accessible by assembly language If the clock speed is increased, then the execution
instructions time for instructions decreases. Hence, more
Only holds either data or memory location, not both cycles per unit time, which increases performance.
Particular purpose registers include: However, there is a limit on clock speed since the
Program Counter (PC): holds the address of the heat generated by higher clock speeds cannot be
next instruction to be fetched removed fast enough, which leads to overheating.
Memory Data Register (MDR): holds data value Bus Width
fetched from memory Determines the number of bits that can be
simultaneously transferred

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

Refers to the number of lines in a bus Execute


Increasing bus width increases the number of bits Return to start
transferred simultaneously, increasing processing Square brackets: value currently in that register
speed and performance. Double square brackets: CPU is getting value
Cache Memory stored at the address in the register
Commonly used instructions are stored in the Interrupts
cache memory area of the CPU. A signal from a program seeking the processor’s
If the cache memory size is increased, more attention
commonly executed instructions can be stored, Interrupt Service Routine (ISR):
and the need for the CPU to wait for instructions to Handles the interrupt by controlling the processor
be loaded reduces. Hence, the CPU executes more Different ISRs used for different sources of
cycles per unit of time, thus improving interrupt
performance. A typical sequence of actions when an interrupt occurs:
Number of Cores The processor checks the interrupt register for
Most CPU chips are multi-core — have more than interrupt at the end of the F-E cycle for the current
one core (essentially a processor) instruction
Each core simultaneously processes different If the interrupt flag is set in the interrupt register, the
instructions through multithreading, improving interrupt source is detected
computer performance. If the interrupt is low priority, then an interrupt is
Ports disabled
Hardware which provides a physical interface If interrupting is a high priority:
between a device with CPU and a peripheral device All contents of registers of the running process are
Peripheral (I/O) devices cannot be directly connected saved on the stack
to the CPU, hence connected through ports. PC is loaded with the ISR and is executed
Universal Serial Bus (USB): Can connect both input Once ISR is completed, the processor restores the
and output devices to the processor through a USB registers’ contents from the stack, and the
port. interrupted program continues its execution.
High Definition Multimedia Interface (HDMI) Interrupts re-enabled and
Can only connect output devices (e.g. LCD) to the Return to the start of the cycle
processor through a HDMI port
HDMI cables transmit high-bandwidth and high- 4.2. Assembly Language
resolution video & audio streams through HDMI
ports Assembly language: low-level programming language
Video Graphics Array (VGA) with instructions made up of an op code and an operand
Can only connect output devices (e.g. second Machine code: code written in binary that uses the
monitor/display) to the processor through a VGA processor’s basic machine operations
port Relationship between machine and assembly language:
VGA ports allow only the transmission of video every assembly language instruction (source code)
streams but not audio components translates into exactly one machine code instruction
Fetch-Execute (F-E) cycle (object code)
Fetch stage Symbolic addressing
PC holds the address of the next instruction to be Symbols used to represent operation codes
fetched Labels can be used for addresses
The address on the PC is copied to MAR Absolute addressing: a fixed address in memory
PC is incremented Assembler
Instruction loaded to MDR from the address held in Software that changes assembly language into
MAR machine code for the processor to understand
Instruction from MDR loaded to CIR The assembler replaces all mnemonics and labels
Decode stage: The opcode and operand parts of with their respective binary values (that are
instruction are identified predefined before by the assembler software)
Execute stage: Instructions executed by the control One pass assembler
unit sending control signals Assembler converts mnemonic source code into
Register Transfer Notation (RTN) machine code in one sweep of program
MAR ← [PC] Cannot handle code that involves forward referencing
PC ← [PC] + 1 Two pass assembler: software makes 2 passes thru code
MDR ← [[MAR]] On the first pass:
CIR ← [MDR] Symbol table created to enter symbolic addresses
Decode and labels into specific addresses

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

All errors are suppressed Indirect Addressing: The address to be used is at given
On the second pass: address. Load contents of this second address to ACC
Jump instructions access memory addresses via Indexed addressing: form the address to be used as
table + the contents of the IR (Index Register)
Whole source code translates into machine code Relative addressing: next instruction to be carried out
Error reported if they exist is an offset number of locations away, relative to
Grouping the Processor’s Instruction Set address of current instruction held in PC; allows for
relocatable code
Op Code Operand Explanation Conditional jump: has a condition that will be checked
Addressing (like using an IF statements)
LDM #n Immediate: Load n into ACC Unconditional jump: no condition to be followed,
simply jump to the next instruction as specified
Direct: load contents at
LDD
address into the ACC
Indirect: load contents of 4.3. Bit Manipulation
LDI address at given address into
ACC Binary numbers can be multiplied or divided by shifting
Left shift (LSL #n)
Indexed: load contents of
LDX Bits are shifted to the left to multiply
given address + IR into ACC
E.g. to multiply by four, all digits shift two places to left
Data Movement Right shift (LSR #n)
Store contents of ACC into Bits are shifted to the right to divide
STO
address E.g. to divide by four, all digits shift two places to right
Arithmetic Logical shift: zeros replace the vacated bit position
Operations
Add contents of register to
ADD
ACC Arithmetic shift: Used to carry out multiplication and
Add 1 to contents of the division of signed integers represented by bits in the
INC accumulator by ensuring that the sign-bit (usually the
register
Comparing MSB) is the same after the shift.

Compare contents of ACC


CMP
with that of given address Cyclic shift: the bit that is removed from one end by the
Compare contents of ACC shift is added to the other end.
CMP #n
with n
Conditional Jumps Bit Masking
Jump to address if compare Each bit can represent an individual flag.
JPE ∴ by altering the bits, flags could be operated upon.
TRUE
Bit manipulation operations:
Jump to address if compare
JPN Masking: an operation that defines which bits you
FALSE
want to keep and which bits you want to clear.
Unconditional Jumps Masking to 1: The OR operation is used with a 1.
JMP Jump to given address Masking to 0: The AND operation is used with a 0.
I/O Data Matching: an operation that allows the
Input any character and store accumulator to compare the value it contains to
IN the given value in order to change the state of the
ASCII value in ACC
status register.
Output character whose
OUT Practical applications of Bit Masking:
ASCII value is stored in ACC
Setting an individual bit position:
Ending Mask the content of the register with a mask
Return Control to operating pattern which has 0 in the ‘mask out’ positions and
END
system 1 in the ‘retain’ positions.
Set the result with the match pattern by using the
#denotes immediate addressing AND command with a direct address.
B denotes a binary number, e.g. B01001010 & denotes a Testing one or more bits:
hexadecimal number, e.g. &4A Mask the content of the register with a mask
pattern which has 0 in the ‘mask out’ positions and
Modes of Addressing 1 in the ‘retain’ positions.
Direct Addressing: loads contents at address into ACC

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

Compare the result with the match pattern by Prepares a hard disk to allow data to be stored on
using the CMP command or by “Checking the it
pattern”. Deletes any existing data on disk
Checking the pattern Performs formatting, process where computer
Use AND operation to mask bits and obtain ‘draws lines’ on disk surface to split it into small
resultant. areas
Now subtract matching bit pattern from resultant. Virus checker
The final ‘non-zero’ result confirms the patterns Checks for and then removes any viruses found
are not the same else vice versa. Constantly checks all incoming and outgoing files
Defragmentation Software
Files can be big so have to be stored in multiple
5. System Software sectors, which can result in fragmentation
(contents of file scattered across >2 non-
contiguous sectors)
5.1. Operating System
Fragmentation slows down disk access and thus
Need for OS the performance of the entire computer.
A set of programs designed to run in the background Defragmenting software works by physically
on a computer system which reorganizing disk contents (files) such that they
Controls operation of computer system are stored in contiguous sectors.
Provides a user interface This defragmentation reduces number of
Controls how computer responds to user’s movements of the read/write heads require to
requests access the disk contents, hence increasing
Controls how hardware communicate computer performance
Provides an environment in which application The defragmentation also creates larger
software can be executed contiguous free space regions
OS hardware is unusable without an OS, as the OS Disk contents analysis/disk repair software
acts as an interface since it controls communication Software utility for visualization of disk space
between user and hardware usage
Key Management Tasks Gets size for each folder and files, and generates a
(Main) Memory Management graphical chart showing disk usage distribution
Memory protection to ensure 2 programs do not according to folders or other user defined criteria.
try to use same memory space Allows disk to report errors (e.g. “bad sector”)
Paging Software will attempt to offer a solution
Use of virtual memory File Compression
File Management Reduces file size by removing redundant data in
Provides file naming conventions files
Maintains a directory structure Causes improvements in the computer’s
performance by reducing the data that needs to be
Allocates space to particular files
Security Management stored
Proves usernames & passwords Back-up Software
Ensures data privacy Makes copy of files on another storage medium in
Prevents unauthorized access the event of a hard drive failure, user error,
Carries out automatic backup disaster or accident.
Hardware (input/output/peripherals) Management Should be a regular process
Installation of appropriate driver software Can provide synchronization between devices
Controls access to data sent to and from Program Libraries
peripherals Pre-written code that can be linked to a software
Receives & handles interrupts from hardware under development without any amendments
devices Can perform common or complex tasks
Process Management Takes the form of classes
Enables multiprogramming and multitasking Benefits:
Resolution of conflicts when 2 or more processes Saves time: less code needs to be written
Smaller testing time: pre-tested and used by
requires the same resource
E.g. via Round-robin method others
Utility Software Library file is a complex algorithm which the user
Disk Formatter does not need to understand to use it
Dynamic Link Library (DLL) files
Shared library file that contains code and data

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

Code saved separately from the main .EXE file, Type checking & parameter checking
reducing the .EXE file’s size Presentation
Code only loaded to main memory when required Prettyprint: Automatic indentation and color-
DDL file can be made available to several applications coding of keywords
simultaneously, thus reducing strain on memory Expand and Collapse code blocks: Saves excessive
DLL files act as modules in more complex programs, scrolling if collapsed, and easy to see global
making it easier to install and run updates variable declarations and main program body
when collapsed
Debugging
5.2. Language Translators
Single stepping: Executes program line-by-line to
Assembler see the effect of each statement on variables
Software that translates assembly language Breakpoints: Pauses program at a specific line to
statements into machine code (binary) for execution ensure program operates correctly up to that line
The mnemonics used translates into machine opcodes Variables/expressions Report Window: Monitors
Process simple because assembly language has a variables for comparing values.
one-to-one relationship with machine code.
Compiler and Interpreter
6. Security, Privacy and Data
Compiler Interpreter
Translates a high-level Translates and executes a
Integrity
language program to high-level language program,
machine code. line-by-line. 6.1. Data Security
Creates a .exe file which can
No .exe file created. Data Security: ensuring data is protected against loss and
be easily distributed.
unauthorized access.
Once compiled, .exe file does
Execution very slow – Data Integrity: making sure that data is valid and does not
not need to be compiled
translated each time program corrupt after transmission
again, resulting in faster
run. Data Privacy: ability to determine what data is shared with
execution.
a third party
Debugging easier/faster, Data Security and Computer System Security
Reports all errors at the end
since it stops translating when
of compilation: difficult to
it reaches an error. This Data Security System Security
locate errors∴ development
allows real time error Protection of data on a Protection of the computer
process long.
correction. computer system system
Only be produced when all Can run program any time, To prevent access of viruses
errors are fixed. even before code finished. To prevent corruption of data
to the system and prevent
Used when development is and prevent hackers from
Used during development. hackers from entering your
completed. using data
computer system
E.g. encryption E.g. ID & Password
Two-step translation
Java and some other high level language programs Threats to Computer & Data Security
may require two-step translation, i.e., they will be
Malware
partially compiled and partially interpreted software intentionally designed to damage a
Java code first translated to bytecode by Java compiler
computer or computer network
Bytecode finally interpreted by the Java Virtual Includes Virus & Spyware
Machine to produce machine code
Virus: Software that replicates itself by inserting a
Integrated Development Environment (IDE) features copy of itself into another piece of software, which
Coding
may cause the computer to crash and can lead to
Context-sensitive prompts: Displays choice of
deletion or corruption of data
keywords and available identifiers appropriate at Spyware: software that gathers information about
current insertion point and provides choices in
users' online and offline activity, including
alphabetical order accessed sites, applications, and downloaded files.
Highlights undeclared/unassigned variable
Risk restriction: Ensure anti-virus and anti-spyware
identifiers software is installed, regularly updated and run.
Initial Error Detection
Hacking
Dynamic syntax checks: Automatic checking and illegal access to a computer system
highlighting of syntax errors, as soon as line typed

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

Hackers can obtain user’s confidential data which Within the same computer system or at different
can cause identity theft site
Can lead to the deletion or corruption of data Disk-mirroring strategy
Risk restriction: Use strong passwords and ensure Real-time strategy that writes data to two or more
firewall disks at the same time.
Phishing If one fails, the other is still there to be read off of
Attempt through emails to obtain user’s
confidential data which can cause identity theft 6.2. Data Integrity
Risk restriction: Ignore suspicious mails and
ensure firewall criteria include SPAM filters, Data validation and data verification help protect the
blacklist, etc. integrity of data by checking whether the data entered is
Pharming sensible and accurate, respectively.
Redirects user to a fake website that appears Data Validation: checks if data entered is valid, but not its
legitimate to gain confidential data accuracy
Risk restriction: use a reliable ISP; check that links Data Validation Methods
are genuine and ensure https is present in the URL Range check: data must be between a set of values
Computer System Security Measures Format check: data must follow correct pattern/order
User Accounts and Passwords Length check: data must have exact no. of characters
Usernames & passwords to deny access to Presence check: checks if some data has been
unauthorized users entered
User-assigned privilege, which accesses to only Existence check: data entered must exist
the user’s workplace, preventing the user to have Limit check: checks whether a value entered is within
admin rights. acceptable minimum and maximum values.
Can assign privileges to files so users with low Check digit: A digit is used as the answer to an
privileges do not have access. arithmetic operation of other digits in data. If not
Firewalls matched, then data entered incorrectly
Hardware or software that filters information Data Verification: checks data entered is accurate during
travelling between the computer system and the data entry and data transfer
internet Data Entry Verification Methods
(software) firewall can make decisions about what Visual Check: Person manually compares original data
to allow and block by detecting illegal attempts by with that entered to check if correct
specific software to connect to the internet Double Entry: Enter data into computer twice and
Authentication compares.
Process of determining whether someone is who If differences found, go back to raw data to fix error
they claim to be. Data Transfer Verification Methods
Helps prevent unauthorized access Errors may occur when data moved in system.
Log-on using digital signatures, passwords and Parity Check
biometric scans. All data transmitted as bits
Anti-virus software Number of 1s in a byte must always be either an
Runs in the background to detect & remove odd number or an even number
viruses. Parity can be set either as even or odd
Checks files for known malicious patterns E.g. two communicating devices decide there will
Anti-spyware software: detects & removes spyware. always be an odd number of 1s. A byte is received
Encryption: that has even number of 1s so error occurred and
Conversion of data to code by encoding it receiving device would ask for it to be sent again
It doesn’t stop illegal access but appears Used also when data sent between parts of the
meaningless CPU
Necessary to use decryption software to decode Not foolproof: if 2 bits are transposed, data
data accepted
Data Security Measures Checksum Check
Encryption Data sent from one place to another as block of
Access Rights to data (authorization): different bytes rather than individual bytes
users assigned different authorization levels which Computer adds together all bytes being sent
prevent them from accessing all data ∴ increases Any bits lost at most-significant end as carry
security ignored so answer is an 8-bit number
Data Backup Checksum calculated before and after data sent
An exact copy of an original piece of data in case If two bytes different, error occurred therefore
the original is lost or corrupted block of bytes must be sent again

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

efficiency
7. Ethics and Ownership AI Applications
Developing autonomous mechanical products
Ethics: a system of moral principles that guide behaviour Machine learning through data sets
based on philosophical views AI Impacts
Computer Ethics Social
Regulate how computing professionals should make Replacement of manual labour with automation
decisions regarding professional & social conduct. could lead to massive unemployment.
A computing professional can be ethically guided by However, it could lead to increased leisure time.
joining a professional, ethical body such as the BCS Economic: Due to increased innovation and efficiency
and IEEE, which have codes of conduct. with automation provided by AI, there’d be lower
Ownership manufacturing costs in general
Data ownership: having legal rights and complete Environmental: Detrimental impact on the
control over a single piece or set of data elements. environment due to robot manufacture with limited
Copyright gives the creators of some types of media resources and its waste disposal
rights to control how they're used and distributed.
Competitors can steal programming ideas and
methods; software can easily be copied and 8. Database and Data
bootlegged (sold illegally); hence, legislation is needed
to protect the ownership, usage, and copyright of data. Modelling
Software Licencing
Free Software Foundation:
8.1. File Based System
A license gives users freedom to run, copy,
distribute, study, change, and improve the Data stored in discrete files, stored on computer, and can
software.
be accessed, altered or removed by the user
Condition: any redistributed version of software
must be distributed with original terms of free use, Disadvantages of File Based System:
modification, and distribution (aka copyleft)
The Open Source Initiative: No enforcing control on organization/structure of files
The source code of open-source software is Data repeated in different files; manually change each
readily available to users under copyright; it does Sorting must be done manually or must write a program
enable users to re-distribute the software. Data may be in different format; difficult to find and use
The concept of an open-source program relies on Impossible for it to be multi-user; chaotic
the fact that users can review source code to Security not sophisticated; users can access everything
eliminate bugs in it
Shareware: 8.2. Database Management Systems
Demonstration software that is distributed for free
but for a specific evaluation period only
(DBMS)
Distributed on a trial basis and with an
Database: collection of non-redundant interrelated data
understanding that sometime later, a user may be
DBMS: Software programs that allow databases to be
interested in paying for it
defined, constructed and manipulated
Used for marketing purposes
Commercial: Requires payment before it can be used, Features of a DBMS:
but includes all program's features, with no
restrictions Data management: data stored in relational databases -
Artificial Intelligence (AI): the ability of a computer to tables stored in secondary storage
perform tasks in such a way that is conventionally Data dictionary contains:
associated with human intelligence: List of all files in database
AI can learn from past mistakes No. of records in each file
they adapt to stop the same problem from Names & types of each field
occurring again Data modeling: analysis of data objects used in database,
they learn to predict what might happen & raise identifying relationships among them
alert Logical schema: overall view of entire database, includes:
AI can learn to work more efficiently entities, attributes and relationships
when an action slows the system down, it can Data integrity: entire block copied to user’s area when
prevent this from happening again being changed, saved back when done
when an action increases the speed of the system, Data security: handles password allocation and
it can repeat this when necessary to improve verification, backups database automatically, controls

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

what certain user’s view by access rights of individuals or 1st Normal Form (1NF): contains no repeating attribute or
groups of users groups of attributes. Intersection of each tuple and attribute
contains only 1 value. Example:
Data change clash solutions:

Open entire database in exclusive mode – impractical with


several users
Lock all records in the table being modified – one user
changing a table, others can only read table
Lock record currently being edited – as someone changes
something, others can only read record
User specifies no locks – software warns user of
simultaneous change, resolve manually
Deadlock: 2 locks at the same time, DBMS must
recognize, 1 user must abort task

Tools in a DBMS:
2nd Normal Form (2NF): it is in 1NF and every non-primary
Developer interface: allows creating and manipulating key attribute is fully dependent on the primary; all the
database in SQL rather than graphically incomplete dependencies have been removed. Example:
Query processor: handles high-level queries. It parses,
validates, optimizes, and compiles or interprets a query
which results in the query plan.

8.3. Relational Database Modelling


Entity: object/event which can be distinctly identified
Table: contains a group of related entities in rows and
columns called an entity set
Tuple: a row or a record in a relational database
Attribute: a field or column in a relational database
Primary key: attribute or combination of them that
uniquely define each tuple in relation
Candidate key: attribute that can potentially be a primary
key
Foreign key: attribute or combination of them that relates
2 different tables
Referential integrity: prevents users or applications from
entering inconsistent data
Secondary key: candidate keys not chosen as the primary
key
Indexing: creating a secondary key on an attribute to
provide fast access when searching on that attribute;
indexing data must be updated when table data changes

8.4. Relational Design of a System

3rd Normal Form (3NF): it is in 1NF and 2NF and all non-key
elements are fully dependent on the primary key. No inter-
dependencies between attributes.

MANY-TO-MANY functions cannot be directly normalized


to 3NF, must use a 2 step process e.g.

8.5. Normalization
becomes:

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL COMPUTER SCIENCE

SELECT <field-name>
8.6. Data Definition Language (DDL)
FROM <table-name>
WHERE <search-condition>
Creation/modification of the database structure using this
language SQL Operators:
written in SQL
Creating a database: = Equals to

CREATE DATABASE <database-name>


> Greater than
< Less than
Creating a table: >= Greater than or equal to
CREATE TABLE <table-name> (…) <= Less than or equal to
<> Not equal to
Changing a table:
IS NULL Check for null values
ALTER TABLE <table-name>
Sort into ascending order:
Adding a primary key:
ORDER BY <field-name>
PRIMARY KEY (field)
ADD <field-name>:<data-type> Arrange identical data into groups:

Adding a foreign key: GROUP BY <field-name>

FOREIGN KEY (field) REFERENCES <table>(field) Joining together fields of different tables:

Example: INNER JOIN

CREATE DATABASE ‘Personnel.gdb’ Data Maintenance:


CREATE TABLE Training
Adding data to table:
(EmpID INT NOT NULL,
CourseTitle VARCHAR(30) NOT NULL, INSERT INTO <table-name>(field1, field2, field3)
CourseDate Date NOT NULL, VALUES (value1, value2, value3)
PRIMARY KEY (EmpID, CourseDate),
FOREIGN KEY (EmpID) REFERENCES Employee(EmpID)) Deleting a record:

DELETE FROM <table-name>


8.7. Data Manipulation Language (DML) WHERE <condition>

Query and maintenance of data done using this language Updating a field in a table:
– written in SQL
UPDATE <table-name>
Queries: SET <field-name> = <value>
WHERE <condition>
Creating a query:

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved.
This document is authorised for personal use only by AgatePuppet Dark at Private on 08/05/24.
CAIE AS LEVEL
Computer Science

© ZNotes Education Ltd. & ZNotes Foundation 2024. All rights reserved.
This version was created by AgatePuppet Dark on 08/05/24 for strictly personal use only.
These notes have been created by Saketh Devareddy 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