OCR A-Level CS: Component 01 - Computer Systems

H446/01     2 hours 30 minutes     40% of A-Level     Topics 1.1 – 1.5

1.1 - The characteristics of contemporary processors, input, output and storage devices

1.1.1  Structure and function of the processor

CPU components:

ALU (Arithmetic Logic Unit)
Performs arithmetic (add, subtract) and logical (AND, OR, NOT, comparisons) operations.
Control Unit (CU)
Coordinates the CPU. Fetches, decodes and executes instructions by sending control signals.
PC (Program Counter)
Holds the address of the next instruction to be executed.
ACC (Accumulator)
Holds the results of calculations carried out by the ALU.
MAR (Memory Address Register)
Holds the address of the memory location being read from or written to.
MDR (Memory Data Register)
Holds data read from memory or waiting to be written to memory.
CIR (Current Instruction Register)
Holds the instruction currently being decoded and executed.

Buses:

Data bus
Carries data and instructions between the CPU and memory. Bidirectional.
Address bus
Carries memory addresses from the CPU to memory. Unidirectional.
Control bus
Carries control signals such as read/write, clock and interrupt signals. Bidirectional.

Fetch-decode-execute cycle:

  • Fetch: the address in the PC is copied to the MAR and sent along the address bus. The CU sends a read signal on the control bus, and the instruction arrives on the data bus into the MDR, then is copied into the CIR. The PC is incremented by 1.
  • Decode: the instruction in the CIR is split into the opcode (the operation) and the operand (the data or address to use).
  • Execute: the operation is carried out. Results of calculations are stored in the ACC.

Factors affecting CPU performance:

Clock speed
Cycles per second, measured in GHz. Higher means more instructions per second, but more heat is produced.
Number of cores
Each core processes its own instructions, so more cores can handle more instructions at once. Only helps software written to use multiple threads.
Cache
Small, fast memory between the CPU and RAM. Holds frequently used data and instructions, reducing memory access time.

Pipelining: while one instruction is executed, the next is decoded and the one after is fetched. Increases throughput. Hazards (data dependencies, branches) can cause stalls.


Processor architectures:

Von Neumann
One memory holds both instructions and data, and they share one bus. The shared bus limits speed: the von Neumann bottleneck.
Harvard
Separate memories and buses for instructions and data, so both can be fetched at the same time. Used in embedded systems and DSPs.
Contemporary
Modern designs. Usually have separate (Harvard-style) instruction and data caches, with a shared main memory (Von Neumann-style).

1.1.2  Types of processor

CISC (Complex Instruction Set Computer)
Many complex instructions, so one instruction can perform several operations. Fewer lines of assembly per task.

Advantages: the compiler has less work to do.

Disadvantages: more complex hardware; instructions take several clock cycles; pipelining is harder.

Uses: desktop and laptop computers (e.g. Intel and AMD x86 processors).
RISC (Reduced Instruction Set Computer)
Small set of simple instructions, each designed to complete in one clock cycle.

Advantages: simpler, cheaper hardware; lower energy use; pipelining is easier.

Disadvantages: complex tasks need more instructions, so programs are larger.

Uses: mobile phones, tablets and embedded systems (e.g. ARM processors).
GPU (Graphics Processing Unit)
Thousands of smaller, simpler cores that carry out the same operation on many data items at once (SIMD). Originally for graphics. Now also used for machine learning, scientific simulation and video processing.
Multicore and parallel systems
Several processor cores on one chip. Tasks are split between cores and run at the same time. Parallel systems use several processors working together.

Benefit: faster for tasks that can be split up.

Limitations: sequential tasks gain nothing from extra cores, and software must be written to use them.

1.1.3  Input, output and storage

