0% found this document useful (0 votes)
3K views20 pages

AS Level CS P1

Uploaded by

Danial Kashif
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)
3K views20 pages

AS Level CS P1

Uploaded by

Danial Kashif
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/ 20

ZNOTES.

ORG

UPDATED TO 2024-2025 SYLLABUS

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

1. Find the binary equivalent of the denary


number (ignoring the negative sign) | 42 =
1. Information Representation 101010
2. Add extra 0 bits before the MSB, to format the
binary number to 8 bits | 00101010
1.1. Data Representation
3. Convert binary number to one’s complement
The two fundamental characteristics of any number (flip the bits) | 11010101
system are: 4. Convert binary number to two’s complement
A base: The number of different digits that a system (add 1) |1010101 + 1 = 11010110
can use to represent numbers Converting binary two’s complement into denary
Place value: The specific-value of a digit based on its (example 11010110):
position within a number 1. Flip all the bits | 00101001
Denary - Base 10 2. Add 1 | 00101010
Binary Systems - Base 2 3. Convert binary to denary and put a negative
Possible bits (binary digits): 0 and 1 sign) | -42
All data and characters are represented in binary Maximum positive number in 8 bits: 127
Maximum negative number in 8 bits: -128
128 64 32 16 8 4 2 1 Hexadecimal Systems - Base 16:
0 0 0 0 0 0 0 0 Possible digits: 0 to 9 and A to F, where A to F
represent denary digits 10 to 15
Practical applications:
For example, 65 in binary is 0100001
Defining colours in HTML
Defining Media Access Control (MAC) addresses
Denary vs. Binary prefixes: Assembly languages and machine code
Debugging via memory dumps
Denary Prefix Factor Value Binary Prefix Factor Value Example - A5 in Denary = (16×10) + (1×5) = 165
kilo- (k) ×103 kibi- (Ki) ×210 Example - 65 in Hexadecimal = 65÷16 = 4 | Remainder
1 | ∴ = 41
mega- (M) ×106 mebi- (Mi) ×220 Character Sets:
giga- (G) ×109 gibi- (Gi) ×230 A character set generally includes upper & lower case
letters, number digits, punctuation marks, and other
tera- (T) ×1012 tebi- (Ti) ×240
characters.
Character sets use different binary representations
Binary Coded Decimal (BCD)
for each character via character encoding
Binary representation where each positive denary
digit is represented by a sequence of 4 bits (nibble).
Only certain digits are converted to BCD because Character Encoding Standards:
particular digits represent a digit greater than 9.
For example, to represent 429 in BCD: ASCII Extended ASCII Unicode
Convert each individual digit of the number to its ASCII’s extension - Superset for ASCII
binary equivalents - Only the English Also includes most & extended ASCII -
1. 4 = 0100 alphabet can be European recognized by
2. 2 = 0010 represented languages’ various global
3. 9 = 1001 alphabets languages
Concatenate the 3 nibbles (4-bit group) in order to It has an excellent
produce BCD: 0100 0010 1001 Each character
ASCII extended to 8 range of
Practical applications encoding takes up 7
bits, hence 256 characters, using 2
A string of digits on any electronic device displaying bits, hence 128
possible characters or 4 bytes per
numbers (like in calculators) possible characters
character
Accurately measuring decimal fractions
2 or 4 times more
Electronically coding denary numbers Smaller storage
storage space per
Two’s Complement space
character
We can represent a negative number in binary by
making the most significant bit (MSB) a sign bit, which
indicates whether the number is positive or negative. 1.2. Multimedia - Graphics, Sound
Converting from negative denary to binary two’s
complement (example -42): Bitmap Images

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

Definition: Bitmap images are created by assigning a


