Professional Documents
Culture Documents
CAIE AS Level Computer Science 9618 Theory v1 Z-Notes
CAIE AS Level Computer Science 9618 Theory v1 Z-Notes
ORG
CAIE AS LEVEL
COMPUTER
SCIENCE (9618)
SUMMARIZED NOTES ON THE THEORY SYLLABUS
CAIE AS LEVEL COMPUTER SCIENCE (9618)
Concatenate the 3 nibbles (4-bit group) to produce BCD: 0100 2 or 4 times more
Smaller storage
0010 1001 storage space per
space.
character.
Practical applications
A string of digits on any electronic device displaying
numbers (eg. Calculators)
1.2. Multimedia
Accurately measuring decimal fractions
Bitmap Images
Electronically coding denary numbers
Data for a bitmapped image is encoded by assigning a
Two’s Complement
solid colour to each pixel, i.e., through bit patterns.
We can represent a negative number in binary by
Bit patterns are generated by considering each row of
making the most significant bit (MSB) a sign bit, which
the grid as a series of binary colour codes which
indicates whether the number is positive or negative.
correspond to each pixel’s colour.
Converting negative denary into binary (ex. -42)
These bit patterns are ‘mapped’ onto main memory
Find the binary equivalent of the denary number
Pixels: smallest picture element whose colour can be
(ignoring the -ve sign) | 42 = 101010
accurately represented by binary
Add extra 0 bits before the MSB, to format binary number
Bitmap image also contains the File Header which
to 8 bits | 00101010
has the metadata contents of the bitmap file,
Convert binary number to one’s complement (flip the
including image size, number of colours, etc.
bits) | 11010101
Image Resolution
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
Client-server Model
Server based network: dedicated server provides an
application (administration of users, security and
resources) for the client computer to utilize
Client-server Applications
Printer: manages print jobs from client computers
File Sharing: the client accesses software and user’s
data files stored on the server
Proxy server
Email server: for sending, receiving & storing emails
Database server: manages DBMS
Domain controller server
Management of user accounts (IDs & passwords)
Client sends login request to server which
processes and grants request if user ID &
password recognized
Thin Clients vs. Thick Clients Single line (bus) connecting all devices with
terminators at each end.
Thin Clients Thick Clients Other computers can read the data being sent
from one to another computer.
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
Benefits Drawbacks
Can travel over large
Consists of a central server (‘Switch’) and all other distances since they Low frequency so
computers connected with a dedicated connection have largest range of transmits less data at
to each, hence server can send packets to Radio
wavelengthRelatively one time.Affected by
different devices simultaneously and bi- waves
inexpensive.Used for TV radio stations with
directionally. signals & mobile phone similar frequency
No collisions possible. comms.
Mesh
Emitting towers
Network setup where every device (node) is Larger bandwidth, can
Micro- expensive to
directly interconnected to the each of the other transfer more data at a
waves build Physical obstacles
devices (nodes) time
can interfere
Cheap with long
Easy to
distanceUsed for
Satellites interfereExpensive set
Satellite phones,
up
satellite radio broadcast
Ethernet
Most common wired medium of transmission, that
can be used to transfer data between LANs or WANs
Usually used in bus topology; since all data travelled
on a single wire there is a possibility of data
corruption by the “collision” of signals
This collision is prevented by the CSMA/CD (Carrier
Sense Multiple Access Collision Detection) method:
Before transmitting, device checks if channel is
busy
It is commonly used for wireless networks (such as If busy, device calculates a random wait time and
the Internet), via the mesh connection of routers waits that time, after which it begins transmission
Hybrid Then during transmission, the device listens for
Combination of two or more topologies. other devices also beginning transmission
E.g. when there is a connection between 2 or If collision, transmission is aborted and both
more LANs of different topologies devices wait different random times, then tried
Wired Networks: use (copper (twisted-pair cable or again
coaxial cable) or fibre-optic) cables connected to an Bit Streaming
Ethernet port on the network router Sequence of digital signals (bits) transferred over a
communication path at high speeds
Benefits Drawbacks Requires a fast broadband connection and some form
of buffers (short-term memory)
Bits arrive in the same order they are sent
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
naming system used for computers or resources Object is then cured (e.g. resin-made objects are
having internet connection hardened by UV light)
Consists of a hierarchy of DNS servers which have a Microphone
URLs database of and their corresponding IP Incoming sound waves enter wind screen and
addresses cause vibrations about a diaphragm
Vibrations cause coil to move past a magnetic core
Electrical current generated which is then digitized
3. Hardware Speaker
Takes electrical signals and translates into physical
3.1. Computers and their components vibrations to create sound waves
Electric current in voice coil generates an
General-purpose computer system consists of a electromagnetic field
processor, memory, I/O functionality. Change in digital audio signal causes current
Understanding the need for direction to change which changes field polarity
Input: take in data from the outside world Electromagnet is either attracted or repelled to a
Output: display data for humans’ understanding permanent magnet, causing a diaphragm that is
Primary storage: computer’s main memory which attached to the coil to vibrate
stores a set of critical program’s instructions & data Vibration transmitted to air in front of speaker
Secondary storage: non-volatile storage for noncritical Degree of vibration determines amplitude and
data that will not be frequently accessed frequency of sound wave produced
Removable secondary storage: Magnetic Hard Disk
File backup and archive Hard disk has platters whose surfaces are covered
Portable transfer of files to second device with a magnetisable material.
Embedded systems Platters are mounted on central spindle and rotated
Small computer systems such as microprocessors at high-speed
that are often a part of a larger system Surface of platters divided into concentric tracks &
Each embedded system performs a few specific sectors, where data is encoded as magnetic patterns
functions unlike general-purpose computers Each surface is accessed by read/write heads
When writing, current variation in head causes
benefits drawbacks magnetic field variation on disk
Difficult to program functions When reading, magnetic field variation from disk
Reliable since there are no produces current variation in read head
since there is either no
moving parts Solid State (Flash) Memory
interface
Most use NAND-based flash memory
Expensive expert help
Require less power Consist of a grid of columns & rows that has 2
needed for repair
transistors at each intersection
Cheap to mass-produce Two transistors:
Floating Gate: stores electros and the presence or
Principle Operations of Hardware Devices absence of charge (electrons) represents either 1 or 0
Laser printer Control Gate: controls charge (electrons) flow for
A laser beam and rotating mirrors are used to read/write
draw image of the page on a photosensitive drum Optical Disc Reader/Writer
Image converted into electric charge which Disc surface has reflective metal layer and is spun
attracts charged toner such that it sticks to image Tracking mechanism moves laser assembly
Electrostatic charged paper rolled against drum Lens focuses laser onto disc
Charge pulls toner away from drum and onto Laser beam shone onto disc to read/write
paper Tracks have sequences of amorphous and crystalline
Heat applied in the fuser to fuse toner to the states on the metallic layer
paper When reading, the reflected light from the different
Electrical charge removed from drum and excess states on the track are encoded as bit patterns
toner collected When writing, laser changes surface to crystalline and
3D printer amorphous states along the track, which correspond
Process starts from saved digital file that holds the to 1s or 0s.
blueprint of object to be printed Touchscreen
Object is then built by sequentially adding layers Considered as both an input & output device
of a material (e.g. polymer resin) until object 2 types:
created
Resistive capacitive
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
Types of RAM - Static RAM vs. Dynamic RAM 3.2. Logic Gates and Logic Circuits
sram dram Logic Gates: use one or more inputs and produces a
Doesn’t need to refresh Has to be refreshed, hence single logical output
hence uses less power and has slower access times and AND gate: If both inputs high, output is high (A•B)
faster access time needs higher power
A B Output
Only single transistor &
More complex circuitry, 0 0 0
capacitor, hence less
hence more expensive
expensive to purchase 0 1 0
Each bit stored in flip-flop Each bit stored as a charge 1 0 0
Has lower data density Has higher data density 1 1 1
Used in cache memory Used in main memory
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
Address bus: unidirectional bus that carries Can only connect output devices (e.g. second
address of main memory location or input/output monitor/display) to the processor through a VGA
device about to be used, from processor to port
memory address register (MAR) VGA ports allows only the transmission of video
Control bus streams, but not audio components
Bidirectional and unidirectional Fetch-Execute (F-E) cycle
used to transmit control signals from control unit Fetch stage
to ensure access/use of data & address buses by PC holds address of next instruction to be fetched
components of system does not lead to conflict Address in PC is copied to MAR
Performance of Computer System Factors PC is incremented
Clock Speed Instruction loaded to MDR from address held in
number of pulses the clock sends out in a given MAR
time interval, which determines the number of Instruction from MDR loaded to CIR
cycles (processes) CPU executes in a given time Decode stage: The opcode and operand parts of
interval instruction are identified
usually measured in Gigahertz (GHz) Execute stage: Instructions executed by the control
If the clock speed is increased, then execution unit sending control signals
time for instructions decreases. Hence, more Register Transfer Notation (RTN)
cycles per unit time, which increases performance. MAR ← [PC]
However, there is a limit on clock speed since the PC ← [PC] + 1
heat generated by higher clock speeds cannot be MDR ← [[MAR]]
removed fast enough, which leads to overheating CIR ← [MDR]
Bus Width Decode
Determines number of bits that can be Execute
simultaneously transferred Return to start
Refers to number of lines in a bus Square brackets: value currently in that register
Increasing bus width increases number of bits Double square brackets: CPU is getting value
transferred at one time, hence increasing stored at the address in the register
processing speed and performance since there Interrupts
Cache Memory A signal from a program seeking processor’s attention
Commonly used instructions are stored in the Interrupt Service Routine (ISR):
cache memory area of the CPU. Handles the interrupt by controlling the processor
If cache memory size is increased, more Different ISRs used for different sources of
commonly executed instructions can be stored interrupt
and the need for the CPU to wait for instructions Typical sequence of actions when interrupt occurs:
to be loaded reduces, hence CPU executes more The processor checks interrupt register for interrupt
cycles per unit time, thus improving performance at the end of the F-E cycle for the current instruction
Number of Cores If the interrupt flag is set in the interrupt register, the
Most CPU chips are multi-core — have more than interrupt source is detected
one core (essentially a processor) If interrupt is low priority: then interrupt is disabled
Each core simultaneously processes different If interrupt is high priority:
instructions through multithreading, improving All contents of registers of the running process are
computer performance saved on the stack
Ports PC is loaded with the ISR, and is executed
Hardware which provides a physical interface Once ISR is completed, the processor restores
between a device with CPU and a peripheral device registers’ contents from the stack, and the
Peripheral (I/O) devices cannot be directly connected interrupted program continues its execution
to CPU, hence connected through ports Interrupts re-enabled and
Universal Serial Bus (USB): Can connect both input Return to start of cycle
and output devices to processor through a USB port
High Definition Multimedia Interface (HDMI) 4.2. Assembly Language
Can only connect output devices (e.g. LCD display)
to the processor through a HDMI port Assembly language: low-level programming language with
HDMI cables transmit high-bandwidth and high- instructions made up of an op code and an operand
resolution video & audio streams through HDMI Machine code: code written in binary that uses the
ports processor’s basic machine operations
Video Graphics Array (VGA) Relationship between machine and assembly language:
every assembly language instruction (source code)
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
translates into exactly one machine code instruction Op Code Operand Explanation
(object code) Jump to address if compare
Symbolic addressing JPN
FALSE
Symbols used to represent operation codes
Unconditional Jumps
Labels can be used for addresses
Absolute addressing: a fixed address in memory JMP Jump to given address
Assembler I/O Data
Software that changes assembly language into Input any character and
machine code for the processor to understand IN
store ASCII value in ACC
The assembler replaces all mnemonics and labels with Output character whose
their respective binary values (that are predefined OUT
ASCII value is stored in ACC
before by the assembler software)
Ending
One pass assembler
Assembler converts mnemonic source code into Return Control to operating
END
machine code in one sweep of program system
Cannot handle code that involves forward referencing
Two pass assembler: software makes 2 passes thru code #denotes immediate addressing
On the first pass: B denotes a binary number, e.g. B01001010
& denotes a
Symbol table created to enter symbolic addresses hexadecimal number, e.g. &4A
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
Jump instructions access memory addresses via
given address. Load contents of this second address
table
to ACC
Whole source code translates into machine code
Indexed addressing: form the address to be used as
Error reported if they exist
+ the contents of the IR (Index Register)
Grouping the Processor’s Instruction Set
Relative addressing: next instruction to be carried out
Op Code Operand Explanation is an offset number of locations away, relative to
address of current instruction held in PC; allows for
Adressing
relocatable code
LDM #n Immediate: Load n into ACC Conditional jump: has a condition that will be checked
Direct: load contents at (like using an IF statements)
LDD
address into the ACC Unconditional jump: no condition to be followed,
Indirect: load contents of simply jump to the next instruction as specified
LDI address at given address
into ACC 4.3. Bit Manipulation
Indexed: load contents of
LDX
given address + IR into ACC Binary numbers can be multiplied or divided by shifting
Data Movement Left shift (LSL #n)
Bits are shifted to the left to multiply
Store contents of ACC into
STO E.g. to multiply by four, all digits shift two places to left
address
Right shift (LSR #n)
Arithmetic Bits are shifted to the right to divide
Operations
E.g. to divide by four, all digits shift two places to right
Add contents of register to Logical shift: zeros replace the vacated bit position
ADD
ACC
Add 1 to contents of the
INC
register
Comparing
Compare contents of ACC
CMP
with that of given address
Compare contents of ACC
CMP #n
with n
Conditional Jumps
Jump to address if compare
JPE
TRUE
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
5. System Software
5.1. Operating System
Need for OS
A set of programs designed to run in the background
on a computer system which
Controls operation of computer system
Provides a user interface
Cyclic shift: the bit that is removed from one end by the
Controls how computer responds to user’s
shift is added to the other end.
requests
Controls how hardware communicate
Provides an environment in which application
software can be executed
OS hardware is unusable without an OS, as the OS
acts as an interface since it controls communication
between user and hardware
Key Management Tasks
(Main) Memory Management
Memory protection to ensure 2 programs do not
try to use same memory space
Paging
Use of virtual memory
Bit Masking
File Management
Each bit can represent an individual flag.
Provides file naming conventions
∴ by altering the bits, flags could be operated upon.
Maintains a directory structure
Bit manipulation operations:
Allocates space to particular files
Masking: an operation that defines which bits you
Security Management
want to keep and which bits you want to clear.
Proves usernames & passwords
Masking to 1: The OR operation is used with a 1.
Ensures data privacy
Masking to 0: The AND operation is used with a 0.
Prevents unauthorized access
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
partially compiled and partially interpreted Data management: data stored in relational databases -
Java code first translated to bytecode by Java compiler tables
stored in secondary storage
Bytecode finally interpreted by the Java Virtual Data dictionary contains:
Machine to produce machine code List of all files in database
Integrated Development Environment (IDE) features No. of records in each file
Coding Names & types of each field
Context-sensitive prompts: Displays choice of Data modeling: analysis of data objects used in database,
keywords and available identifiers appropriate at identifying relationships among them
current insertion point and provides choices in Logical schema: overall view of entire database, includes:
alphabetical order entities, attributes and relationships
Highlights undeclared/unassigned variable Data integrity: entire block copied to user’s area when
identifiers being
changed, saved back when done
Initial Error Detection Data security: handles password allocation and
Dynamic syntax checks: Automatic checking and verification,
backups database automatically, controls
highlighting of syntax errors, as soon as line typed what certain user’s view by
access rights of individuals or
Type checking & parameter checking groups of users
Presentation
Prettyprint: Automatic indentation and color- Data change clash solutions:
coding of keywords
Open entire database in exclusive mode – impractical
Expand and Collapse code blocks: Saves excessive
with
several users
scrolling if collapsed, and easy to see global
Lock all records in the table being modified – one user
variable declarations and main program body
changing
a table, others can only read table
when collapsed
Lock record currently being edited – as someone changes
Debugging
something, others can only read record
Single stepping: Executes program line-by-line to
User specifies no locks – software warns user of
see the effect of each statement on variables
simultaneous
change, resolve manually
Breakpoints: Pauses program at a specific line to
Deadlock: 2 locks at the same
time, DBMS must
ensure program operates correctly up to that line
recognize, 1 user must abort task
Variables/expressions Report Window: Monitors
variables for comparing values. Tools in a DBMS:
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
6.5. Normalization
2nd Normal Form (2NF): it is in 1NF and every non-primary 3rd Normal Form (3NF): it is in 1NF and 2NF and all
non-key
key attribute is fully dependent on the primary; all the elements are fully dependent on the primary key. No
inter-
dependencies between attributes.
incomplete
dependencies have been removed. Example:
MANY-TO-MANY functions cannot be directly normalized
to 3NF, must
use a 2 step process e.g.
becomes:
Creating a table:
Changing a table:
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
ADD <field-name>:<data-type>
WHERE <condition>
Computer Ethics
FOREIGN KEY (EmpID) REFERENCES Employee(EmpID))
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
they adapt to stop the same problem occurring Spyware: software that gathers information about
again user’s online and offline activity including accessed
they learn to predict what might happen & raise sites, applications, and downloaded files.
alert Risk restriction: Ensure anti-virus and anti-spyware
AI can learn to work more efficiently software is installed, regularly updated and run.
when an action slows the system down, it can Hacking
prevent this from happening again illegal access to a computer system
when an action increases the speed of the system, Hackers can obtain user’s confidential data which
it can repeat this when necessary to improve can cause identity theft
efficiency Can lead to deletion or corruption of data
AI Applications Risk restriction: Use strong passwords and ensure
Developing autonomous mechanical products firewall
Machine learning through data sets Phishing
AI Impacts Attempt through emails to obtain user’s
Social confidential data which can cause identity theft
Replacement of manual labour with automation Risk restriction: Ignore suspicious mails and
could lead to massive unemployment ensure firewall criteria include SPAM filters,
However, could lead to increased leisure time blacklist, etc.
Economic: Due to increased innovation and efficiency Pharming
with automation provided by AI, there’d be lower Redirects user to a fake website that appears
manufacturing costs in general legitimate to gain confidential data
Environmental: Detrimental impact on environment Risk restriction: use a reliable ISP; check that links
due to robot manufacture with limited resources and are genuine and ensure https is present in the
its waste disposal URL
Computer System Security Measures
User Accounts and Passwords
8. Data Integrity Usernames & passwords to deny access to
unauthorized users
User assigned privilege which access to only the
8.1. Data Security
user’s workplace, preventing the user to have
Data Security: making sure that data is protected against admin rights.
loss and unauthorized access. Can assign privilege to files so users with low
Data Integrity: making sure that data is valid and does not privileges do not have access.
corrupt after transmission Firewalls
Data Privacy: ability to determine what data is shared Hardware or software that filters information
with a third party traveling between the computer system and the
Data Security and Computer System Security internet
(software) firewall can make decisions about what
Data Security System Security to allow and block by detecting illegal attempts by
specific softwares to connect to the internet
Protection of data on a Protection of the computer
computer system system Authentication ⦁ Process of determining whether
someone is who they claim to be
To prevent access of viruses
To prevent corruption of data
to the system and prevent ⦁Helps prevent unaut
and prevent hackers from
hackers to enter your
using data
computer system ⦁Log-on using digita
E.g. encryption E.g. ID & Password
Anti-virus software
Runs in background to detect & remove viruses.
Threats to Computer & Data Security
Checks files for known malicious patterns
Malware
Anti-spyware software: detects & removes spyware.
software intentionally designed to damage a
Encryption:
computer or computer network
Conversion of data to code by encoding it
Includes Virus & Spyware
Doesn’t stop illegal access but appears
Virus: Software that replicates itself by inserting a
meaningless
copy of itself into another piece of software, which
Necessary to use decryption software to decode
may cause computer to crash and can lead to
data
deletion or corruption of data
Data Security Measures
Encryption
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
Access Rights to data (authorization): different Data Verification: checks data entered is accurate during
users assigned different authorization levels which data entry and data transfer
prevent them from accessing all data ∴ increases Data Entry Verification Methods
security Visual Check: Person manually compares original data
Data Backup with that entered to check if correct
An exact copy of an original piece of data in case Double Entry: Enter data into computer twice and
the original is lost or corrupted compares.
Within the same computer system or at different If differences found, go back to raw data to fix error
site Data Transfer Verification Methods
Disk-mirroring strategy Errors may occur when data moved in system.
Real-time strategy that writes data to two or more Parity Check
disks at the same time. All data transmitted as bits
If one fails, the other is still there to be read off of Number of 1s in a byte must always be either an
odd number or an even number
8.2. Data Integrity Parity can be set either as even or odd
E.g. two communicating devices decide there will
Data validation and data verification help protect the always be an odd number of 1s. A byte is received
integrity of data by checking whether the data entered is that has even number of 1s so error occurred and
sensible and accurate, respectively. receiving device would ask for it to be sent again
Data Validation: checks if data entered is valid, but not its Used also when data sent between parts of the
accuracy CPU
Data Validation Methods Not foolproof: if 2 bits are transposed, data
Range check: data must be between a set of values accepted
Format check: data must follow correct pattern/order Checksum Check
Length check: data must have exact no. of characters Data sent from one place to another as block of
Presence check: checks if some data has been bytes rather than individual bytes
entered Computer adds together all bytes being sent
Existence check: data entered must exist Any bits lost at most-significant end as carry
Limit check: checks whether a value entered is within ignored so answer is an 8-bit number
acceptable minimum and maximum values. Checksum calculated before and after data sent
Check digit: A digit is used as the answer to an If two bytes different, error occurred therefore
arithmetic operation of other digits in data. If not block of bytes must be sent again
matched, then data entered incorrectly
WWW.ZNOTES.ORG
CAIE AS LEVEL
Computer Science (9618)