Input devices
Keyboard, mouse, touchscreen, microphone, camera, scanner, sensors.
Output devices
Monitor, printer, speakers, plotter, actuators (e.g. motors or valves in a control system).
Choosing devices
Match the device to the problem, e.g. sensors for data logging, a touchscreen for a public kiosk, a printer for hard copy.
Magnetic storage (HDD)
Spinning magnetic platters. Large capacity, low cost per GB. Slower and more fragile than flash. Used for bulk storage.
Flash storage (SSD, USB)
No moving parts. Fast, durable and quiet. Higher cost per GB. Used in phones, laptops and USB drives.
Optical storage (CD/DVD/Blu-ray)
A laser reads and writes a reflective disc. Cheap and portable, but lower capacity and slower than HDD or flash. Used to distribute software and media.
RAM (Random Access Memory)
Volatile: data is lost when power is off. Holds the programs and data currently in use. More RAM lets more programs run at once.
ROM (Read Only Memory)
Non-volatile: keeps data without power. Holds firmware such as the BIOS and boot instructions. Not easily rewritten.
Virtual storage
Part of secondary storage used as extra RAM when RAM is full. Slower than RAM, but lets programs larger than RAM run.

Know the trade-offs: speed, cost, capacity and volatility. Justify each choice against the scenario given.

1.2 - Software and software development

1.2.1  Systems software

Operating system: needed so users and applications can use the hardware without controlling it directly. Manages hardware, files, processes, memory, security and user accounts, and provides the user interface.


Memory management:

Paging
Memory is split into fixed-size pages. Pages can be stored anywhere in memory, not necessarily next to each other.
Segmentation
Memory is split into variable-size segments based on logical parts of a program (code, data, stack).
Virtual memory
Secondary storage is used as an extension of RAM, with pages swapped in and out as needed. Excessive swapping (thrashing) slows the computer down.

Interrupts: a signal that an event needs attention. Checked at the end of each fetch-decode-execute cycle. If one is raised, the CPU saves its current state to the stack, runs the ISR (Interrupt Service Routine), then restores the state and carries on. Types: hardware (keyboard, mouse, I/O), software (program requests) and timer.


Scheduling algorithms:

Round robin
Each process gets a fixed time slice in turn. Fair, but does not favour high-priority tasks.
First come first served (FCFS)
Processes run in order of arrival. Simple, but a long job can delay short ones.
Shortest job first (SJF)
Shortest job runs next. Minimises average waiting time. Non-preemptive. Needs the job length known or estimated in advance.
Shortest remaining time (SRT)
Preemptive version of SJF. A new shorter job can interrupt the current one.
Multi-level feedback queues
Several queues with different priorities. Processes move between queues depending on their behaviour.

Types of operating system:

Distributed
Manages several connected computers so they appear as one system to the user.
Embedded
Built into a device for one dedicated task, e.g. a washing machine or car ECU.
Multi-tasking
Runs several processes at once by rapidly switching between them.
Multi-user
Lets several users share one system, allocating resources between them.
Real-time
Guarantees a response within a set time. Used where timing is critical, e.g. air traffic control. A hard real-time system fails if a deadline is missed.

BIOS (Basic Input/Output System): firmware stored in ROM. First code run on boot. Performs POST (power-on self-test), identifies the hardware and loads the OS bootloader.

Device drivers: software that lets the OS communicate with a hardware device, translating generic OS commands into device-specific instructions.

Virtual machines: software that emulates a computer, so one OS can run inside another. Can also run intermediate code (e.g. Java bytecode) on a platform-specific virtual machine, so the same code runs on different hardware. Uses: legacy software, sandboxing, cloud computing (a hypervisor runs many VMs on one physical machine).

1.2.2  Applications generation

Applications
Software that lets the user do a task, e.g. word processor, spreadsheet, database management system, web browser, graphics package. Justify a choice by linking its features to the task.
Utilities
Small programs that maintain the computer: antivirus, disk defragmenter, backup, file compression.
Open source vs closed source
Open source: source code available to view, modify and distribute; usually free, community supported. Closed source: source code kept private by the owner; paid licence, official support.

Translators:

Compiler
Translates entire high-level source code to machine code in one go. Creates an executable. Fast execution. Error list produced at end. Examples: C, C++.
Interpreter
Translates and executes source code line by line. No executable produced. Stops at first error. Slower execution. Easier to debug. Examples: Python.
Assembler
Translates assembly language (mnemonics) to machine code. One-to-one translation. Output is object code.

