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

P1 Definitions

Uploaded by

zumarjutt69
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

P1 Definitions

Uploaded by

zumarjutt69
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

★ come up multiple times have ** next to them

★ 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

1.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

Character Set (e.g. ASCII, UNICODE, Extended ASCII)


● All of the characters that the computer can represent/use
● Each character has a corresponding unique binary number
Similarities
● All can use 8 bits
● ASCII is a subset of Unicode/EA
● Each represent characters using a unique code
Differences
● Unicode can represent multiple languages and a wider range of characters than ASCII
● ASCII – 7bit, Extended ASCII – 8bit, UNICODE – 16bit
1.2 Multimedia: Graphics **

Bitmap Graphic

● Image is made of pixels and each pixel has one colour


● Each colour has a unique binary code
● Code for the colour of each pixel is stored in sequence
● prone to pixelation when enlarged
● larger file size – data is stored about each pixel can be compressed significantly
● more difficult to edit – each pixel needs to be edited separately

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

Vector Graphic Representation


● encoded as series of geometric shapes
● stored coordinates of drawing objects in image
● contains drawing list – commands for creating each individual object (and their attributes)
Sound **
Sound Representation
● amplitude is recorded a set number of times in a second
● each amplitude is given a corresponding unique binary value/number
● binary number is saved/stored in sequence
Sampling
● taking measurements at regular intervals and storing the values
Sampling Rate
● number of samples taken per unit time // per second
Effect of increasing sampling rate
● sound is recorded more often // smaller gaps in sound wave & between samples
● reduces quantisation errors
● improves accuracy – digital waveform resembles analogue one more closely
● increases file size (increases number of total samples taken – so more bits needed to store the data, takes
up more space in memory)
Sampling Resolution
● number of bits used to store each sample
Effect of increasing sampling resolution
● increases number of bits used to store each sample // more bits per sample
● wider range of amplitudes can be stored // more amplitudes can be represented
● file size increases
● digital waveform is closer to original (improves accuracy)
● smaller quantisation errors
Analogue data
● A variable // data value that is constantly changing

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

Examples of Client-Server Models


● sending and receiving an email
● using a print or file server
● a company/school centrally storing files

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

Features of a peer-to-peer network


● computers are of equal status
● each computer provides access to data and resources // data is distributed
● computers can communicate and share resources
● each computer responsible for its own security

Drawbacks of a peer-to-peer network


● reduced security (no central management of security) – each computer is at risk from viruses from other
computers
● no central management of back-up – if data from one computer is not backed up it is lost to all of them
● no central management of files – hard to maintain consistency
● computers have slower response time – due to being accessed by other computers
● files may not always be available – not all computers are always switched on
Star Topology
● devices only connected to central router/device (switch/hub etc.)
● each computer only connected to server
● fewer collisions – high performance as each device only connected to switch
● easily scalable – device directly connected to switch
● more resilient – not reliant on one single cable

How data is transmitted


● data from sending device is transmitted to the router
● data has address of recipient
● router determines recipient’s destination address – using routing table
● router transmits data directly/only to recipient

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

Need for Secondary Storage


● to store files/data/software long-term

Need for Primary Storage


● to store files needed to boot system
● to store OS or any system software
● to store intermediate data/current data being processed

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

Use of temperature sensor


● prevents overheating // ensure material is hot enough
● identifies material of object/material being used
Microphone Operation
● has a diaphragm
● incoming sounds waves cause vibrations about diaphragm
● this causes coil to move past a magnet
● electrical signal is produced
Speaker
● an electric current is sent to speaker
● the electric current passes through a coil
● current in the coil creates an electromagnetic field
● an electromagnet is repelled by, or attracted to the permanent magnet based on direction of the current in
the coil
● movement of coil causes the diaphragm to vibrate – this vibration creates sound waves

Magnetic Hard Disk


● has platters – divided into sectors and concentric tracks
● surface of disk can be magnetised
● has a read/write head mounted on an arm
● data is encoded as a magnetic pattern
● writing – variation in current in head causes variation in magnetic field on disk
● reading – variation in magnetic field causes variation in current through head

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

