Docsity

AQA A-LEVEL COMPUTER SCIENCE PAPER 2, Study notes of Computer Science

Toggle sidebar
bg1
AQA A-LEVEL COMPUTER SCIENCE PAPER 2
PART I: FUNDAMENTALS OF DATA
REPRESENTATION
1. Number Systems and Conversions
1.1 Binary (Base-2)
Definition:A number system using only two digits:0and1.
Place Values:Each position represents a power of 2 (rightmost = 2⁰
= 1).
Converting Decimal to Binary:
oRepeatedly divide the decimal number by 2, recording
remainders.
oRead remainders from bottom to top.
oExample:42₁₀ = 32 + 8 + 2 =101010₂.
1.2 Hexadecimal (Base-16)
Definition:A number system using 16 digits: 0-9 and A-F (A=10,
B=11, C=12, D=13, E=14, F=15).
Why Use Hexadecimal?
oEasier for humansto read and write than binary .
oDirectly maps to groups of four binary digits(nibbles) .
oReduces the number of digitsneeded to represent large
binary values .
Converting Hexadecimal to Decimal:
oEach position represents a power of 16.
oExample:1F₁₆ = 1×16 + 15 =31₁₀.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b

Partial preview of the text

Download AQA A-LEVEL COMPUTER SCIENCE PAPER 2 and more Study notes Computer Science in PDF only on Docsity!

AQA A-LEVEL COMPUTER SCIENCE PAPER 2

PART I: FUNDAMENTALS OF DATA

REPRESENTATION

1. Number Systems and Conversions

1.1 Binary (Base-2)Definition: A number system using only two digits: 0 and 1.  Place Values: Each position represents a power of 2 (rightmost = 2⁰ = 1).  Converting Decimal to Binary: o Repeatedly divide the decimal number by 2, recording remainders. o Read remainders from bottom to top. o Example: 42₁₀ = 32 + 8 + 2 = 101010₂. 1.2 Hexadecimal (Base-16)Definition: A number system using 16 digits: 0-9 and A-F (A=10, B=11, C=12, D=13, E=14, F=15).  Why Use Hexadecimal? o Easier for humans to read and write than binary. o Directly maps to groups of four binary digits (nibbles). o Reduces the number of digits needed to represent large binary values.  Converting Hexadecimal to Decimal: o Each position represents a power of 16. o Example: 1F₁₆ = 1×16 + 15 = 31₁₀.

Converting Binary to Hexadecimal: o Group binary digits into sets of 4 (from right), then convert each group. o Example: 1100 1101₂ = CD₁₆ (C=12, D=13). 1.3 Binary to Hexadecimal Quick Reference Binar y He x Binar y He x Binar y He x Binar y He x 0000 0 0100 4 1000 8 1100 C 0001 1 0101 5 1001 9 1101 D 0010 2 0110 6 1010 A 1110 E 0011 3 0111 7 1011 B 1111 F

2. Binary Arithmetic and Representations

2.1 Signed Integers: Two's ComplementPurpose: Represents both positive and negative integers in binary.  How It Works: o Positive numbers: Same as standard binary. o Negative numbers: Invert all bits (find one's complement) and add 1.  Calculating Decimal Value of a Two's Complement Number: o The most significant bit (MSB) represents -128 (for 8-bit). o Add all place values where bits are 1. o Example: 11111101₂  MSB = -  Other 1s: 64 + 32 + 16 + 8 + 4 + 1 = 125  Total = -128 + 125 = -

4.5 MB (binary) = 4.5 × 1024 × 1024 = 4,718,592 bytes.

4. Character Encoding

Encoding Bits per Character Number of Characters Key Features ASCII 7 bits

characters English alphabet, digits, punctuation, control characters Extended ASCII 8 bits

characters Adds European accented characters Unicode Variable (UTF- 8, UTF-16) Over 100,000+ Supports all world languages, emojis, historical scripts Why Unicode is Preferred:  Supports a much larger set of symbols and scripts from many languages.  Backward compatible with ASCII (UTF-8 uses same codes for ASCII characters).  Universal standard used across all modern platforms.

5. Digital Audio Representation

5.1 Sampling

Sampling Rate: The number of samples taken per second, measured in Hz (hertz). o Example: 44.1 kHz = 44,100 samples per second.  Nyquist-Shannon Sampling Theorem: o To perfectly reconstruct an analogue signal, the sampling rate must be at least twice the highest frequency component present in the signal. o This prevents aliasing (distortion caused by insufficient sampling). 5.2 Quantisation and Bit DepthBit Depth: The number of bits used to represent each sample.  Number of Quantisation Levels: 2^(bit depth). o 16-bit audio = 2¹⁶ = 65,536 levels.  Effect of Higher Bit Depth: o More accurate representation of the original analogue signal. o Higher signal-to-noise ratio (SNR). o Larger file size. 5.3 File Size CalculationFormula: File Size (bits) = Sample Rate × Bit Depth × Number of Channels × Duration (seconds)  Example: 44.1 kHz, 16-bit stereo, 1 minute o = 44,100 × 16 × 2 × 60 = 84,672,000 bits = 10,584,000 bytes ≈ 10.1 MB