Stages of compilation:

1. Lexical analysis
Whitespace and comments are removed. Source code is broken into tokens (keywords, identifiers, operators, literals). Identifiers are added to the symbol table.
2. Syntax analysis
Tokens are checked against the language's grammar rules. An abstract syntax tree is built. Syntax errors are reported. The symbol table is updated, e.g. with data types.
3. Code generation
The abstract syntax tree is converted into object code (machine code).
4. Optimisation
Code is made to run faster or use less memory, e.g. removing redundant instructions or unreachable code. Increases compile time.

Give the stages in order and the output of each: tokens and symbol table, abstract syntax tree, object code, optimised code.


Library
Pre-written, pre-compiled, tested subroutines a program can call. Pros: saves time, already tested, often optimised. Cons: may not do exactly what is needed, cannot see or change how it works.
Linker
Combines object code with library code into one executable. Static: library code copied into the executable (larger file, self-contained). Dynamic: library stays separate and is linked at runtime (smaller file, shared by programs, may break if the library changes).
Loader
Part of the OS that copies the executable into memory to run. With dynamic linking, it also loads the required libraries.

1.2.3  Software development methodologies

Waterfall
Merits: clear stages and documentation; suits well-defined requirements.

Drawbacks: hard to change once a stage is complete; testing happens late.
Agile
Merits: short iterations with frequent customer feedback; adapts to change.

Drawbacks: less documentation; cost and timescale are harder to predict.
Extreme Programming (XP)
Merits: an agile method using pair programming, test-driven development and frequent releases.

Drawbacks: needs constant customer involvement and disciplined developers.
Spiral model
Merits: iterative, with risk analysis in each cycle; suits large, high-risk projects.

Drawbacks: expensive and complex; depends on accurate risk assessment.
RAD (Rapid Application Development)
Merits: fast delivery through prototyping; heavy user involvement.

Drawbacks: less suited to large, complex systems; depends on users being available.

Algorithms: a precise, ordered set of steps that solves a problem. Written in pseudocode or as a flowchart, followed step by step, and traced to check it works.

1.2.4  Types of programming language

Why paradigms are needed: different problems suit different styles of program. A paradigm gives a structured way to design and write a solution.

Programming paradigms:

Procedural / imperative
A sequence of instructions organised into procedures or functions. Examples: C, Pascal.
Object-oriented (OOP)
Models a problem as objects that hold data (attributes) and behaviour (methods). Examples: Java, C#.
Declarative
States what the result should be, not how to get it. Examples: SQL, Prolog.
Functional
Built on mathematical functions with no side effects. Examples: Haskell, Erlang.

OOP concepts:

Class
Blueprint defining the attributes and methods of a type of object.
Object
An instance of a class, with its own attribute values.
Attribute
A variable belonging to an object, holding one piece of its data.
Method
A subroutine belonging to a class that acts on the object's attributes.
Encapsulation
Bundles attributes and methods together. Attributes are hidden and accessed through methods (getters and setters).
Inheritance
A subclass inherits the attributes and methods of its parent class, so code is reused. An is-a relationship.
Polymorphism
The same method name behaves differently in different classes. Subclasses override parent methods.

Assembly language: follow and write simple programs using the Little Man Computer (LMC) instruction set.

LMC instruction set
MnemonicOperation
INPInput a value into ACC
OUTOutput the value in ACC
LDA xLoad the value at address x into ACC
STA xStore ACC at address x
ADD xACC = ACC + value at x
SUB xACC = ACC − value at x
BRA xBranch always to address x
BRZ xBranch to x if ACC = 0
BRP xBranch to x if ACC ≥ 0
HLTHalt the program
DATStore a data value at a labelled memory location

Addressing modes:

Immediate
The operand is the actual value to use, not an address. An operand of 5 means the number 5.
Direct
The operand is the address of the value. LDA 50 loads the value stored at address 50.
Indirect
The operand is the address of a location that holds the address of the value. Needs an extra memory access.
Indexed
The operand is added to the value in an index register to give the effective address. Used for arrays.

1.3 - Exchanging data

1.3.1  Compression, encryption and hashing

Lossy compression
Permanently removes data, so the original cannot be recovered exactly. Gives smaller files. Used for JPEG images, MP3 audio and MP4 video.
Lossless compression
The original is recovered exactly on decompression. Smaller reduction in size than lossy. Used for text, executables and ZIP files.
Run length encoding (RLE)
Replaces runs of repeated values with a count and the value. AAABBBBA is encoded as 3A4B1A. Works well on images with large areas of one colour.
Dictionary coding
Builds a dictionary of repeated patterns and replaces each with a shorter reference. Effective for text with repeated words or phrases.

Symmetric encryption
The same key encrypts and decrypts. Fast, so suited to large amounts of data. The key must be shared securely. Example: AES.
Asymmetric encryption
A public key encrypts and a private key decrypts. The private key never needs to be shared, but it is slower. Used for key exchange and digital signatures. Example: RSA.

Hashing: a one-way function that turns data into a fixed-length hash. The hash cannot be reversed. Uses: storing passwords (the hash is stored, not the password), checking data integrity, hash tables, digital signatures.

Symmetric is faster but needs a secure way to share the key. Asymmetric solves that but is slower, so TLS uses asymmetric encryption to exchange a symmetric key, which then encrypts the data.

1.3.2  Databases

Flat file
All data in one table. Simple, but causes data redundancy and update anomalies.
Relational database
Data split across related tables, linked by keys. Reduces redundancy. More complex to query.
Primary key
Uniquely identifies each record in a table. Cannot be null.
Foreign key
A field in one table that holds the primary key of another table. Creates the link between them.
Secondary key
A field, not necessarily unique, used for searching. Can be indexed to speed up queries.
Referential integrity
Every foreign key value must match an existing primary key value, or be null. Prevents orphaned records.

Entity relationship modelling
Shows entities (tables), their attributes and the relationships between them: one-to-one, one-to-many, many-to-many. A many-to-many relationship needs a join table.
Capturing, selecting, managing and exchanging data
Capture: forms, sensors, data entry. Select: queries. Manage: insert, update, delete. Exchange: import and export files, e.g. CSV or XML.

Normalisation reduces redundancy by structuring tables:

  • 1NF: no repeating groups; each cell holds one atomic value; each row is unique.
  • 2NF: 1NF, and no partial dependencies (every non-key attribute depends on the whole of a composite primary key).
  • 3NF: 2NF, and no transitive dependencies (non-key attributes depend only on the primary key).

SQL: interpret and modify queries such as:

SELECT column1, column2 FROM table1 INNER JOIN table2 ON table1.id = table2.id WHERE condition ORDER BY column1 ASC;

Also know INSERT INTO, UPDATE ... SET and DELETE FROM.


Transaction processing: ACID

Atomicity
All or nothing. If any part fails, the whole transaction is rolled back.
Consistency
Moves the database from one valid state to another. All rules and constraints hold.
Isolation
Concurrent transactions behave as if run one after another. Intermediate states are not visible to others.
Durability
Once committed, the change survives a system failure.

Record locking stops two users changing the same record at the same time. It can cause deadlock, where two users each wait for a record the other has locked. Redundancy means keeping copies of data, such as backups, so it can be recovered after a failure.

Indexing: creates a separate structure for fast lookups on a field. Speeds up queries but slows INSERT, UPDATE and DELETE.

1.3.3  Networks

Protocol
A set of rules for how data is transmitted between devices, so that different devices and software can communicate.
Standard
An agreed specification that makes hardware and software from different manufacturers compatible. Examples: IEEE 802.11 (Wi-Fi), Ethernet.

Common application protocols:

HTTP / HTTPS
Transfers web pages between browser and server. HTTPS encrypts the connection using TLS.
FTP
Transfers files between a client and a server.
SMTP, POP3, IMAP
SMTP sends email. POP3 downloads mail to one device, usually removing it from the server. IMAP keeps mail on the server so several devices can access it.