Resistive touch screen


● has two layers
● when user touches screen, layers touch and a circuit is completed
● processor determines horizontal and vertical point of contact
● will work if any object touches the screen
Capacitive touch screen
● has several layers
● when top layer is touched, there is a change in the electric current
● a microprocessor identifies the coordinates of touch
Virtual Reality Headset
● video/data is sent from a computer to the headset
● the video feed is sent to an LCD/OLED display
● there are two lenses placed between eyes and screen – allows for focusing and reshaping of video
for each eye, creating 3D effect
● uses an fps of 60 to 120
● sensors measure/track movements of user, allowing the video on the screen to react to and mimic
movements
● uses binaural (surround) sound so sound from speakers appears to come from all directions
● can also use infrared sensors to monitor eye movement, allows depth of field on screen to be more
realistic
Purpose of a buffer
● To act as temporary storage – temporarily stores data until it is ready to be transmitted to the
device
● Stores data before it is used by receiving device
● Allows processes to operate independently of each other
● e.g. video buffer when streaming videos, printer buffer when data is transferred from computer to
printer
Process
● instructions and data are sent by computer to buffer
● data is transferred from buffer to device – allowing user to continue using computer // allowing
processor to continue processing
● when buffer is empty, an interrupt is sent to computer, requesting more data

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

3.2 Logic Gates and Logic Circuits


4. Processor Fundamentals

4.1 CPU Architecture

Stored Program Concept


● instructions and data are stored in the same memory space/in main memory
Components in Von Neumann Architecture
● Buses
● Registers
● CPU
○ CU
○ ALU
● IAS (Immediate Access Store)
● System clock
General Purpose Registers
● Hold temporary data when performing operations
● Used for any purpose
● Can be used by most instructions
Special Purpose Registers (All registers we have to know are special purpose)
● Hold status of a program
● Specialised for specific use
● Can only be used by certain instructions
Program counter
● holds the address of the next instruction to be loaded
● is incremented once an instruction has been carried out
Memory Address Register
● stored address from memory location currently being read from or written to (where data is being fetched
from)
Memory Data Register
● holds the data fetched from address in MAR
● data is copied to CIR
Current Instruction Register
● holds data from MDR
● holds instruction currently being decoded/executed
Index Register
● stores a value that is added to an address to give another address
Status Register
● stores flags – from results of logic and arithmetic operations // interrupt flags
● contains bits – can be individually set or cleared depending on operation
Control Unit (CU)
● synchronises actions of other components in the CPU *based on pulses of system clock
● sends/receives control signals along the control bus
● manages the execution of instructions – decodes an instructions opcode during FE cycle
● controls communication between components of CPU
● types of signals it transfers: interrupt, timing, read & write
System Clock
● synchronises computer operations by creating time signals
● allows operations to be processed in the correct order / sequence
● keeps track of date and time
Immediate Access Store
● holds all the data/programs currently in use
● volatile memory
● has fast access times
How data is transferred between components
● system clock gives out timing signals – sent on the control bus, this synchronises the other system
components
● CU initialises data transfer – generates signals that are sent on control bus to other components

Role of Buses in Storing Data


● Address bus – carries address where data is being/going to be written to or read from
● Data bus – carries data between the devices, buffer, or components

Increase computer Performance **


1.Number of cores
● each core processes one instruction per clock pulse
● more cores mean that more sequences of instructions can be carries out simultaneously
● multiple instructions can be executed per clock pulse (individually)
● decreased time taken to complete a task
Why this may not increase performance
● software may not be designed for multiple cores – one core will be left idle
● memory access speed won’t match speed of cores – causes delay
● may be other differences – e.g. amount of RAM
2. Bus Width
● allows transfer of more data each time/each transfer
3. Clock speed
● each instruction is carried out on a clock pulse
● clock speed dictates the rate at which instructions are being run
● faster clock speed = more instructions can be run per second/time period // more FE cycles per unit time
4. Cache
● higher capacity means it can store a higher amount of frequently used instructions for fast access
● fast access memory (close to CPU)
● stores frequently used instructions/data
● more cache means more instructions can be transferred faster – less swapping between RAM and cache
● prevents CPU idling while waiting for data
5. Quantity of RAM
● more applications can reside in main memory simultaneously
● saves/decreases disk access times