6. Digital Image Representation

6.1 Bitmap ImagesResolution: The number of pixels in the image (e.g., 1024 × 768).  Colour Depth (Bit Depth): Number of bits used per pixel. o 24-bit colour = 16,777,216 colours (true colour).  File Size Calculation:

Method: Build a binary tree based on character frequencies; traverse tree to generate codes. PART II: COMPUTER SYSTEMS AND ARCHITECTURE

1. CPU Architecture

1.1 The Fetch-Execute CycleDefinition: The fundamental operation of a CPU—the process by which the CPU retrieves a program instruction from memory and executes it. Stage Description Fetch The CPU retrieves the next instruction from memory (address held in PC) and store it in the CIR. Decod e The CPU interprets the instruction (what operation to perform) and identifies operands. Execu te The CPU performs the operation (using the ALU) and writes results back to registe or memory. 1.2 CPU Registers Register Description Program Counter (PC) Holds the address of the next instruction to b fetched. Incremented after each fetch.

Register Description Memory Address Register (MAR) Holds the address of the memory location being read from or written to. Memory Data Register (MDR) / Memory Buffer Register (MBR) Holds the data fetched from memory (or data to written to memory). Current Instruction Register (CIR) Holds the current instruction being executed. Accumulator (ACC) Stores the result of ALU operations. Status Register (SR) Contains flags (e.g., zero, carry, overflow, negati set by ALU operations. 1.3 The Arithmetic Logic Unit (ALU)Function: Responsible for performing arithmetic and logical operations.  Arithmetic Operations: Addition, subtraction, multiplication, division.  Logical Operations: AND, OR, NOT, XOR.  Shift Operations: Left/right shifts. 1.4 The Control Unit (CU)Function: Controls the flow of data between memory, ALU, and registers.  Responsibilities: o Decodes instructions. o Generates control signals. o Manages the fetch-execute cycle. o Handles interrupts.

2. Von Neumann vs. Harvard Architecture

Level Speed Size Cost (per bit) Volatility HDD Slowest Very large (TB+) Lowest Non- volatile 3.1 Cache MemoryDefinition: A small, fast memory located close to the CPU.  Purpose: Stores frequently used data and instructions to reduce access time.  Levels: L1 (fastest, smallest), L2, L3 (larger, slower).  Principle of Locality: Programs tend to access data and instructions that are near previously accessed ones. 3.2 Virtual MemoryDefinition: A technique that uses disk space to supplement RAM.  Main Advantage: Allows programs to run that are larger than physical memory.  Paging: Divides physical and logical memory into fixed-size blocks called pages.  Performance: Slower than RAM due to disk access (page faults cause huge delays). 3.3 EPROM (Erasable Programmable Read-Only Memory)Definition: A type of memory that can be erased with ultraviolet light and reprogrammed.  Characteristics: Non-volatile; used for firmware (BIOS/UEFI).

4. CPU Performance Factors

Factor Impact on Performance Clock Speed Higher clock speed = more cycles per second = faster execution.

Factor Impact on Performance Number of Cores More cores = ability to execute multiple threads simultaneously. Cache Size Larger cache = fewer main memory accesses = faster performance. Word Size Larger word size = more data processed per instruction. Pipelining Overlaps instruction stages for higher throughput. RISC vs. CISC RISC = simpler, faster instructions; CISC = complex, slower instructions b fewer needed.

5. Instruction Set Architectures

Feature CISC (Complex Instruction Set Computer) RISC (Reduced Instruction Set Computer) Instruction Complexity Large number of complex instructions. Small set of simple instructions Instruction Length Variable length. Fixed length (usually 32 bits). Addressing Modes Many addressing modes. Few addressing modes. Memory Access Instructions can directly access memory. Load-store architecture (only load/st access memory). Examples x86 (Intel, AMD). ARM (uses RISC design).

7.1 InterruptsDefinition: A signal to the CPU that requires immediate attention.  Types of Interrupts: o Hardware Interrupts: Generated by I/O devices (e.g., keyboard input, disk completion). o Software Interrupts: Generated by programs (e.g., system calls). o Timer Interrupts: Generated by the system timer (enables multi-tasking).  Interrupt Handler: A special routine that processes the interrupt. 7.2 Context SwitchingDefinition: The process of switching the CPU from one process to another.  Process:

  1. Save the state of the current process (registers, PC, etc.).
  2. Load the saved state of the next process.
  3. Resume execution of the new process.  Importance: Enables multi-tasking (seems like multiple programs are running simultaneously).

8. Multi-Core Processors

Definition: A CPU with multiple independent processing units (cores).  Function: Each core can independently run a separate thread or process.  Advantages: o True parallel execution. o Improved performance for multi-threaded applications. o Better responsiveness for multi-tasking.

PART III: COMMUNICATION AND NETWORKING

1. OSI Model (7 Layers)

Lay er Name Function Protocols 7 Applicatio n Provides network services to user applications.

HTTP, FTP,

SMTP, DNS

Presentati on Data formatting, encryption, compression.

SSL/TLS, JPEG,

MPEG

5 Session Establishes, manages, and terminates sessions between applications. NetBIOS, RPC 4 Transport End-to-end communication, error checking, flow control.

TCP, UDP

3 Network Routing packets across networks. IP, ICMP, RIP 2 Data Link Node-to-node delivery, error detection, framing. Ethernet, Wi-Fi (MAC) 1 Physical Transmission of raw bits over physical medium. Ethernet cables, radio waves Mnemonic: "Please Do Not Throw Sausage Pizza Away" (Physical → Application).

Protocol Port Purpose SSH 22 Secure remote login (encrypted) Telnet 23 Remote login (unencrypted, insecure)

4. IP Addressing

4.1 IPvStructure: 32-bit address divided into four octets (e.g., 192.168.1.1).  Subnet Mask: Divides the IP address into network and host parts.  Private IP Address Ranges: Not routable on the internet; used for internal networks. o 192.168.0.0/16 (e.g., 192.168.1.1) o 10.0.0.0/ o 172.16.0.0/  Public IP Addresses: Routable on the internet (e.g., 8.8.8.8, 1.1.1.1). 4.2 IPvStructure: 128-bit address in hexadecimal notation with colons.  Example: 2001:db8::.  Advantages: Huge address space, built-in security, simplified header. 4.3 DNS (Domain Name System)Purpose: Translates human-readable domain names into IP addresses .  Operation: Computers query DNS servers to resolve names. 4.4 MAC AddressesDefinition: A 48-bit unique identifier assigned to a network interface.  Purpose: Physical hardware address used for communication within a LAN.

Format: Hexadecimal, separated by colons or hyphens (e.g., 00:1A:2B:3C:4D:5E).

5. Networking Devices

Device Layer Function Hub Physical (Layer 1) Amplifies and broadcasts signals to all ports. Bridge Data Link (Layer

Connects two network segments; filters based on MAC addresses. Switch Data Link (Layer

Forwards frames based on MAC addresses within a LAN. Router Network (Layer

Forwards packets based on IP addresses. Gatewa y Up to Application Connects different network architectures.

6. Network Topologies

Topolog y Description Advantages Disadvantages Star Each device connected to a central Easy to manage; single device failure doesn't Central hub is a single point of failure.

7.2 BandwidthDefinition: The maximum data transfer rate of a network path.  Measured in: Bits per second (bps), Kbps, Mbps, Gbps.  Note: Not to be confused with throughput (actual data transferred).

8. Security and Encryption

Term Definition Encryption Scrambling data so only authorised parties can read it (e.g., AES). HTTPS Secure HTTP using TLS/SSL encryption. Digital Signature Provides authentication and non-repudiation. Firewall Controls network traffic (packet-filtering, stateful inspection, application-level gateway). Phishing Tricking individuals into revealing sensitive information by posing as a legitimate entity. Two-Factor Authentication (2FA) Requires two different types of evidence (e.g., password SMS code). Distributed Denial of Service (DDoS) Overwhelming a target with traffic from multiple sources. 8.1 SteganographyDefinition: The practice of hiding a secret message within another non-secret file (e.g., an image).

Difference from Cryptography: Steganography hides the existence of the message, while cryptography hides the content. PART IV: DATABASES AND BIG DATA

1. The Relational Model

Definition: Data is organised into tables (relations) with rows and columns.  Tables (Relations): A collection of related data.  Rows (Records/Tuples): Each row represents a single instance.  Columns (Fields/Attributes): Each column represents a specific attribute of the data.

2. Keys in Relational Databases

Key Type Description Primary Key A column (or set of columns) that uniquely identifies each row in a table. Foreign Key A column that references the primary key of another table. Candidate Key An attribute that could serve as a primary key. Composite Key A primary key made up of two or more columns.