TCP/IP stack (4 layers): each layer handles one job and passes data to the layer above or below.

Application layer
Protocols such as HTTP, HTTPS, FTP, SMTP and DNS. Provides network services to applications.
Transport layer
TCP or UDP. Splits data into segments. Port numbers identify services (e.g. 80 for HTTP, 443 for HTTPS).
Internet layer
IP addressing and routing of packets across networks. IPv4 uses 32-bit addresses; IPv6 uses 128-bit addresses.
Link layer
Physical transmission on the local network. MAC addresses identify hardware. Ethernet and Wi-Fi.
TCP (Transmission Control Protocol)
Connection-oriented: a three-way handshake sets up the connection first. Guarantees delivery and correct order. Used where reliability matters (web, email, file transfer).
UDP (User Datagram Protocol)
Connectionless: no handshake, and no guarantee of delivery or order. Lower overhead, so faster. Used for streaming, online gaming and VoIP.

DNS (Domain Name System) translates domain names into IP addresses. A resolver asks root, then TLD, then authoritative name servers. Results are cached to speed up future lookups.

LAN (Local Area Network)
Covers a small area such as a school or office. Owned and managed by the organisation. Uses Ethernet or Wi-Fi.
WAN (Wide Area Network)
Covers a large area using third-party infrastructure such as ISP links. The internet is the largest WAN.
Packet switching
Data is split into packets, each routed independently and reassembled at the destination. Efficient and fault tolerant. Used by the internet.
Circuit switching
A dedicated path is reserved for the whole session. Guaranteed bandwidth, but wasteful when idle. Used in traditional telephone networks.

Network security threats:

Hacking
Unauthorised access to a computer system or network to steal, alter or destroy data.
Malware
Malicious software. Viruses attach to files, worms spread without user action, trojans disguise themselves as legitimate software, and ransomware encrypts files and demands payment.
Denial of Service (DoS / DDoS)
Floods a server or network with traffic so legitimate users cannot access it. DDoS uses many compromised machines (a botnet).
Phishing
Fraudulent messages that impersonate a trusted source to trick users into revealing passwords or card details.
Pharming
Corrupts DNS records or the hosts file so the user is redirected to a fake website, even when the correct address is typed.
Spyware
Secretly collects passwords, keystrokes and browsing habits, and sends them to a third party.

Phishing needs the user to be tricked into acting. Pharming redirects the user automatically, so no mistake by the user is needed.


Network security protection:

Firewall
Filters incoming and outgoing traffic against a set of rules. Packet filtering checks each packet; stateful inspection tracks each connection. Can be hardware or software.
Proxy server
Sits between the client and the internet. Hides the client's IP address, caches content, and can filter or block traffic.
Encryption (TLS/HTTPS)
Protects data in transit. HTTPS uses TLS: asymmetric encryption for the handshake, then symmetric encryption for the data.

Client-server
A central server provides services to clients. Centralised management and security, but the server is a single point of failure.
Peer to peer (P2P)
Each node acts as both client and server. No single point of failure, but harder to manage and secure. Example: BitTorrent.

Network hardware:

Router
Connects different networks (e.g. a LAN to the internet) and routes packets using IP addresses.
Switch
Connects devices within a LAN and sends data only to the intended device, using MAC addresses.
Hub
Connects devices in a LAN but broadcasts all data to every device. Less efficient and less secure than a switch.
NIC (Network Interface Card)
Lets a device connect to a network. Has a unique MAC address.
WAP (Wireless Access Point)
Connects wireless devices to a wired LAN using Wi-Fi.
Modem
Converts digital signals to analogue for phone or cable lines, and back. Connects a LAN to an ISP.

1.3.4  Web technologies

HTML
HyperText Markup Language. Defines the structure and content of a web page using tags such as <h1>, <p>, <a> and <form>.
CSS
Cascading Style Sheets. Defines presentation: colours, fonts and layout. Separates style from content.
JavaScript
Client-side scripting. Adds interactivity and manipulates the DOM in the browser.

