Caie As Computer Science 9618 Theory v3
Caie As Computer Science 9618 Theory v3
ORG
CAIE AS LEVEL
COMPUTER
SCIENCE (9618)
SUMMARIZED NOTES ON THE 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 (ignoring
Pixels: smallest picture element whose colour can be
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 bits)
including image size, number of colours, etc.
| 11010101
Image Resolution
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
File accuracy/quality lower than that of lossless but file Thin Clients Thick Clients
size is lower (~10% of lossless).
A client that solely runs on the
E.g. Sound files (.mp3), .jpeg images An independent client that
resources provided by the
Sound files compression (.mp3) utilizes Perceptual does not require the server to
server and has no local
Coding to remove certain parts of sound that are less run
storage
audible/discernible to human hearing.
Only provides input and
Thick client processes most of
receives output; processing
the application
2. Communication done by server
Smaller purchase cost:
Can function even if no server
expensive, demanding
2.1. Networks including the Internet hardware is not required
is connected (works offline)
Networking devices are interconnected devices that allow Improved security: cannot run
No lag related to network
a fast means of data transmission within the network. unauthorized, harmful
problems
Networking benefits: software
File sharing - you can easily share data between
different interconnected devices Peer-to-peer network model (P2P)
Resource sharing - using network-connected output Decentralised network where each connected
devices like printers, or can share the same software computer stores data and operates independently as
within the network a ‘peer’, and can act as both a client & server.
Higher storage - can store files in network-connected Applications: Internet and Ad hoc networks
storage mediums. Client-server vs. Peer-to-peer models
LAN(Local Area Network) vs. WAN(Wide Area Network)
Client-server Peer-to-peer
LAN WAN Centralized backup Lesser initial setup cost
Network that connects Network that connects Lesser network traffic: each
Files & resources centralized
devices within a small devices within a larger peer can simultaneously
in server: prevents illegal
geographical area geographical area receive data from different
resource usage
Only private ownership Private or public ownership sources
Transmission medium: Improved security: files are Can work even if a device
Transmission medium: PSTN stored on central server goes down, but Client-server
twisted pair cable, coaxial
or satellite link which would be regularly model can’t work if server
cable or Wi-Fi
Higher data transfer rate Lower data transfer rate scanned for malware goes down
Thin Clients Thick Clients Single line (bus) connecting all devices with
terminators at each end.
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)
Consists of a hierarchy of DNS servers which have a Vibrations cause coil to move past a magnetic core
URLs database of and their corresponding IP Electrical current generated which is then digitized
addresses Speaker
Takes electrical signals and translates into
physical vibrations to create sound waves
3. Hardware Electric current in voice coil generates an
electromagnetic field
3.1. Computers and their components Change in digital audio signal causes current
direction to change which changes field polarity
General-purpose computer system consists of a Electromagnet is either attracted or repelled to a
processor, memory, I/O functionality. permanent magnet, causing a diaphragm that is
Understanding the need for attached to the coil to vibrate
Input: take in data from the outside world Vibration transmitted to air in front of speaker
Output: display data for humans’ understanding Degree of vibration determines amplitude and
Primary storage: computer’s main memory which frequency of sound wave produced
stores a set of critical program’s instructions & data Magnetic Hard Disk
Secondary storage: non-volatile storage for noncritical Hard disk has platters whose surfaces are covered
data that will not be frequently accessed with a magnetisable material.
Removable secondary storage: Platters are mounted on central spindle and rotated at
File backup and archive high-speed
Portable transfer of files to second device Surface of platters divided into concentric tracks &
Embedded systems sectors, where data is encoded as magnetic patterns
Small computer systems such as microprocessors Each surface is accessed by read/write heads
that are often a part of a larger system When writing, current variation in head causes
Each embedded system performs a few specific magnetic field variation on disk
functions unlike general-purpose computers When reading, magnetic field variation from disk
produces current variation in read head
benefits drawbacks Solid State (Flash) Memory
Difficult to program functions Most use NAND-based flash memory
Reliable since there are no Consist of a grid of columns & rows that has 2
since there is either no
moving parts transistors at each intersection
interface
Two transistors:
Expensive expert help needed
Require less power Floating Gate: stores electros and the presence or
for repair
absence of charge (electrons) represents either 1 or 0
Cheap to mass-produce Control Gate: controls charge (electrons) flow for
read/write
Principle Operations of Hardware Devices Optical Disc Reader/Writer
Laser printer Disc surface has reflective metal layer and is spun
A laser beam and rotating mirrors are used to Tracking mechanism moves laser assembly
draw image of the page on a photosensitive drum Lens focuses laser onto disc
Image converted into electric charge which Laser beam shone onto disc to read/write
attracts charged toner such that it sticks to image Tracks have sequences of amorphous and crystalline
Electrostatic charged paper rolled against drum states on the metallic layer
Charge pulls toner away from drum and onto When reading, the reflected light from the different
paper states on the track are encoded as bit patterns
Heat applied in the fuser to fuse toner to the paper When writing, laser changes surface to crystalline and
Electrical charge removed from drum and excess amorphous states along the track, which correspond
toner collected to 1s or 0s.
3D printer Touchscreen
Process starts from saved digital file that holds the Considered as both an input & output device
blueprint of object to be printed 2 types:
Object is then built by sequentially adding layers of
a material (e.g. polymer resin) until object created Resistive capacitive
Object is then cured (e.g. resin-made objects are Consists of two charged Made from materials that
hardened by UV light) plates store electric charge
Microphone
Pressure causes plates to When touched, charge
Incoming sound waves enter wind screen and
touch, completing circuit transferred from finger
cause vibrations about a diaphragm
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
sram dram
3.2. Logic Gates and Logic Circuits
Doesn’t need to refresh hence Has to be refreshed, hence Logic Gates: use one or more inputs and produces a
uses less power and faster has slower access times and single logical output
access time needs higher power AND gate: If both inputs high, output is high ( A•B)
Only single transistor &
More complex circuitry, hence
capacitor, hence less A B Output
more expensive
expensive to purchase 0 0 0
Each bit stored in flip-flop Each bit stored as a charge 0 1 0
Has lower data density Has higher data density 1 0 0
Used in cache memory Used in main memory 1 1 1
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
device about to be used, from processor to VGA ports allows only the transmission of video
memory address register (MAR) streams, but not audio components
Control bus Fetch-Execute (F-E) cycle
Bidirectional and unidirectional Fetch stage
used to transmit control signals from control unit PC holds address of next instruction to be fetched
to ensure access/use of data & address buses by Address in PC is copied to MAR
components of system does not lead to conflict PC is incremented
Performance of Computer System Factors Instruction loaded to MDR from address held in
Clock Speed MAR
number of pulses the clock sends out in a given Instruction from MDR loaded to CIR
time interval, which determines the number of Decode stage: The opcode and operand parts of
cycles (processes) CPU executes in a given time instruction are identified
interval Execute stage: Instructions executed by the control
usually measured in Gigahertz (GHz) unit sending control signals
If the clock speed is increased, then execution time Register Transfer Notation (RTN)
for instructions decreases. Hence, more cycles per MAR ← [PC]
unit time, which increases performance. PC ← [PC] + 1
However, there is a limit on clock speed since the MDR ← [[MAR]]
heat generated by higher clock speeds cannot be CIR ← [MDR]
removed fast enough, which leads to overheating Decode
Bus Width Execute
Determines number of bits that can be Return to start
simultaneously transferred Square brackets: value currently in that register
Refers to number of lines in a bus Double square brackets: CPU must do a logical
Increasing bus width increases number of bits process and then copy this value
transferred at one time, hence increasing Interrupts
processing speed and performance since there A signal from a program seeking processor’s
Cache Memory 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 and interrupt
the need for the CPU to wait for instructions to be Typical sequence of actions when interrupt occurs:
loaded reduces, hence CPU executes more cycles The processor checks interrupt register for interrupt
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
HDMI cables transmit high-bandwidth and high- with 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:
Can only connect output devices (e.g. second every assembly language instruction (source code)
monitor/display) to the processor through a VGA translates into exactly one machine code instruction
port (object code)
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
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 OR 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)
Java code first translated to bytecode by Java compiler Source code of an open-source software is readily
Bytecode finally interpreted by the Java Virtual available to users under a copyright; does not
Machine to produce machine code enable user to re-distribute the software
Integrated Development Environment (IDE) features Concept of open-source program relies on fact
Coding that user can review source-code for eliminating
Context-sensitive prompts: Displays choice of bugs in it
keywords and available identifiers appropriate at Shareware:
current insertion point and provides choices in Demonstration software that is distributed for free
alphabetical order but for a specific evaluation period only
Highlights undeclared/unassigned variable Distributed on trial basis and with an
identifiers understanding that sometime later a user may be
Initial Error Detection interested in paying for it
Dynamic syntax checks: Automatic checking and Used for marketing purposes
highlighting of syntax errors, as soon as line typed Commercial: Requires payment before it can be used,
Type checking & parameter checking but includes all program's features, with no
Presentation restrictions
Prettyprint: Automatic indentation and color- Artificial Intelligence (AI): ability of a computer to perform
coding of keywords tasks in such a way that are conventionally associated
Expand and Collapse code blocks: Saves excessive with human intelligence:
scrolling if collapsed, and easy to see global AI can learn from past mistakes
variable declarations and main program body they adapt to stop the same problem occurring
when collapsed again
Debugging they learn to predict what might happen & raise
Single stepping: Executes program line-by-line to alert
see the effect of each statement on variables AI can learn to work more efficiently
Breakpoints: Pauses program at a specific line to when an action slows the system down, it can
ensure program operates correctly up to that line prevent this happening again
Variables/expressions Report Window: Monitors when an action increases the speed of the system,
variables for comparing values. it can repeat this when necessary to improve
efficiency
AI Applications
6. Ethics and Ownership Developing autonomous mechanical products
Machine learning through data sets
Ethics: a system of moral principles that guide behaviour AI Impacts
based on philosophical views Social
Computer Ethics Replacement of manual labour with automation
Regulate how computing professionals should make could lead to massive unemployment
decisions regarding professional & social conduct. However, could lead to increased leisure time
A computing professional can be ethically guided by Economic: Due to increased innovation and efficiency
joining a professional ethical body such as the BCS with automation provided by AI, there’d be lower
and IEEE, which have codes of conduct. manufacturing costs in general
Ownership Environmental: Detrimental impact on environment
Data ownership: having legal rights and complete due to robot manufacture with limited resources and
control over a single piece or set of data elements. its waste disposal
Copyright gives the creators of some types of media
rights to control how they're used and distributed.
Programming ideas and methods can be stolen by 7. Database and Data
competitors, software can easily be copied and
bootlegged (sold illegally) hence legislation is needed Modelling
to protect the ownership, usage and copyright of data.
Software Licencing
7.1. File Based System
Free Software Foundation:
License gives user freedom to run, copy, distribute,
Data stored in discrete files, stored on computer, and can
study, change and improve software.
be
accessed, altered or removed by the user
Condition: any redistributed version of software
must be distributed with original terms of free use, Disadvantages of File Based System:
modification, and distribution (aka copyleft)
The Open Source Initiative: No enforcing control on organization/structure of files
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
Data repeated in different files; manually change each Tuple: a row or a record in a relation
Sorting must be done manually or must write a program Attribute: a field or column in a relation
Data may be in different format; difficult to find and use Primary key: attribute or combination of them that
Impossible for it to be multi-user; chaotic uniquely
define each tuple in relation
Security not sophisticated; users can access everything Candidate key: attribute that can potentially be a primary
key
7.2. Database Management Systems Foreign key: attribute or combination of them that relates
2
different tables
(DBMS) Referential integrity: prevents users or applications from
entering inconsistent data
Database: collection of non-redundant interrelated data Secondary key: candidate keys not chosen as the primary
DBMS: Software programs that allow databases to be key
defined,
constructed and manipulated Indexing: creating a secondary key on an attribute to
provide
fast access when searching on that attribute;
Features of a DBMS:
indexing data must be
updated when table data changes
Data management: data stored in relational databases -
tables
stored in secondary storage 7.4. Relational Design of a System
Data dictionary contains:
List of all files in database
No. of records in each file
Names & types of each field
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 7.5. Normalization
Data security: handles password allocation and
verification,
backups database automatically, controls 1st Normal Form (1NF): contains no repeating attribute or
what certain user’s view by
access rights of individuals or
groups of attributes. Intersection of each tuple and attribute
groups of users
contains
only 1 value. Example:
Data change clash solutions:
Tools in a DBMS: 2nd Normal Form (2NF): it is in 1NF and every non-primary
key attribute is fully dependent on the primary; all the
Developer interface: allows creating and manipulating incomplete
dependencies have been removed. Example:
database
in SQL rather than graphically
Query processor: handles high-level queries. It parses,
validates, optimizes, and compiles or interprets a query
which
results in the query plan.
WWW.ZNOTES.ORG
CAIE AS LEVEL COMPUTER SCIENCE (9618)
Example:
Queries:
Creating a query:
SELECT <field-name>
FROM <table-name>
WHERE <search-condition>
Creating a database:
Joining together fields of different tables:
CREATE DATBASE <database-name>
INNER JOIN
Creating a table:
Data Maintenance:
CREATE TABLE <table-name> (…)
ADD <field-name><data-type>
Deleting a record:
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)