solid color to each pixel using bit patterns. Sound
Encoding: Analogue vs Digital:
Bit patterns are generated by considering each Analogue data consists of continuous electrical
grid row as a series of binary color codes signals.
corresponding to each pixel’s color. Digital data consists of discrete electrical signals.
These bit patterns are ‘mapped’ onto the main Sound Signals: Vibrations through a medium,
memory. inherently analogue due to infinite detail.
Pixels: The smallest picture element whose color can Conversion:
be accurately represented by binary code. Analogue signals are converted to digital signals
File Header: Bitmap images contain a file header with by sampling.
metadata, including image size, number of colors, etc. The sound wave’s amplitude is sampled at set time
intervals.
These samples are encoded as a binary number
Image Resolution sequence, providing a digital representation of the
Definition: Pixel density, measured by the number of sound wave
pixels per centimeter.
Effect: Higher resolution results in sharper, more
detailed images. Sampling Rate
Definition: Number of samples taken per unit of time.
Effect: Increasing the sampling rate improves the
Screen Resolution accuracy of the digitized sound wave representation
Definition: The number of pixels that can be viewed but increases file size.
horizontally and vertically on a device’s screen.
Calculation: N umber of pixels = width ×
height (e.g., 1680 × 1080 pixels). Sampling Resolution
Definition: Number of bits used to encode each
sample.
Colour depth Effect: Increasing sampling resolution improves the
Definition: The number of bits used to represent the accuracy of digitized sound waves but increases file
colour of a single pixel. size.
Calculation: An image with n bits has 2n colours per
pixel (e.g., a 16-color bitmap has 4 bits per pixel
Bit Rate
because 24 = 16) Definition: Number of bits used to store 1 second of
Effect: Increasing color depth improves color quality sound.
but also increases file size. Calculation: Bit Rate = Sampling Rate ∗
File Size Calculation:
Sampling Resolution
File Size = Number of Pixels × Color Depth
Length of Sound: Measured in seconds.
Convert bits to bytes by dividing by eight if
necessary.
Applications: Scanned images and general computer 1.3. Compression
usage, where small file sizes and easy manipulation
are beneficial. Definition: Compression is the process of reducing file
size without significant loss in quality, resulting in:
Reduced time needed to search for data.
Vector Graphics Faster transfer of compressed files, using less
Definition: Made up of drawing objects. bandwidth than uncompressed files.
Drawing Objects: Mathematically defined constructs
(e.g., rectangles, lines, circles).
Drawing List: A set of commands defining the vector. Lossless Compression
Properties: Basic geometric data that determine the Definition: A type of compression that allows original
shape and appearance of each object. data to be perfectly reconstructed from a compressed
Encoding: Data is encoded using mathematical file by utilizing some form of replacement.
formulas to generate properties for drawing lines and Examples: Bitmap (.bmp), vector graphic (.svg), .png
curves to create the image. images, text file compression, database records.
Scalability: Objects can be resized without losing Run-Length Encoding (RLE):
quality, unlike bitmaps. Definition: A form of lossless compression used
Applications: Company logos and other graphics that for compressing text files and bitmap images.
require scaling.

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

Mechanism: Reduces file size by encoding Email server: For sending, receiving, and storing
sequences of adjacent, identical elements emails.
(characters in text files and pixels in bitmap Database server: Manages DBMS.
images) into two values: run count and run value. Domain controller server:
Example: RLE of a bitmap image. Manages user accounts (IDs & passwords).
The client sends a login request to the server,
which processes and grants the request if the
Lossy Compression
user ID & password are recognized.
Definition: A type of compression that irreversibly
eliminates unnecessary data.
Effect: File accuracy/quality is lower than with lossless Thin Clients vs. Thick Clients
compression, but file size is significantly reduced
(often to about 10% of the lossless size). Thin Clients Thick Clients
Examples: Sound files (.mp3), .jpeg images. A client that solely runs on the
An independent client that
Mechanism in Sound Files: resources provided by the
does not require the server to
Perceptual Coding: Removes parts of the sound server and has no local
run.
that are less audible or discernible to human storage.
hearing, as used in .mp3 compression. Only provides input and
Thick client processes most of
receives output; processing is
the application locally.
2. Communication done by the server.
Smaller purchase cost:
Can function even if no server
expensive, demanding
is connected (works offline).
2.1. Networks, including the Internet hardware is not required.
Improved security: Cannot run
Networking devices: Interconnected devices that enable No lag related to network
unauthorized, harmful
fast data transmission within a network. problems.
software.
Networking benefits:
File sharing: Easily share data between different
Peer-to-Peer network model (P2P)
interconnected devices.
Definition: A decentralized network where each
Resource sharing: Use network-connected output
connected computer stores data and operates
devices like printers or share software within the
independently as a ‘peer’, acting as both a client and a
network.
server.
Higher storage: Files can be stored in network-
Applications: Internet and Ad hoc networks.
connected storage mediums.