Search engine indexing: web crawlers follow links and index page content. The index maps keywords to URLs, so searches are fast.

PageRank: ranks pages by the number and quality of links to them. Links from highly ranked pages count for more. Calculated iteratively across the link graph.

Client-side processing
Code runs on the user's device (usually in the browser, e.g. JavaScript). No server round trip, so fast. Can use local resources. Code is visible to the user.
Server-side processing
Code runs on the server (e.g. PHP, Python, Node.js). Code is hidden from the user and can access databases. Slower, as it needs a network request.

1.4 - Data types, data structures and algorithms

1.4.1  Data types and number representation

Primitive data types: integer, real (floating point), character, string, Boolean.


Two's complement (negative integers):

  • To negate: flip all the bits, then add 1.
  • The MSB has a negative place value. 8-bit range: -128 to +127.
  • Addition works normally. Overflow occurs if the carry into and out of the MSB differ.

Sign and magnitude: the MSB is the sign bit (0 positive, 1 negative). Two representations of zero. Less used in practice.


Hexadecimal: base 16, digits 0 to 9 and A to F. Each hex digit is 4 bits (a nibble). Shorthand for binary, e.g. IPv6 addresses and colour codes.

  • Binary to hex: group the bits into fours from the right and convert each group.
  • Hex to decimal: multiply each digit by its place value (powers of 16) and add.