Ports
● purpose – to provide connection to peripherals & provide interface between computer and other devices

● USB // COM port – fast data transfer speeds, universal standard


- 1 bit transferred at a time
- Can be asynchronous or synchronous
- USB-3, full duplex, otherwise, half-duplex
● HDMI
- allows video and audio to be transferred on one cable, convenient
● VGA - DisplayPort
Fetch-Execute Cycle (Role of Registers)
● PC stores address of next instruction to be fetched + contents are incremented each cycle
● MAR holds address where data is fetched from (from which data will be read from/written into)
● MDR holds data at/from address in MAR (or data to be entered into it)
● Instruction (from MDR) is copied to CIR for decoding and execution
Register Transfer Notation **
[PC] ← [PC] + 1 – address in PC is incremented
MAR ← [PC] – contents of PC loaded to MAR
MDR ← [[MAR]] – data located in address held in MAR is copied to MDR
CIR ← [MDR] – contents of MDR copied to CIR
Stages of the FE Cycle
● Next address to be fetched is stored in the PC
● This address is copied into MAR, using address bus
● Instruction located in that address is copied from main memory to MDR, using data bus
● Instruction is copied from MDR to CIR
● Instruction is decoded by CIR (into opcode and operand)
● Processor executes instruction
● Address in PC is incremented
Interrupts **
● Interrupt flag raised in interrupt register
● IPR (Interrupt Priority Register) checked for at start/end of FE cycle (before it begins/after execution
stage)
● Type and source of interrupt identified
● Priority is checked against the current process – if lower, FE cycle continues, if higher…
● Contents of registers are stored in/moved to a stack
● Address of Appropriate ISR called to handle the interrupt (loaded to PC)
● Once ISR finishes, check for further interrupts (if found, repeat cycle)
● Otherwise load data/contents from stack into registers and continue with previous process
Purpose of an Interrupt
● to send a signal from a device/process
● seeking the attention of the processor
Causes of Software Interrupt **
● division by zero // runtime error
● attempt to access invalid memory location
● array index out of bounds
● stack overflow
● buffer overflow
Causes of a Hardware Interrupt
● printer is out of paper
● keyboard key press
● power failure
4.2 Assembly Language

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

4.3 Bit manipulation


Binary Shifts – moving bits in a register a certain number of places within a register
● Logical Shift – bits shifted out of register are replaced with 0s
● Arithmetic Shift – bits shifted out of register are replaced with 1s
● Cyclic Shift – no bits are lost, bits shifted out of one end appear at the other end
● Left Shift
● Right Shift
Bit Masking
● AND is used to test is bit has been set
● OR is used to set the bits
● XOR is used to clear/reset a bit that has been set
5. System Software

5.1 Operating Systems

Purpose of an Operating System


● to provide a user interface
● to provide a platform for software to run
● to hide complexities of hardware from user
Operating System – tasks
● memory management
● Provides hardware and HCI(Human Computer Interface)
● file management
● security management
● hardware management
● input/output management
● process management
● error checking and recovery

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)

2. File Management Tasks


● space allocated to particular files
● maintains a directory structure
● provides file naming abilities
● implements access rights
● allows file sharing
● specifies tasks that can be performed on a file (copy, paste, delete, close…)

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

6.1 Data Security

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

Why Data needs to be kept secure


● to protect against someone deleting/modifying or stealing it

Why the computer system needs to be kept secure


● to protect against someone installing malware or damaging the system/accessing data on it

Measures Used to Protect Computer Systems


1. Two factor authentication
2. Strong username and password: prevents unauthorised access
3. Biometric passwords
4. Digital signatures
● user puts message through hashing algorithm to produce a digest
● digest encrypted with sender’s private key (creates digital signature)
● message and signature sent to receiver
● receiver decrypts signature to reproduce digest – same hashing algorithm used on received
document to create second digest
● signature digest and receivers digest are compared (document is authentic is they are the same)
● digital signature can only be decrypted using matching sender’s public key