LAN WAN Client-Server vs. Peer-to-Peer models


A network that connects A network that connects
devices within a small devices within a larger Client-Server Peer-to-Peer
geographical area, often geographical area, such as a Centralized backup. Lesser initial setup cost.
within the same building. city, country, or globally. Lesser network traffic: Each
Files & resources centralized
Only private ownership. Private or public ownership. peer can simultaneously
in server: Prevents illegal
Transmission medium: receive data from different
Transmission medium: PSTN resource usage.
Twisted Pair Cables , Coaxial sources.
or Satlink.
Cables or Wi-Fi. Improved security: Files are It can work even if a device
Higher data transfer rate. Lower data transfer rate. stored on a central server, goes down, but the client-
which would be regularly server model can’t work if the
Less congestion. Higher congestion.
scanned for malware. server goes down.
Client-Server Model
Server-based network: A dedicated server provides Network Topologies
applications (administration of users, security, and Bus
resources) for the client computer to utilize.
Client-server Applications:
Printer: Manages print jobs from client computers.
File Sharing: Clients access software and user data
files stored on the server.
Proxy server.

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

A single line (bus) connects all devices with Example: A connection between two or more LANs
terminators at each end. of different topologies.
Other computers can read data being sent
between any two computers.
Wired Networks
Unsuitable for heavy traffic due to frequent
Use copper (twisted-pair cable or coaxial cable) or
collisions.
fiber-optic cables.
Star
Cables are connected to an Ethernet port on the
network router.

Benefits Drawbacks
Less expensive and Doesn’t perform well
easier to with small charges.
Copper Cable
install. Flexible. Easier Affected by
to make terminations. electromagnetism.
Greater bandwidth,
improved security,
lightweight, easy to Needs expensive
Fiber-Optic
install, and less signal optical transmitters
Cables
boosting are required; and receivers.
used in long-distance
communications.

Consists of a central server (switch) with all other


computers connected via dedicated connections. Wireless Networks
The server can send packets to different devices Use radio waves (including WiFi), microwaves, and
simultaneously and bidirectionally. satellites to connect devices to networks without
No collisions are possible. cables.
Mesh
Benefits Drawbacks
Can travel over large Low frequency means
distances with a wide less data can be
range of wavelengths. transmitted at one
Radio
Relatively inexpensive. time. Affected by
waves
Used for TV signals and interference from radio
mobile phone stations with similar
communications. frequencies.
Expensive to build
Larger bandwidth
emitting towers.
Microwaves allows more data
Physical obstacles can
transfer.
Every device (node) is directly interconnected with interfere with signals.
each of the other devices (nodes). Cost-effective for long-
Commonly used for wireless networks, such as the distance Susceptible to
Internet, through the mesh connection of routers. Satellites communication, used in interference. Expensive
Hybrid satellite phones and setup.
radio broadcasts.

Ethernet
The most common wired medium for data
transmission in LANs or WANs.
Typically used in bus topology; data collisions are
managed by the CSMA/CD (Carrier Sense Multiple
Access with Collision Detection) method.
CSMA/CD Process:
Device checks if the channel is busy before
A combination of two or more topologies. transmitting.

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