Floating point: sign bit, mantissa and exponent. Value = mantissa × 2^exponent.

  • Normalisation: shift the mantissa until its first two bits differ (e.g. 01 or 10 in two's complement). This keeps the maximum precision for the number of bits.
  • Addition and subtraction: make the exponents equal by shifting the mantissa of the smaller number, add or subtract the mantissas, then normalise the result.
  • More mantissa bits give greater precision. More exponent bits give greater range.
  • Errors: some decimals cannot be represented exactly in binary, so rounding errors occur.

Bitwise operations:

AND mask
Checks or clears bits. ANDing with 1 keeps the bit; with 0 clears it.
OR mask
Sets bits. ORing with 1 sets the bit; with 0 keeps it.
XOR mask
Toggles bits. XORing with 1 flips the bit; with 0 keeps it.
Logical shift left
Moves bits left, filling with 0s on the right. Each shift multiplies by 2.
Logical shift right
Moves bits right, filling with 0s on the left. Each shift divides by 2 (integer).

Character sets: ASCII uses 7 bits (128 characters, basic Latin). Extended ASCII uses 8 bits (256). Unicode covers all world languages and symbols. UTF-8 is the most common encoding, using 1 to 4 bytes per character.


Binary addition: add column by column from the right. 1+1 = 10 (write 0, carry 1). 1+1+1 = 11 (write 1, carry 1). Overflow occurs when the result needs more bits than are available.

Binary subtraction: negate the number being subtracted (two's complement), then add. Alternatively, subtract column by column, borrowing from the next column when needed.

1.4.2  Data structures

Array
Fixed size, one data type, indexed. Can be 1D, 2D or 3D. Quick to read or write by index; slow to insert or delete.
Record
A group of related fields that can hold different data types. Like one row of a database table.
List
An ordered collection that can grow or shrink. Items can be added and removed.
Tuple
An ordered collection that cannot be changed after it is created.
Stack
LIFO (last in, first out). Operations: push, pop, peek, isEmpty. Used for function calls, undo and backtracking.
Queue
FIFO (first in, first out). Operations: enqueue, dequeue, peek, isEmpty. Used for scheduling and print spooling. A circular queue reuses freed space.
Linked list
Nodes hold data and a pointer to the next node. Dynamic size. No random access: you must traverse from the start.
Tree
Nodes linked parent to child, starting from one root node. Nodes with no children are leaves.
Binary search tree
Each node has at most two children. Left child is smaller than the parent, right child is larger. Searching is fast when the tree is balanced.
Hash table
A key is passed through a hash function to give an index. Fast lookup. Used for dictionaries and caches.
Graph
Vertices joined by edges. Edges can be directed or undirected, and weighted or unweighted. Used for networks and maps.

Know how to create, traverse, add and remove data in each structure, and which structure suits which problem.

1.4.3  Boolean algebra

Logic gates: AND, OR, NOT, NAND, NOR, XOR. Know their symbols and truth tables. Draw a logic gate diagram from a Boolean expression, and write a truth table from a diagram.

Defining a problem: write a Boolean expression from a description. e.g. a light that comes on when there is motion and it is dark: Light = Motion AND (NOT Daylight).


Laws for simplifying expressions:

De Morgan's Laws
¬(A ∧ B) ≡ ¬A ∨ ¬B
¬(A ∨ B) ≡ ¬A ∧ ¬B
Convert between NAND/NOR and AND/OR/NOT.
Distribution
A ∧ (B ∨ C) ≡ (A ∧ B) ∨ (A ∧ C)
A ∨ (B ∧ C) ≡ (A ∨ B) ∧ (A ∨ C)
Association
A ∧ (B ∧ C) ≡ (A ∧ B) ∧ C
A ∨ (B ∨ C) ≡ (A ∨ B) ∨ C
Commutation
A ∧ B ≡ B ∧ A
A ∨ B ≡ B ∨ A
Double negation
¬(¬A) ≡ A

Karnaugh maps (K-maps): a visual method for simplifying Boolean expressions. Group 1s in rectangles of 1, 2, 4 or 8 cells. Larger groups give simpler expressions. Groups can wrap around the edges.


D-type flip-flop: stores 1 bit. Output Q takes the value of input D on the rising clock edge. Used in registers and memory.

Half adder: adds two 1-bit inputs. Sum = A XOR B. Carry = A AND B.

Full adder: adds two 1-bit inputs and a carry in. Built from two half adders and an OR gate for the carry out. Used for multi-bit addition.

1.5 - Legal, moral, cultural and ethical issues

1.5.1  Computing-related legislation

Data Protection Act 1998
Controls how personal data is collected, stored and used. Data must be fairly obtained, used only for its stated purpose, accurate, kept no longer than necessary and kept secure. People have the right to access their data. Superseded by the Data Protection Act 2018 and UK GDPR.
Computer Misuse Act 1990
Three offences: (1) unauthorised access to computer material, (2) unauthorised access with intent to commit a further offence, (3) unauthorised modification of computer material (e.g. malware, deleting files).
Copyright, Designs and Patents Act 1988
Protects original works (software, music, text, images) from being copied without permission. Software piracy is illegal. Licences set the permitted use.
Regulation of Investigatory Powers Act 2000 (RIPA)
Governs the interception of communications. Allows authorised bodies to monitor communications, including internet and phone.

1.5.2  Moral and ethical issues

Computers in the workforce
Automation can displace workers while creating new jobs. De-skilling. A digital divide between those with and without digital skills.
Automated decision making
Algorithms make decisions such as loan approvals or hiring. Concerns: bias, lack of transparency, accountability and the right to an explanation.
Artificial intelligence
Benefits: healthcare, efficiency and safety. Risks: job losses, bias, autonomous weapons and loss of human control.
Environmental effects
Data centres use large amounts of energy. E-waste from discarded devices. Carbon footprint of the internet. Green computing reduces these effects.
Censorship and the internet
Governments and companies blocking content. Balancing protection (e.g. of children) against free speech.
Monitoring behaviour
Employers monitoring staff, government surveillance and smart devices collecting data. Issues of consent and transparency.
Analysing personal information
Big data analysis and targeted advertising. Data protection law limits how personal data is used, but commercial interests push the other way.
Piracy and offensive communications
Illegal copying of software and media. Cyberbullying, hate speech and extremism online. Moderating content at scale is difficult.
Layout, colour and character sets
Layout and colour conventions vary between cultures (e.g. reading direction, colour meanings). Interfaces need character sets, such as Unicode, that support every user's language.