5. Firewall – accepts or rejects incoming/outgoing packets based on criteria


● monitors incoming and outgoing traffic/packets – compares it to criteria set by user (checks
against whitelist/blacklist/blocked IP addresses)
● blocks/rejects files or transmissions that do not match criteria, accepts ones who do
6. Up-to-date Anti-Malware – scans files on hard drive for malicious software
● regularly scans computer for viruses, checks against stored database of viruses
● database needs to be updated regularly
● if virus detected, it is quarantined or deleted
● compares downloaded files to database of known viruses–prevents download from continuing
7. Anti-spyware
● scans computer for spyware, checks against stored database of spyware
● database needs to be updated regularly
● if spyware detected, it is quarantined or deleted
● compares downloaded files to database of known spyware–prevents download from continuing
8. Backups
● data can be restored in case it is damages/lost due to malware
9. Encryption
● converts data into cipher text
10. Access rights
Threats Posed by Internet/Networks
Virus/Malware
● malicious software that replicates itself
● downloaded/run without user’s knowledge
● runs in background
● can pretend to be legitimate
● can damage/delete/corrupt data
● does not send data out of computer
Spyware
● malicious software
● downloaded/run without user’s knowledge
● runs in background
● can pretend to be legitimate
● secretly records/collects user’s data/actions
● sends data/activity logs to third party
● does not replicate itself
Hacking/Hackers
● illegal/unauthorised access used to delete/damage/collect data
● done with malicious intent
Phishing – REQUIRES USER ACTION
● email pretends to be from official body
● persuades individuals to disclose private information
● requests authentication by redirecting to unofficial website
Pharming – AUTOMATIC
● redirects user to a false/fake website
● prevention – check URL validity, ensure connection is secure (https)

Security Methods to Protect Data


Access Rights
● give certain users access to different elements
● uses different accounts/logins which have different levels of access
● specific views can be assigned
Encryption
● data is converted into cipher text // data is encoded
● use – cannot be understood if intercepted without a decryption key
6.2 Data Integrity
Validation
● checks data is reasonable/sensible
● e.g. checking data is given in the right data type
when explaining use, refer to specific checks…
● format check: makes sure data is in required format
● length check: makes sure data contains correct number of characters
● type check: ensures only correct data type e.g. non-numeric data is entered
● existence check: makes sure data is already present in the system

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)

Reasons why data might still be incorrect


● data on original document may not be correct – verification only checks if it matches
● validation doesn’t check accuracy of data, only if it’s reasonable

Parity Check (used during transfer)


● type of parity is decided upon before transfer (even or odd)
● each byte contains a parity bit

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*

Checksum (used during transfer)


● checksum value calculated from the data before transmission
● value is transmitted along with data
● receiving computer recalculates checksum from the received data
● the received checksum and recalculated checksum match, no error has occurred
● if they don’t match, an error has occurred
7. Ethics and Ownership

7.1 Ethics and Ownership

Benefits of Joining an Ethical Body e.g. BCS, IEEE


● has set ethical guidelines to follow – clients/staff know standards, no decision-making required
● professional integrity - clients/staff know he is reputable (shows skills/knowledge)
● they provide help and support (legal advice)
● training courses – helps to keep skills up to date

Reasons to Act Ethically


● make sure team members feel valued
● maximise quality of work
● promote teamwork and cooperation
● enable creation of best product for customer

How to Act in Best Interest of Client


● keep client’s personal data private
● involve client in development // communicate with client
● provide solutions the client asked for
● keep project on schedule and stay within given budget
● keep client informed of any problems/delays

How to Act Ethically


● be truthful – ask for help on how to use a program
● perform your own research
● ask for additional training/mentor

Being Unethical (Not acting in the best interests of…)


● product – might fail if error isn’t reported
● client – code might not work, lets down client
● profession – failing in his duties as an employee
● company

Copyright
● The formal and legal rights to ownership // Intellectual property rights
● Protects against unauthorised reproduction of work
● Allows for legal right of redress

Preventing Illegal Copies