If busy, the device waits a random time before Public cloud Private Cloud
retrying. Access provided by third- Owned and maintained by a
During transmission, the device listens for other party service providers, single organization, providing
transmissions. shared among multiple users. exclusive access.
If a collision occurs, transmission is aborted, and
Managed by cloud service Can be managed internally by
both devices wait random times before retrying.
providers using large server the organization itself, or
Bit Streaming
farms. outsourced.
Sequence of digital signals (bits) transferred over a
communication path at high speeds, requiring a fast
broadband connection and buffers. Benefits Drawback
Bit Streaming Types: Cannot access the
Real-time: Live events captured and transmitted Less technical knowledge resources/data stored on the
directly. required, easy to implement. cloud if there are bandwidth
On-demand: Pre-existing files are converted and issues.
streamed as requested. Poor data privacy, since there
Importance of High Broadband Speed/Bit-Rate Flexibility to scale with
may be data leakage in the
The user has to download and display bits at the organization’s growth
multi-tenant architecture
same time. mindset.
(public clouds).
Higher quality media requires faster speeds due to
larger data frames as well.
Real-time streaming needs higher speeds due to World Wide Web (WWW):
simultaneous data requests coming from multiple Description: Collection of web pages stored on
different users. websites.
Function: Protocols are used to transmit data across
Real-time On-demand the WWW.
Existing digital files are Internet (Interconnected Network):
converted to encoded bit- Description: Massive, open network of networks.
The event is captured live via
streaming format for Protocol: Uses TCP/IP protocol, which uses IP
a video camera that is
broadcasting on the internet addresses to identify devices connected to the
connected to a computer.
by uploading to a dedicated internet.
server. Access: Provided by Internet Service Provider.
A link for encoded video is Communication Methods: Wired, radio, and satellite.
Video signal converted to an placed on the website, and Router in a Network:
encoded streaming video the user clicks on the link to Function: Connects two networks together which
signal. view encoded streaming operate under the same protocols (for example, IP).
video. Connections: Allows internal connections between
Encoded video signal The data is streamed to a LANs or external connection from the main LAN to a
uploaded from computer to a buffer in the user’s computer, WAN.
dedicated streaming server and the buffer stops the video Additional Roles: Acts as a gateway and firewall.
Setup: Usually attached to a server or switch in a LAN.
via cables or high-speed from being paused as the bits
IP Address Translation: Translates private IP
wireless internet connection. are streamed.
addresses to public IP addresses and vice versa.
The server then sends live As the buffer is emptied, it’s
images to all users requesting filled again, thus providing
them as a real-time video. continuous viewing. LAN-Supporting Hardware:
It cannot be paused, fast- Can be paused, fast- Switch:
forwarded, etc. forwarded, etc. Connected to all devices in a LAN.
Can simultaneously broadcast information to all
devices.
Cloud Computing Server:
On-demand provision of computing services over the Device/software that provides specific functions
internet, including infrastructure, and platforms. for computers in the network.
Infrastructure: Storage capacity and higher Network Interface Card (NIC):
processing power. Provides each device (end-system) in the wired
Platform: Software, testing & debugging LAN with a unique MAC address to uniquely
resources. identify it on the network.
Allows each device to connect to the network.
Public cloud vs. Private cloud Wireless Network Interface Card (WNIC):

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

