P1 Definitions
P1 Definitions
★ anything bold and italic has not been asked yet, and the information is usually taken directly from
the mark scheme of the old syllabus
1. Data Representation
BCD
Benefits of BCD
● more straight forward to convert between BCD and denary
● less complex to encode and decode for programmers
● easier for digital equipment to use BCD to display information
● can represent monetary values exactly
Applications of BCD
• electronic displays e.g. calculators, digital clocks – only need to show individual digits, conversion between
denary and BCD is easier
• storage of date and time in BIOS of PC – conversion with denary is easier
Hexadecimal
Applications of Hexadecimal
● MAC addresses
● HTML colour codes
● can also be used to refer to memory addresses in assembly language and in machine code
ASCII
ASCII Representation
● each character has a unique code
● character is replaced by its corresponding code
● codes are stored in the same order as in the word
Bitmap Graphic
Pixel
● The smallest addressable element in an image
File header
● Stores data (metadata) about the bitmap image (e.g. colour depth, image resolution)
● Can store: file type, compression type, dimensions (width x height), file size
Image Resolution
● Total number of pixels in an image (number of pixels wide * number of pixels high)
● Increasing resolution – more pixels can be stored, image is sharper/less pixelated
Bit depth/Colour depth
● The number of bits used to represent each colour // number of bits per pixel
● Determines number of colours that can be represented in an image
● Increase in bit depth – image has greater range of colours and is closer to original (leads to increased file
size)
Vector Graphic
● stores set of instructions about how to draw the shape
● does not pixelate when scaled/enlarged
● individual components of image can be edited
● smaller file size – contains just instructions
● do not compress well – has little redundant data
Drawing Object
● component of vector graphic created using a formula/command
Drawing Property
● contains data about the shapes
● defines aspect of appearance of a drawing object
Drawing List
● List of objects in the drawing
● A list that stores the command/description/equation required to draw each object
● Properties of each object e.g. the fill colour, line weight/colour
● The list of shapes that make up an image // list of all drawing objects in image
1.3 Compression
Compression Reasons
● reduces file size – takes up less space in memory (leaves space for other files, allows more images/files to
be stored)
● faster download/upload rate (reduced transmission time) from/to web
● less bandwidth used to download/transmit
● original might be too large to send through email/as attachment
Lossy Compression
● Original data is lost/deleted (cannot be done in text file) & file cannot be reconstructed
● If used on text file, it would corrupt (all data is required, otherwise it would not make sense)
● Videos have a lower resolution, will buffer less if being streamed real-time, lowers bandwidth required to
transmit
● Used when all data is not required, quality can be reduced without user noticing or if a significant
reduction in file size is needed
Lossless Compression
● Original data is preserved
● Used when all data is needed (e.g. file needs to be fully restored), a high quality video/image is needed,
or it is already a relatively small file
Compressing Files
Sound **
● reduces amplitude range (to only range used) – reduces bits needed to store each sample
● run-length-encoding – consecutive sounds grouped (binary value of sound recorded along with number of
times it repeats)
● record only changes in sound (not actual sounds)
Images
(Lossy)
● reduce bit depth – reduces number of bits used to store a colour (each pixel has fewer bits)
● reduce number of colours – fewer bits needed to store each colour
● reduce resolution – fewer pixels altogether (less binary to store)
(Lossless)
● RLE – replaces sequences of the same colour pixel with colour code and number of identical pixels
Run-length Encoding **
● Identifies groups/sequences of repeated characters and replaces them with a copy of the character and
number of times it occurred
RLE Limitations
● Works by storing a colour and the number of times it occurs consecutively – there may not be many
sequences of same colour
● It would store each colour then the count, which would be 1 – only adds to file size // adds to total data
● E.g. RBG would become R1 B1 G1
2. Communication
2.1 Networks including the internet
LAN
allows…
● communication/sharing of data between devices on the network
● sharing of resources e.g. hardware/software applications
● central management (security, backup etc.)
● covers small geographical area, connection between devices is usually physical
● infrastructure is privately owned (not controlled by external organisations) PRIVATE OWNERSHIP
● high data transfer rate
● protection is easier to implement, more secure than WAN
WAN
● covers a large geographical area, connection is often virtual
● low data transfer rate
● can have private or public ownership (likely to be controlled by external organisations
Client-Server Model
● web pages/data saved on servers
● client sends request
● web servers process requests/performs requested tasks and returns results to the client
● client displays result to user
● user’s computer is the client
● server can host shared files
● users can request a file from any client computer
● files can be accessed simultaneously by several users
Thick-Client
● server performs minimal processing for client
● most resources are installed locally – clients do most of their processing independently
Thin-Client
● server performs all processes required by task/data storage
● clients only send requests to server and displays returned results
Mesh Topology
● all computers connected to at least one other device
● multiple routes between devices
● computers can act as relays – forward packets to final destination
Advantages of mesh:
● if one line goes down alternate routes are available
● improved security – not using one main line
● fewer collisions (more routes available)
● new nodes can be added without interfering with others
Cloud Computing
● accessing a file/service on a remote server
● Public cloud – services offered by a third party over public internet, available to anyone with appropriate
software/equipment (resources available on Internet, available to anyone)
● Private cloud – services offered by a private internal network, only available to select users (not general
public), dedicated system only accessible from the organisation
Advantages
● can be free
● saves storage on existing devices
● data can be accessed from any device (with internet access)
● data will likely be backed up/ higher chance of recovery
● better security
● scalable & easily shared
Disadvantages
● only accessible with internet access
● can take a long time to upload/download the data
● can be expensive (long term)
● may have limited storage space for free
● may not have backup/recovery or security options
● you are reliant on someone else/dependant on third party (for security or backup)
● can’t access files if server goes down
Disadvantages of public cloud
● loss of control – data is stored on remote infrastructure, relies on external provider
● requires reliable internet connection to access data
● increased recurring costs – provides charger must be paid, LAN is one-time only
Communication Media
Advantages of a wired network (better performance, faster access)
● higher bandwidth – less latency (good for streaming larger files)
● more reliable/stable connection – less vulnerable to interference (distance/walls)
● more secure – confidential data can be transferred securely
Advantages of a wireless network
● freedom of movement (not fixed to a single location) – can move between rooms, no need for physical
connection // devices can be portable
● easily expandable/scalable if more devices want to join (ppl can join on multiple devices)
● less cabling needed – cheaper setup
● allows access in remote locations (e.g. rural areas)
Disadvantages of a wireless network
● higher latency
● affected by weather
● slower transmission speed
● direct line of sight needed
Copper Cables
● data is transmitted through electrical signals
● lower transmission rate
● chance of interference and interception
● require repeaters over long distances
● more sturdy/reliable/flexible
Fibre-optic Cables
● data is transmitted using light
● has a greater bandwidth and faster transmission speed
● smaller risk of interference
● can be used over long distances – needs less signal boosting
● more difficult to hack into
● more prone to damage, less flexible/can break when bent, more expensive to install, difficult to
terminate
Radio Waves
● carries data wirelessly in the form of electromagnetic waves
Satellite
● communication device in Earth’s orbit
● receives and transmits data
LAN Hardware
Switch
● allows communication between devices
● connects individual devices to each other
● receives transmissions and forwards them to their destination
Server
● manages access to a centralised resource (usually between devices on LAN)
Functions of WNIC
● provides interface/allows connection to wireless network as an antenna
● receives analogue waves and converts them to digital
● takes digital input and converts it into analogue waves -sends radio waves through antenna
● encrypts and decrypts data
● provides MAC address to identify device on network
WAP
● hardware that provides radio communication from central device to nodes on a network
● allows connection of devices using radio waves/signals/Wi-Fi
● allows wireless enabled devices to connect to wired network
Bridge
● connects two LANs with the same protocol
● allows communication/data transmission between two networks with same protocol
Repeater
● restores a digital signal so it can be transmitted over greater distances
Role of Router **
● receives packets from devices // external network/internet
● stores IP and MAC addresses of all devices attached to it
● maintains routing table
● routes/forwards packets to destination
● finds destination of a packet (using IP addresses)
● assigns private IP addresses to devices on a LAN
● finds most efficient path to destination
● can act as a firewall, gateway (+ perform protocol conversion/changes packet format)
Ethernet
● a protocol
● used for data transmission over a wired network
● uses CSMA/CD
● data is transmitted in frames – each frame has source and destination address and error checking data
CSMA/CD (protocol)
● used to detect and prevent collisions
● device/node that listens to a communication channel (scans voltage)
● data is only sent when channel is free/idle // line is empty
As there are multiple nodes on network/topology…
● data from two nodes can start to transmit simultaneously, causing collision
● if collision occurs, nodes send signal to stop transmitting
● waits a random time before attempting to send data again
Bit Streaming
● Data is compressed before transmitting
● Video is transmitted continuously as series of bits
● On download, the server sends data to a buffer on the client computers
● Recipient receives bit stream from the buffer
Real-time
● Used when watching a live stream of events that are currently taking place
● Event is captured live with a video camera connected to a computer
● Media is sent to user’s device/buffer via bit stream directly as it is being recorded
● Cannot be paused or rewound
On-demand
● Video is already recorded/event has taken place
● Existing media is encoded to bit streaming format and uploaded to a server
● Can be watched at user’s convenience (can be paused/forwarded or rewound)
Difference between the WWW and the internet
WWW
● uses http/https protocol to transmit data
● collection of web pages
Internet
● uses TCP or IP protocols
● interconnected network of networks
PSTN
● consists of many different types of communication lines
● allows for full duplex data transmission
● communication passes through different switching centres
● line remains active even during power outage
● dedicated channel used between two points for duration of phone call
3. Hardware
3.1 Computers and their components
Embedded system **
● microprocessor within a larger system that performs a specific task
● has memory, input/output abilities and processor
● integrated into machine, not easily changed (by user/owner)
● e.g. a system in a washing machine that only controls cycle programs
● combination of hardware and software designed for a specific function
● does not have its own operating system
● does not require much processing power
Disadvantages
● difficult to change/update firmware by user // difficult to upgrade to take advantage of new
technology
● cannot be easily adapted for another task
● difficult to update or repair – usually thrown away instead
***no hardware operation questions have been repeated so far so chances are the other devices
we have to know (e.g. speakers, laser printers etc.) will likely come up***
Operation of Laser Printer
● contains a revolving drum that is given an electrical charge
● contents of page (provided by buffer/user) are drawn on drum as an electrostatic charge by a laser
beam that moves back and forth
● the drum is coated with oppositely charged toner which only sticks to areas charged by the laser
beam
● the drum then rolls over electrostatically charged paper, transferring the pattern onto the page
● paper is passed through a fuser/is heated to seal image
● the electrical charge is removed from drum, excess toner is collected
Operation of 3D Printer
● additive manufacturing
● uses digital 3D model or CAD file
● builds up model one layer at a time – starting from bottom, using xyz coordinates
● material is fused together layer by layer
● Fused Deposition Modelling – material is heated and pushed through nozzle
Advantages
● costs less per unit storage (used when large storage capacity is required)
● has more longevity (used with devices that work all the time and have large number of read write
operations)
Solid State Memory
● uses a grid of columns and rows (arrays/blocks) that has two transistors at each intersection:
● floating gate – stores voltage (represents either a 1 or 0)
● control gate – controls movement of charge/electrons during read/write operations
● not possible to overwrite existing data (need to erase first then write data into location)
Advantages
● no moving parts – more reliable
● faster data access times
Optical Disk Reader/Writer
● a rotating disk with concentric tracks made from a reflective metal layer
● data is read/written using laser light (either red or blue) that is shone onto the disc
● data is stored in pits and lands on the track – sequences of amorphous and crystalline states on the
metallic layer (correspond to 0s and 1s)
● reading – reflected light from different states is encoded as a bit pattern
● writing – laser changes surface to crystalline or amorphous states based on the bit pattern being
stored
● read and write operation can occur simultaneously
Features/Uses
● used for transferring data between devices or as back-up systems
● can be read-only – used to distribute software, movies or games
● generally have lower storage capacity
RAM
● primary memory
● stores currently running part of software/data/OS/programs/processes
● either static or dynamic
● can store data about I/O devices, contents of buffer or information about current process
SRAM
● SRAM – transistors arranged as flip-flops, more complex circuitry
DRAM
● DRAM – uses (a single) transistors and capacitors, stores bits as a charge
SRAM Advantages/Disadvantages
● faster access time – because it does not need to be refreshed
● used on CPU for performance (used in cache memory)
● has lower data density
● does not need to be refreshed – consumes less power
● DRAM Advantages/Disadvantages
● costs less per unit
● higher storage/data/bit density – more data stored per chip
● simpler design – uses fewer transistors
● needs to be refreshed – has higher power consumption
● slower access speed (used in main memory)
ROM
● primary memory
● stores start-up instructions/BIOS, firmware, any permanently required data
● stores the kernel of the operating system // parts of OS
● PROM – can be set once
EPROM –
erased using UV light, needs to be removed from device, can be overwritten multiple times, must be
entirely erased to rewrite
EEPROM –
erased using voltage (no additional equipment is needed), erased within device, can be overwritten
multiple times, does not have to be entirely erased before rewriting, contents of firmware can be
changed easily
● Use in embedded systems
● to store data that does not change
● data must be stored when device is powered off
● stores boot up instructions
Control system
● uses feedback
● produces an action
Role of an Actuator
● generates signal // converts electrical energy into mechanical energy
● to produce an action (be specific to situation)
Importance of feedback
● ensures system operates within given criteria
● allows system output to affect system input
● allows conditions to be automatically adjusted
Ports
● purpose – to provide connection to peripherals & provide interface between computer and other devices
Assembler
Two-Pass Assembler
First Pass – create symbol table
● reads assembly language instructions, adds any new symbolic addresses to symbol table
● removes comments and white space
● reads assembly language program one line at a time
● checks the opcode is in the instruction set
● adds labels to symbol table
Second Pass
● generates object/machine code
● reads assembly language program one line at a time
Instruction Groups **
● data movement – moves data between addresses or other locations
● input/output of data – takes input from user, outputs char of binary num
● arithmetic operations – perform addition or subtraction
● unconditional/conditional instructions – move to another instruction
● compare instructions – compares result to another value
● all types of addressing load contents of given/calculated address into accumulator
Addressing Modes
Immediate Addressing
● operand is the data
Direct Addressing
● operand holds memory address of data
● addresses address given by operand
Indirect Addressing
● the address used is at the address the user gives
● operand holds memory address that stores the memory address of the data
Indexed Addressing
● forms address from given address/address in operand plus the contents of the index register
Relative Addressing
● the address to be used is an offset number of locations away, relative to the address of the current
instruction
● allows for relocatable code – all target addresses can be specified by the base address
1. Memory Management
● controls movement of data between RAM/processor
● allocates memory to processes
● dynamically allocates memory to processes/programs
How MM Allocates RAM
● RAM is divided into blocks
● reclaims unused block of RAM
● prevents two programs occupying same area of RAM simultaneously
● moves data from secondary storage when needed (manages paging & virtual memory)
3. Security Management
● creates accounts/passwords
● provides firewall or anti-malware
● validates user and process authenticity
4. Hardware Management
● receives data from input devices
● sends data to output devices
● operates/installs device drivers – installs programs for devices connected to external ports
● allows communication between peripheral devices and computer
● handles buffers for transfer of data – ensures smooth transfer between devices transmitting and receiving
at different speeds
● manages interrupts from device
5. Process Management
● manages scheduling of processes – decides which process to run next // order of processes
● manages resources the processes require – e.g. allocating memory
● enables processes to share/transfer data
● prevents interference between processes
● handles process queue
● supports/allows multitasking – ensures fair access, handling priorities/interrupts
Utility Software **
● help set-up/optimise/maintain the computer
● makes memory allocation more efficient
● checks the system for faults
1. Disk formatter – disk needs to be prepared/initialised for use
● Prepares/initialises a disk for storing files by partitioning it (generates new file system)
● Can delete all data from disc
● Sets up file allocation table
● Needs to check disk for errors
2. Defragmentation – over time, saving and deleting small files fragments disk
● Moves/rearranges blocks of files so that each individual file is contiguous in memory
● Moves free space together
● Less time taken to access files (less head movement as data is contiguous)
● Improves disk access times – no need to search for next fragment
3. Disk repair – needed to optimise performance
● Scans for errors/inconsistencies in a disk and corrects them – prevents bad sectors being used
● Reduces access times by optimising storage
4. Back-up (Software) – allows retrieval of data, provides security against loss
● Creates copy of data in case the original is lost (in regular intervals)
● Allows retrieval of data in case of any data is lost/corrupted
5. Disk/System clean up
● Optimises storage by removing unwanted files
6. Compression software
● Reduces file size
● Saves storage and memory space
● Reduces transmission time
7. Virus Checker
● Frees up RAM – removes software that takes up memory/replicates, scans for malicious program code
Program Library **
● contains pre-written functions and subroutines
● can be referenced or imported
● the functions/routines it has can be called in own program
● saves time as code does not have to be written from scratch
● more likely to work (it’s already tested)
● program updates automatically (if update in routine)
● can perform more complex calculations than programmer is able to do
Dynamic Link Library Benefits **
● requires less main memory as DLL is only loaded once when needed
● executable file is smaller (does not contain all library routines)
● no maintenance needed from programmer (DDL is separate from program)
● no need to recompile program if changes are made to DDL (changes/improvements to DDL file code are
done independently of the main program)
5.2 Language Translators
Definition:
● convert a high-level or assembly programming language to a different form (usually
machine/object code)
Assembler
● translated assembly code into machine code
Compiler **
● translate high-level language (entire code is translated then run)
● used after program is completed
● produces error report after translating
● creates executable file – can be run without source code
After Testing
● produces executable file
● user cannot access/edit/sell the code
● users do not need translator to run program
● can be compiled for different hardware specifications – generates more income
● program can be tested multiple times without need to retranslate
Drawbacks when testing
● code cannot be changed without recompilation
● program will not run if there are any errors
● errors cannot be corrected in real-time
● one error may result in false errors being reported
● cannot easily test individual sections of code / cannot test if unfinished
Advantages when testing
● can debug multiple errors simultaneously
● produces executable file
● developer can test program multiple times without recompiling
Interpreter **
● translate high-level language line by line (is translated then run)
● used while writing a program for testing and debugging
● errors can be corrected in real time – stops when an error occurs and displays position
When Testing
● allows developer to make real-time changes that can be seen immediately
● program can be debugged at each stage
● developer can test when incomplete – small parts can be tested individually, if one section does not work
others can still be tested
● to avoid dependant errors
Partial Interpreters/Compilers
● can be used on different platforms as they are interpreted when run
● code is optimised for CPU as machine code is generated at run time
● source code does not need to be recompiled – more efficient to run
(programs may not need to be compiled if the software is already an executable file, has been pre-
compiled/built using compiler or if the source code has not been provided)
IDE Features/Tools **
Coding
● context sensitive prompts – as the code is being written, displays predictions/options to complete the
statements, suggests additions
● auto-complete – helps programmer figure out what to type next
● auto-correct
Error Detection
● dynamic syntax check – underlines/highlights syntax errors as code is being entered/in real-time
Presentation
● pretty printing – helps identify key terms
● auto indentation
● expand/collapse code blocks
Debugging
● single stepping – allows programmer to run the code one line at a time (breaking in between) so effects of
each statement on values can be seen/checked
● breakpoints – stop the code executing at a set line (to check current values/progress)
● report windows – output contents of variables and data structures (see how variables change)
● variables & expressions
6. Security, Privacy and Data Integrity
Data Security
● protects data against loss/corruption
● ensure recovery
Data Privacy
● ensuring data is protected against unauthorised access
Data Integrity
● ensures consistency/accuracy of data and whether it is up to date
● e.g. validation/verification rules, cascading update/delete
Verification
● checks that data matches the original/is accurate
● e.g. visual check (manual comparison with source document/material), double entry (enter twice,
computer system compares)
In parity blocks…
● an additional parity byte is sent with vertical AND horizontal parity
● each row/column must have an even or odd number of 1s
● receiver counts the number of 1s and 0s in byte, allowing errors to be identified
● the intersection is the error
● *an error cannot be detected if an even number of bits has been changed, as they could cancel
each other out*
Copyright
● The formal and legal rights to ownership // Intellectual property rights
● Protects against unauthorised reproduction of work
● Allows for legal right of redress
Commercial Software
● user must pay before being able to legally use the software
● cannot be redistributed or edited
Social impacts
● privacy issues – people do not like their data being stored
● incorrect recognition leads to mistakes (systems may be denied)
● individuals will feel safer – reduction in crime
● helps in catching criminals (links to reduction in crime)
Economic Impacts
● reduces costs – less time taken for tasks to be carried out
● increases profits – leads to more efficient work performance (redundant tasks done by AI)
● decreases cost for customer
● decreases profit margins – program may be expensive to maintain/buy/update
8. Databases
8.1 Database Concepts
Entity
● object which data can be stored about
Field
● column/attribute in a table
Tuple (Record)
● a single row of data in a table (about one instance of an object)
Primary Key
● unique attribute – used to uniquely identify a record/tuple
● can be used as foreign key in another table // form link between the tables
Candidate key
● an attribute that could be a primary key
Secondary Key
● alternative/additional key used along with primary key to locate specific data (candidate key that has not
been chosen as primary key)
Foreign Key
● a field in one table that links to a primary key in another
2NF
● has no repeated attributes
● no partial key dependencies (all attributes fully dependant on primary key)
3NF
● no transitive dependencies
● all attributes/fields fully dependant on primary key AND NO OTHER ATTRIBUTES
0NF to 1NF
● remove/identify any repeating groups of attributes
● ensure each field is atomic (e.g. Name should be split into FirstName and LastName)
● identify primary key
1NF to 2NF
● remove any partial key dependencies
2NF to 3NF
● remove any non-key dependencies
8.2 Database Management Systems (DBMS)
Data Dictionary
• Contents (metadata about database) // data in a database
● table name // field name
● data types
● type of validation used // validation rules
● primary and foreign keys
● relationships between elements
Database/Logical Schema
• shows structure of database, its relationships (e.g. E-R diagram)
● overview of a database structure
● models the problem, using methods such as ER Diagrams
● independent of any particular DBMS // model of a database that is not specific to one DBMS
● describes the relationship between data and its structure
Conceptual design
● Platform/database independent overview of the database
● Is used to design the physical structure
● Appropriate example e.g. Design of entities / E-R diagram / views
Security in a DBMS
authentication
backup/recovery procedures – automatically creates copies of database and stores it off-site on a regular
basis, allows data to be recovered if lost
access rights
– users are given different access permissions to different tables, read/write, read only etc.
views
– different user able to see different parts of database, only see what’s required
encryption
– data is turned into ciphertext, cannot be understood without decryption key
record and table locking
– prevents simultaneous access to data, so data is not overwritten
Data Dictionary
● Data about the data in the database // metadata
● Identifies the characteristics of the data that will be stored
● Appropriate example e.g. field names, table name, validation rules, data types, primary / foreign keys,
relationships etc.
● Data Types
- CHARACTER
- VARCHAR(n) – like a string, VARCHAR(255) allows 255 characters
- BOOLEAN
- INTEGER
- REAL
- DATE
- TIME