● encryption
● use product key
● Compile source code (distribute as .exe file)
7.2 Software Licencing
Free Software Foundation & Open Source Initiative
● user can edit/improve source code (must be released under same conditions as original software/same legal
rights apply)
● user can redistribute the software
Reason for an open source licence
● allows user to customise code
● allows errors to be reported
● allows additional features to be added to code
● allows for collaboration
Reasons against an open source licence
● requires you to release source code
● allows anyone to edit/modify and share the source code/program
● doesn’t allow you to profit off the created program
Shareware
● enables program to be copyrighted – user cannot legally modify it, control over product is maintained,
protects intellectual property rights
● user always gets a trial period – can also gain income if bought afterwards
● user cannot redistribute the software
● cannot be edited – developed keeps control
● more people might try it – free trial allows more people to experience it, meaning they are more likely to
buy it (also allows people to give feedback based on free trial)

Commercial Software
● user must pay before being able to legally use the software
● cannot be redistributed or edited

Advantages of commercial software


● enables program to be copyrighted – user cannot legally edit it, control over product is maintained
● protects source code / prevents changes being made
● a fee can be charged for program – programmer gains income
● prevents illegal copies being made – action can be taken if this occurs
● for customer – likely to have fewer bugs, redress available if game is broken, potentially
better support as a fee is being charged
7.3 Applications of AI **
● police identifying wanted people – image/facial recognition (can identify features/patterns in an image
and match them to a person/object)
● natural language interfaces – speech recognition (can identify language/words being spoken, can learn
accents, matches words to database, generates most likely sentence)
● self-driving cars – can detect position on road (self-parking, collision avoidance, following a route)
● game playing – models characters in computer games (allows comp characters to react according to
player’s movements)
● can start recording to secondary storage when person is detected
● can identify direction of movement and then move the camera accordingly
● scans scene in real time
● facial/image recognition – takes each frame individually, analyses pixels
● camera focuses on pattern identified

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

Drawbacks/Limitations of a file-based approach **


● more data redundancy – same data is stored many times
● more data inconsistency (worse data integrity) – data is not updated across the whole program and there
may be duplicates that are stored differently
● hard to perform complex queries – new program has to be written each time
● lack of privacy – user views/access cannot be implemented

Advantages of a relational database (compared to file-based approach) **


● reduced data redundancy – each data item is only stored once (due to linked tables)
● maintains data consistency (data integrity) – changes in one table automatically update in another
● complex queries easier to run
● can provide different views – user can only see specific aspects/parts of the database (improved privacy)
● program-data independence – programs do not need to be rewritten if data is changed (data is separate
from software)

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

Importance of referential integrity


● makes sure data in the database is consistent and up-to-date
● ensures that every foreign key has a corresponding primary key
● prevents records being added/modified/deleted incorrectly
● makes sure any changes made to data in one place are reflected in all related records
● ensures any queries made return accurate and complete results
● makes sure non-existent data cannot be referenced
Normalisation
1NF
● no repeating groups of attributes

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.

Software Tools in DBMS


● provides a developer interface
- allows user to create items such as tables, forms and reports
- creates input & output abilities through menus/buttons/touchscreen/monitor etc.
● query processor
- allows user to enter criteria
- searches for data that meets the entered criteria
- organises results to be displayed to the user
- software that processes and executes queries written in SQL
8.3 DDL and DML

● DDL statements – always end with a semicolon!!!


CREATE DATABASE database_name;
CREATE TABLE table_name (
column_name1 DATATYPE
column_name1 DATATYPE NOT NULL
PRIMARY KEY(column_name)
FOREIGN KEY(column_name) REFERENCES external_database_name(column_name)
);

ALTER TABLE table_name


ADD column_name DATATYPE
ADD PRIMARY KEY(column_name)
ADD FOREIGN KEY(column_name) REFERENCES external_database_name(column_name)

DROP COLUMN column_name


RENAME COLUMN old_column_name TO new_column_name;

● Data Types
- CHARACTER
- VARCHAR(n) – like a string, VARCHAR(255) allows 255 characters
- BOOLEAN
- INTEGER
- REAL
- DATE
- TIME

You might also like