Provides each end-system of a wireless (WiFi) LAN Transmission: Radio waves are usually used for
a unique network address to identify it. transmission. Can be broadcast in all directions
Wireless Access Points (WAP): over a wide area.
Allows devices to connect to the LAN via WiFi Portable Transceivers: Devices like mobile phones
instead of using a cable. can communicate and access the internet via base
Usually built into the router. stations.
Cables:
A wired transmission medium that allows
IPv4 vs. IPv6
communication in wired networks.
Bridge:
IPv4 IPv6
Connects two LANs which work using the same
32-bit address, split into 4 The 128-bit address is divided
protocol, which can be two segments of the same
blocks by “.” into eight 16-bit blocks by “:”
network.
Stores network addresses for all devices (end- Each block could have a value Each block can have 4 hex
systems) between the two networks. between 0 and 255 (00 to FF values ranging from 0000 to
Looks for the receiving device before it sends the in hex). FFFF.
message. IPv6 can be shortened by
Repeater: removing at least (≥) 2 blocks
Connects two cables. containing only zeroes. For
Regenerates the sent data signal over the same example:
network before the signal weakens (attenuation) to For example, 255.0.1.255. “2001:0db8:85a3:0000:0000:8
prevent it from being corrupted. a2e:0070:7334” can be
shortened to
“2001:0db8:85a3::8a2e:0070:7
Internet-Supporting Hardware:
334"
Modems:
Allows a device to connect to the Internet via a
IPv4 Functionality:
telephone line.
IP Address Structure:
Function: A transmitter uses a modem to convert
Network Identifier (netID): Identifies the network to
digital signals (from the transmitting device) to
which the host (device) is connected.
analogue signals sent down the telephone line. A
Host Identifier (hostID): Identifies the host within
receiver uses a modem on the other end to
the network.
convert the analogue signals to digital signals so
Classful Addressing: Used for IPv4, where different
the receiving device can understand the data.
bit lengths for identification impose restrictions on
PSTN (Public Switched Telephone Network):
available addresses.
Refers to all telephone networks.
Subnetting:
Channel: Used between two endpoints for the call
Definition: The practice of dividing a network into
duration via circuit switching.
two or more networks.
Resilience: Lines are active even during a power
Structure: IP addresses are broken down into three
outage.
parts by not changing the netID but partitioning the
Communication: Bi-directional.
host ID into a subnet ID and host ID.
Dedicated Lines:
Subnet ID: These bits are used to identify each
Telecommunication path between endpoints.
subnet within the network.
Not shared with multiple users; it’s bought/leased.
Subnet Masks: Numbers that hide (mask) the
Function: Able to host websites as well as carry
netID of a system's IP address and leave only
phone calls. Allows continuous, uninterrupted
the host part as the machine identifier,
access to the Web.
allowing data to be routed within the subnet to
Cell Phone Network:
the appropriate host.
Wireless networks spread over land areas divided
into (hexagonal) cells.
Base Stations: Each cell is served by at least one Public and Private IP Addresses:
base station (transceiver), which uses a different Public IP:
frequency range compared to adjacent cells to Provided by the ISP.
transmit data. Unique and can be accessed across the internet.
Capacity: Larger capacity is possible since the Private IP:
same frequencies can be used in non-adjacent Issued by the LAN’s router.
cells. Unique within the LAN and can only be accessed
within the LAN.

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

NAT (Network Address Translation): Required for The following essential features are needed in a
private IP addresses to access the internet directly. computer -
Security: Private IPs are more secure than public Input: Takes in data from the outside world.
IPs since they are not directly accessible on the Output: Displays data for human understanding.
Internet and are hidden by NAT. Primary Storage: Main memory storing critical
Address Range: The range of IP addresses used program instructions and data.
for private IP addressing can never be assigned to Secondary Storage: Non-volatile storage for
public IP addresses. noncritical data.
Removable secondary storage:
File backup and archives
Static vs. Dynamic IP addresses
Portable transfer of files to a second device
Static Dynamic Embedded systems:
Miniature computer systems such as microprocessors
The IP address will change at
IP address never changes. that are often a part of a more extensive system.
regular periods.
Each embedded system performs a few specific
Static IP addresses are valid Dynamic IP address is functions, unlike general-purpose computers.
when websites need to relatively more secure, hence
remember a device for a long used where data privacy is Benefits Drawbacks
time, e.g VPNs whitelisting. quite important. Reliable since there are no Difficult to program functions
Maintaining the cost of the moving parts since there is no interface
Faster upload/download
dynamic IP address is a Expensive expert help is
speeds. Require less power
lesser. needed for the repair
Cheap to mass-produce

URL (Uniform Resource Locator)


Principle Operations of Hardware Devices
Laser printer:
A laser beam and rotating mirrors are used to
draw an image of the page on a photosensitive
drum
The image is converted into an electric charge,
which attracts charged toner such that it sticks to
the image
Electrostatic-charged paper rolled against the
drum
Charge pulls toner away from drum and onto
paper
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
Protocol: Enables the browser to know what protocol is 3D Printer:
used to access information in the domain. The process starts with a saved digital file that
Host-name: The domain name. holds the blueprint of the object to be printed
Location of Server: The path indicating the server location. The object is then built by sequentially adding
Domain Name Service (DNS) layers of a material (e.g. polymer resin) until the
Definition: A naming system used for computers or object created
resources having an internet connection. The object is then cured (e.g. resin-made objects
Structure: Consists of a hierarchy of DNS servers are hardened by UV light)
which have a URL database and their corresponding IP Microphone:
addresses. Incoming sound waves enter the screen and cause
vibrations in the diaphragm
Vibrations cause the coil to move past a magnetic
3. Hardware: Computers and core
Electrical current is generated, which is then
Their Components digitized
Speaker:
A general-purpose computer system comprises a Takes electrical signals and translates them into
processor, memory, and I/O functionality. physical vibrations to create sound waves

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

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

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

No changes were made to the environment by the A B Output


system, and hence, no feedback 1 0 1
Control System:
1 1 1
Regulates the behaviour of other devices or
systems
OR gate: If either input is high, the output is high ( A+B)
Event-driven system: the controller alters the
system's state in response to some event
Time-driven system, where the controller takes
action at a specific point in time
Hardware typically used in a system:
Sensor that measures an (analogue) property and
transmits it to a processing unit, generally as an
electrical or optical signal
Actuators that switch on/off heavy appliances (e.g.
heater to heat/fan to cool)
ADC that 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

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

A B Output Program Counter (PC): holds the address of the


1 1 0 next instruction to be fetched
Memory Data Register (MDR): holds data value
fetched from memory
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
0 1 1 erroneous results of arithmetic performed
1 0 1 The Processor (CPU)
1 1 0 Arithmetic and Logic Unit (ALU): part of the processor
that processes instructions which require some form
XOR gate: ( A ⨁B) \n of arithmetic or logical operation
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
4. Processor Fundamentals set of parallel wires that allow the transfer of data
between components in a computer system
Data bus: bidirectional bus that carries data
4.1. Central Processing Unit (CPU) instructions between processor, memory, and I/O
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
heat generated by higher clock speeds cannot be

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

removed fast enough, which leads to overheating. PC ← [PC] + 1


Bus Width MDR ← [[MAR]]
Determines the number of bits that can be CIR ← [MDR]
simultaneously transferred Decode
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

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

Two pass assembler: software makes 2 passes thru code B denotes a binary number, e.g. B01001010 & denotes a
On the first pass: hexadecimal number, e.g. &4A
Symbol table created to enter symbolic addresses
and labels into specific addresses Modes of Addressing
All errors are suppressed Direct Addressing: loads contents at address into ACC
On the second pass: Indirect Addressing: The address to be used is at given
Jump instructions access memory addresses via address. Load contents of this second address to ACC
table Indexed addressing: form the address to be used as
Whole source code translates into machine code + the contents of the IR (Index Register)
Error reported if they exist Relative addressing: next instruction to be carried out
Grouping the Processor’s Instruction Set is an offset number of locations away, relative to
address of current instruction held in PC; allows for
Op Code Operand Explanation relocatable code
Addressing Conditional jump: has a condition that will be checked
(like using an IF statements)
LDM #n Immediate: Load n into ACC
Unconditional jump: no condition to be followed,
Direct: load contents at simply jump to the next instruction as specified
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
Indexed: load contents of Left shift (LSL #n)
LDX
given address + IR into ACC Bits are shifted to the left to multiply
Data Movement E.g. to multiply by four, all digits shift two places to left
Store contents of ACC into Right shift (LSR #n)
STO Bits are shifted to the right to divide
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
INC division of signed integers represented by bits in the
register
accumulator by ensuring that the sign-bit (usually the
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
CMP #n shift is added to the other end.
with n
Conditional Jumps
Bit Masking
Jump to address if compare
JPE Each bit can represent an individual flag.
TRUE
∴ by altering the bits, flags could be operated upon.
Jump to address if compare Bit manipulation operations:
JPN
FALSE Masking: an operation that defines which bits you
Unconditional Jumps want to keep and which bits you want to clear.
JMP Jump to given address Masking to 1: The OR operation is used with a 1.
I/O Data Masking to 0: The AND operation is used with a 0.
Matching: an operation that allows the
Input any character and store
IN accumulator to compare the value it contains to
ASCII value in ACC
the given value in order to change the state of the
Output character whose status register.
OUT
ASCII value is stored in ACC Practical applications of Bit Masking:
Ending Setting an individual bit position:
Return Control to operating Mask the content of the register with a mask
END
system pattern which has 0 in the ‘mask out’ positions and
1 in the ‘retain’ positions.
#denotes immediate addressing Set the result with the match pattern by using the
AND command with a direct address.

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

Testing one or more bits: E.g. via Round-robin method


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

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

Library file is a complex algorithm which the user Highlights undeclared/unassigned variable
does not need to understand to use it identifiers
Dynamic Link Library (DLL) files Initial Error Detection
Shared library file that contains code and data Dynamic syntax checks: Automatic checking and
Code saved separately from the main .EXE file, highlighting of syntax errors, as soon as line typed
reducing the .EXE file’s size Type checking & parameter checking
Code only loaded to main memory when required Presentation
DDL file can be made available to several applications Prettyprint: Automatic indentation and color-
simultaneously, thus reducing strain on memory coding of keywords
DLL files act as modules in more complex programs, Expand and Collapse code blocks: Saves excessive
making it easier to install and run updates scrolling if collapsed, and easy to see global
variable declarations and main program body
5.2. Language Translators when collapsed
Debugging
Assembler Single stepping: Executes program line-by-line to
Software that translates assembly language see the effect of each statement on variables
statements into machine code (binary) for execution Breakpoints: Pauses program at a specific line to
The mnemonics used translates into machine opcodes ensure program operates correctly up to that line
Process simple because assembly language has a Variables/expressions Report Window: Monitors
one-to-one relationship with machine code. variables for comparing values.
Compiler and Interpreter

Compiler Interpreter 6. Security, Privacy and Data


Translates a high-level
language program to
Translates and executes a
high-level language program,
Integrity
machine code. line-by-line.
Creates a .exe file which can 6.1. Data Security
No .exe file created.
be easily distributed.
Data Security: ensuring data is protected against loss and
Once compiled, .exe file does
Execution very slow – unauthorized access.
not need to be compiled
translated each time program Data Integrity: making sure that data is valid and does not
again, resulting in faster
run. corrupt after transmission
execution.
Data Privacy: ability to determine what data is shared with
Debugging easier/faster, a third party
Reports all errors at the end
since it stops translating when Data Security and Computer System Security
of compilation: difficult to
it reaches an error. This
locate errors∴ development
allows real time error Data Security System Security
process long.
correction. Protection of data on a Protection of the computer
Only be produced when all Can run program any time, computer system system
errors are fixed. even before code finished. To prevent access of viruses
Used when development is To prevent corruption of data
Used during development. to the system and prevent
completed. and prevent hackers from
hackers from entering your
using data
computer system
Two-step translation E.g. encryption E.g. ID & Password
Java and some other high level language programs
may require two-step translation, i.e., they will be Threats to Computer & Data Security
partially compiled and partially interpreted
Malware
Java code first translated to bytecode by Java compiler
software intentionally designed to damage a
Bytecode finally interpreted by the Java Virtual computer or computer network
Machine to produce machine code
Includes Virus & Spyware
Integrated Development Environment (IDE) features Virus: Software that replicates itself by inserting a
Coding
copy of itself into another piece of software, which
Context-sensitive prompts: Displays choice of may cause the computer to crash and can lead to
keywords and available identifiers appropriate at
deletion or corruption of data
current insertion point and provides choices in Spyware: software that gathers information about
alphabetical order
users' online and offline activity, including
accessed sites, applications, and downloaded files.

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

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

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

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

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

Data modeling: analysis of data objects used in database,


identifying relationships among them
Logical schema: overall view of entire database, includes:
entities, attributes and relationships
Data integrity: entire block copied to user’s area when
being changed, saved back when done
Data security: handles password allocation and
verification, backups database automatically, controls
what certain user’s view by access rights of individuals or 8.5. Normalization
groups of users
1st Normal Form (1NF): contains no repeating attribute or
Data change clash solutions:
groups of attributes. Intersection of each tuple and attribute
Open entire database in exclusive mode – impractical with contains only 1 value. Example:
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:

Developer interface: allows creating and manipulating


database in SQL rather than graphically 2nd Normal Form (2NF): it is in 1NF and every non-primary
Query processor: handles high-level queries. It parses, key attribute is fully dependent on the primary; all the
validates, optimizes, and compiles or interprets a query incomplete dependencies have been removed. Example:
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

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL COMPUTER SCIENCE

3rd Normal Form (3NF): it is in 1NF and 2NF and all non-key Query and maintenance of data done using this language
elements are fully dependent on the primary key. No inter- – written in SQL
dependencies between attributes.
Queries:
MANY-TO-MANY functions cannot be directly normalized
Creating a query:
to 3NF, must use a 2 step process e.g.
SELECT <field-name>
FROM <table-name>
WHERE <search-condition>
becomes:
SQL Operators:

= Equals to
8.6. Data Definition Language (DDL) > Greater than
< Less than
Creation/modification of the database structure using this
>= Greater than or equal to
language
<= Less than or equal to
written in SQL
Creating a database: <> Not equal to
IS NULL Check for null values
CREATE DATABASE <database-name>
Sort into ascending order:
Creating a table:
ORDER BY <field-name>
CREATE TABLE <table-name> (…)
Arrange identical data into groups:
Changing a table:

ALTER TABLE <table-name> GROUP BY <field-name>

Joining together fields of different tables:


Adding a primary key:
INNER JOIN
PRIMARY KEY (field)
ADD <field-name>:<data-type> Data Maintenance:
Adding a foreign key: Adding data to table:
FOREIGN KEY (field) REFERENCES <table>(field) INSERT INTO <table-name>(field1, field2, field3)
VALUES (value1, value2, value3)
Example:
Deleting a record:
CREATE DATABASE ‘Personnel.gdb’
CREATE TABLE Training DELETE FROM <table-name>
(EmpID INT NOT NULL, WHERE <condition>
CourseTitle VARCHAR(30) NOT NULL,
CourseDate Date NOT NULL, Updating a field in a table:
PRIMARY KEY (EmpID, CourseDate),
FOREIGN KEY (EmpID) REFERENCES Employee(EmpID)) UPDATE <table-name>
SET <field-name> = <value>
WHERE <condition>
8.7. Data Manipulation Language (DML)

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Danial Kashif at undefined on 12/09/24.
CAIE AS LEVEL
Computer Science

© ZNotes Education Ltd. & ZNotes Foundation 2024. All rights reserved.
This version was created by Danial Kashif on 12/09/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