A-Level Computer Science: Last-Minute Revision Notes | A-Level 计算机:考前冲刺笔记

📚 A-Level Computer Science: Last-Minute Revision Notes | A-Level 计算机:考前冲刺笔记

This comprehensive revision guide covers the essential topics for A-Level Computer Science, presented in concise, bilingual bullet points to help you review key concepts quickly before the exam. Each section pairs an English explanation with its Chinese equivalent, ensuring clarity and reinforcing understanding across fundamental areas such as data representation, logic, architecture, algorithms, and more.

这份全面的复习指南涵盖了A-Level计算机科学的核心主题,以简洁的双语要点呈现,帮助你在考前快速回顾关键概念。每一节都将英文解释与对应的中文配对,确保清晰易懂,并强化对数据表示、逻辑、体系结构、算法等基础领域的理解。

1. Data Representation | 数据表示

Computers use binary (base-2) because digital circuits have only two stable states: ON (1) and OFF (0).

计算机使用二进制(基数为2),因为数字电路只有两种稳定状态:开(1)和关(0)。

Hexadecimal (base-16) is a shorthand for binary. Each hex digit represents exactly 4 bits (a nibble). For example, 1101 0111₂ becomes D7₁₆.

十六进制(基数为16)是二进制的简写形式。每个十六进制数字恰好代表4个比特(一个半字节)。例如,1101 0111₂ 变成 D7₁₆。

Negative integers are commonly stored using two’s complement. In an 8-bit system, the most significant bit (MSB) indicates sign, and the range is -128 to +127.

负整数通常用补码(two’s complement)存储。在8位系统中,最高有效位(MSB)表示符号,范围是-128到+127。

Real numbers are represented with floating-point notation: ±mantissa × 2^exponent. Normalisation ensures maximum precision by adjusting the mantissa so the first bit after the sign is different from the sign bit.

实数用浮点记数法表示:±尾数 × 2^指数。规范化通过调整尾数使得符号位之后的第一位与符号位不同,从而保证最大精度。

Character encoding standards include ASCII (7-bit, 128 characters) and Unicode (up to 32-bit), which can represent characters from almost all writing systems.

字符编码标准包括ASCII(7位,128个字符)和Unicode(最多32位),后者能表示几乎所有书写系统的字符。


2. Logic Gates and Boolean Algebra | 逻辑门与布尔代数

The fundamental logic gates are AND, OR, NOT, NAND, NOR, and XOR. NAND and NOR are known as universal gates because any Boolean function can be implemented using only NANDs or only NORs.

基本逻辑门有与、或、非、与非、或非和异或。与非门和或非门被称为通用门,因为任何布尔函数都可以仅用与非门或仅用或非门来实现。

A truth table lists all possible input combinations and the corresponding output. For an AND gate, output is 1 only when all inputs are 1.

真值表列出所有可能的输入组合及其对应的输出。对于与门,只有当所有输入都为1时,输出才为1。

Boolean expressions can be simplified using algebraic laws (commutative, associative, distributive, De Morgan’s) or Karnaugh maps (K-maps) to minimise the number of logic gates required.

布尔表达式可以通过代数定律(交换律、结合律、分配律、德摩根定律)或卡诺图(K-map)进行简化,以减少所需逻辑门的数量。

De Morgan’s laws state: ¬(A ∧ B) = ¬A ∨ ¬B and ¬(A ∨ B) = ¬A ∧ ¬B. These are essential for converting circuits to use only NAND or NOR gates.

德摩根定律指出:¬(A ∧ B) = ¬A ∨ ¬B 以及 ¬(A ∨ B) = ¬A ∧ ¬B。这对于将电路转换为仅使用与非门或或非门至关重要。

A half adder adds two bits and produces a sum (S) and a carry (C). S = A XOR B, C = A AND B. A full adder includes a carry-in input, allowing chaining for multi-bit addition.

半加器将两个比特相加,产生和(S)和进位(C)。S = A异或B,C = A与B。全加器加入了一个进位输入,从而可以级联实现多比特加法。


3. Computer Architecture | 计算机体系结构

The Von Neumann architecture stores both data and instructions in the same memory, using a single shared bus. This creates the ‘Von Neumann bottleneck’ because the CPU may wait while fetching data and instructions sequentially.

冯·诺依曼体系结构将数据和指令存储在同一内存中,使用单一共享总线。这就产生了“冯·诺依曼瓶颈”,因为CPU在顺序提取数据和指令时可能需要等待。

Key CPU components: Control Unit (CU) decodes instructions and directs operations; Arithmetic Logic Unit (ALU) performs calculations; Registers (PC, MAR, MDR, CIR, ACC) hold temporary data and addresses.

主要的CPU组件:控制单元(CU)解码指令并指挥操作;算术逻辑单元(ALU)执行计算;寄存器(PC、MAR、MDR、CIR、ACC)保存临时数据和地址。

The fetch-decode-execute cycle: PC -> MAR -> address bus -> memory -> MDR -> CIR; CU decodes; then execute may involve ALU and ACC. The cycle repeats indefinitely.

取指-解码-执行周期:PC -> MAR -> 地址总线 -> 内存 -> MDR -> CIR;CU解码;然后执行可能涉及ALU和ACC。该周期无限重复。

Factors affecting CPU performance: clock speed (GHz), number of cores, cache size and levels, and word length. Pipelining improves throughput by overlapping instruction stages.

影响CPU性能的因素:时钟频率(GHz)、内核数量、缓存大小和级别、以及字长。流水线技术通过重叠指令阶段来提高吞吐量。

Main memory (RAM) is volatile; secondary storage (HDD, SSD) is non-volatile. SSDs use flash memory with no moving parts, providing faster access but limited write cycles compared to HDDs.

主存储器(RAM)是易失性的;辅助存储器(HDD、SSD)是非易失性的。SSD使用没有移动部件的闪存,访问速度更快,但与HDD相比写入寿命有限。


4. Operating Systems | 操作系统

An operating system (OS) manages hardware resources and provides services for application software. Key functions: memory management, process scheduling, file management, I/O handling, and security.

操作系统(OS)管理硬件资源并为应用软件提供服务。关键功能:内存管理、进程调度、文件管理、输入输出处理和安全。

Process scheduling algorithms: Round-Robin (time slices, fair), Shortest Job First (minimises waiting time), and Priority-based scheduling. Context switching saves/restores process state.

进程调度算法:轮转调度(时间片,公平)、最短作业优先(最小化等待时间)和基于优先级的调度。上下文切换会保存并恢复进程状态。

Memory management uses paging and segmentation. Virtual memory allows execution of processes larger than physical RAM by swapping pages to disk, but excessive swapping (thrashing) degrades performance.

内存管理使用分页和分段。虚拟内存通过将页面交换到磁盘,允许执行比物理RAM大的进程,但过多的交换(抖动)会降低性能。

Interrupts signal the CPU to suspend current task and execute an Interrupt Service Routine (ISR). Interrupts can be hardware (I/O, timer) or software (exceptions). The CPU checks for interrupts at the end of each FDE cycle.

中断信号通知CPU暂停当前任务并执行中断服务程序(ISR)。中断可以是硬件中断(I/O、定时器)或软件中断(异常)。CPU在每个取指-执行周期结束时检查中断。

BIOS (Basic Input Output System) initialises hardware during boot and loads the bootloader; UEFI is its modern replacement with a graphical interface and support for larger drives.

BIOS(基本输入输出系统)在启动过程中初始化硬件并加载引导程序;UEFI是其现代替代品,具有图形界面并支持更大的驱动器。


5. Networking Basics | 网络基础

Networks can be classified by scale: LAN (Local Area Network), WAN (Wide Area Network) and PAN (Personal Area Network). Topologies include star, bus, mesh, and ring; star is common due to ease of troubleshooting.

网络按规模分类:局域网(LAN)、广域网(WAN)和个域网(PAN)。拓扑结构包括星型、总线型、网状和环形;星型因为易于排错而常见。

The TCP/IP stack: Application (HTTP, FTP, SMTP), Transport (TCP, UDP), Internet (IP), Link (Ethernet, Wi-Fi). TCP provides reliable, connection-oriented delivery using acknowledgements and retransmission; UDP is connectionless and faster but unreliable.

TCP/IP协议栈:应用层(HTTP、FTP、SMTP)、传输层(TCP、UDP)、互联网层(IP)、链路层(以太网、Wi-Fi)。TCP通过确认和重传提供可靠的、面向连接的传输;UDP是无连接、更快但不可靠的。

IP addressing: IPv4 is 32-bit, written in dotted decimal; IPv6 is 128-bit, using hexadecimal blocks. Subnet masks determine the network portion of an IP address.

IP地址:IPv4为32位,用点分十进制书写;IPv6为128位,使用十六进制块。子网掩码确定IP地址的网络部分。

DNS (Domain Name System) translates human-readable domain names to IP addresses. A URL consists of protocol, domain, path, and optionally port.

DNS(域名系统)将人类可读的域名转换为IP地址。URL由协议、域名、路径以及可选的端口组成。

Network hardware: router (connects networks, forwards packets based on IP), switch (connects devices in a LAN, forwards frames based on MAC), hub (obsolete, repeats signals to all ports).

网络硬件:路由器(连接网络,基于IP转发数据包)、交换机(连接局域网内的设备,基于MAC转发帧)、集线器(已过时,将信号中继到所有端口)。


6. Data Structures | 数据结构

An array stores elements of the same type in contiguous memory locations. Access is O(1) using an index, but insertion/deletion in the middle is O(n) due to shifting.

数组将相同类型的元素存储在连续的内存位置中。通过索引访问的时间复杂度为O(1),但由于需要移动元素,中间插入/删除的时间复杂度为O(n)。

A linked list consists of nodes, each holding data and a pointer to the next node. It allows efficient O(1) insertion/deletion at the head, but accessing an element requires O(n) traversal.

链表由节点组成,每个节点包含数据和指向下一个节点的指针。它可以在头部以O(1)高效地插入/删除,但访问元素需要O(n)的遍历。

A stack is a LIFO (Last In, First Out) structure; operations are push (add) and pop (remove). It is used in function calls to store return addresses, and for syntax parsing.

堆栈是一种后进先出(LIFO)的结构;操作是压入(添加)和弹出(移除)。它用于函数调用中存储返回地址,以及语法解析。

A queue is a FIFO (First In, First Out) structure; operations are enqueue (add to rear) and dequeue (remove from front). It is used in task scheduling and buffers.

队列是一种先进先出(FIFO)的结构;操作是入队(添加到队尾)和出队(从队首移除)。它用于任务调度和缓冲区。

A binary tree has nodes with at most two children. A binary search tree (BST) maintains order: left child < parent < right child, enabling O(log n) search on average. Tree traversal: pre-order, in-order, post-order.

二叉树的每个节点最多有两个子节点。二叉搜索树(BST)保持顺序:左子节点 < 父节点 < 右子节点,平均搜索时间复杂度为O(log n)。树的遍历:前序、中序、后序。


7. Algorithms and Complexity | 算法与复杂度

Big O notation describes the upper bound of an algorithm’s time or space complexity. Common classes: O(1) constant, O(log n) logarithmic, O(n) linear, O(n log n) linearithmic, O(n²) quadratic, O(2ⁿ) exponential.

大O表示法描述算法时间或空间复杂度的上界。常见类别:O(1)常量、O(log n)对数、O(n)线性、O(n log n)线性对数、O(n²)平方、O(2ⁿ)指数。

Search algorithms: linear search O(n) works on unsorted data; binary search O(log n) requires sorted array and repeatedly divides search interval in half.

搜索算法:线性搜索O(n)用于未排序数据;二分搜索O(log n)需要已排序数组,并反复将搜索区间减半。

Sorting algorithms: bubble sort O(n²) is simple but inefficient; merge sort O(n log n) uses divide and conquer, stable; quick sort O(n log n) average, O(n²) worst case. Insertion sort O(n²) is efficient for small or nearly sorted datasets.

排序算法:冒泡排序O(n²)简单但低效;归并排序O(n log n)采用分治策略,稳定;快速排序平均O(n log n),最坏O(n²)。插入排序O(n²)适用于小数据集或近似排序的数据。

Dijkstra’s algorithm finds the shortest path in a weighted graph. A* search uses heuristics (estimated cost to goal) to improve efficiency. Both are used in routing and game AI.

迪杰斯特拉算法找出加权图中的最短路径。A*搜索使用启发式(到目标的估计代价)来提高效率。两者都用于路由和游戏AI。

Recursion: a function calls itself with a base case to terminate. It naturally matches problems like tree traversal and factorial, but can cause stack overflow if not designed carefully.

递归:函数调用自身,并设置基本情况以终止。它自然地解决树遍历和阶乘等问题,但如果设计不当可能导致堆栈溢出。


8. Programming Paradigms and Fundamentals | 编程范式与基础

Key programming constructs: sequence, selection (if-else, switch), and iteration (for, while, do-while). These are the building blocks of structured programming.

关键编程结构:顺序、选择(if-else、switch)和迭代(for、while、do-while)。这些是结构化编程的构建块。

Procedural programming uses procedures/functions to break tasks into steps. It emphasises modularity and code reuse. Variables can be local or global.

过程式编程使用过程/函数将任务分解为步骤。它强调模块化和代码重用。变量可以是局部或全局的。

Object-oriented programming (OOP) models entities as objects with attributes (fields) and behaviours (methods). Core principles: encapsulation, inheritance, polymorphism, and abstraction. A class is a blueprint; an object is an instance.

面向对象编程(OOP)将实体建模为具有属性(字段)和行为(方法)的对象。核心原则:封装、继承、多态和抽象。类是蓝图;对象是实例。

Data types: integer, real/float, char, string, Boolean. Type casting converts between compatible types. Constants are named values that cannot change during execution.

数据类型:整型、实型/浮点型、字符型、字符串型、布尔型。类型转换在兼容类型之间进行转换。常量是在执行过程中不能更改的命名值。

Integrated Development Environments (IDEs) provide features like syntax highlighting, auto-completion, debugger, and version control integration to improve programmer productivity.

集成开发环境(IDE)提供语法高亮、自动完成、调试器和版本控制集成等功能,以提高程序员的生产效率。


9. Databases | 数据库

A relational database organises data into tables (relations) with rows (records/tuples) and columns (attributes/fields). Each table has a primary key that uniquely identifies each row.

关系数据库将数据组织成表(关系),表由行(记录/元组)和列(属性/字段)组成。每个表都有一个能唯一标识每行的主键。

Foreign keys link tables together, establishing relationships (one-to-one, one-to-many, many-to-many via a junction table). Referential integrity ensures foreign key values match existing primary keys.

外键将表关联起来,建立关系(一对一、一对多、通过连接表实现多对多)。参照完整性确保外键值与现有的主键匹配。

Normalisation reduces data redundancy. 1NF: atomic values, no repeating groups. 2NF: 1NF + all non-key attributes depend on the whole primary key. 3NF: 2NF + no transitive dependencies on non-key attributes.

规范化减少数据冗余。1NF:原子值,无重复组。2NF:1NF +所有非键属性依赖于整个主键。3NF:2NF +不存在对非键属性的传递依赖。

SQL (Structured Query Language) is used to query and manipulate databases. Key commands: SELECT, FROM, WHERE, INSERT, UPDATE, DELETE, JOIN (INNER, LEFT, RIGHT).

SQL(结构化查询语言)用于查询和操作数据库。关键命令:SELECT、FROM、WHERE、INSERT、UPDATE、DELETE、JOIN(内连接、左连接、右连接)。

Database Management Systems (DBMS) like MySQL, PostgreSQL, and Oracle handle concurrency, access control, and backup. ACID properties (Atomicity, Consistency, Isolation, Durability) ensure reliable transactions.

数据库管理系统(DBMS)如MySQL、PostgreSQL和Oracle处理并发、访问控制和备份。ACID属性(原子性、一致性、隔离性、持久性)确保可靠的事务。


10. System Security and Ethics | 系统安全与伦理

Encryption transforms plaintext into ciphertext. Symmetric encryption (e.g., AES) uses the same key for encryption and decryption; asymmetric encryption (e.g., RSA) uses a public/private key pair.

加密将明文转换为密文。对称加密(如AES)使用相同的密钥进行加密和解密;非对称加密(如RSA)使用公钥/私钥对。

Digital signatures and certificates verify authenticity and integrity. A digital signature is created by encrypting a hash of the message with the sender’s private key.

数字签名和证书验证真实性和完整性。数字签名通过使用发送方的私钥加密消息的哈希值来创建。

Common threats: malware (virus, worm, Trojan), phishing, SQL injection, DDoS attacks. Firewalls monitor incoming/outgoing traffic; anti-malware software detects and removes malicious code.

常见威胁:恶意软件(病毒、蠕虫、特洛伊木马)、网络钓鱼、SQL注入、DDoS攻击。防火墙监控进出流量;反恶意软件检测并移除恶意代码。

Computer ethics covers issues like data privacy (GDPR), intellectual property (software piracy), digital divide, and the environmental impact of computing. Professional bodies publish codes of conduct.

计算机伦理涵盖数据隐私(GDPR)、知识产权(软件盗版)、数字鸿沟以及计算对环境的影响等问题。专业机构发布行为准则。

Authentication methods: something you know (password), something you have (token), something you are (biometrics). Multi-factor authentication combines multiple methods for stronger security.

身份验证方法:你知道的(密码)、你拥有的(令牌)、你固有的(生物特征)。多因素认证结合多种方法以提供更强的安全性。


11. Software Development Methods | 软件开发方法

The software development life cycle (SDLC) typically includes: analysis, design, implementation, testing, deployment, and maintenance. Different models emphasise these stages differently.

软件开发生命周期(SDLC)通常包括:分析、设计、实现、测试、部署和维护。不同的模型对这些阶段的侧重不同。

The waterfall model is a linear sequential approach where each phase must be completed before the next begins. It is rigid but suitable for projects with well-understood requirements.

瀑布模型是一种线性顺序方法,每个阶段必须在下一个阶段开始之前完成。它很死板,但适用于需求明确的项目。

Agile development is iterative and incremental; requirements evolve through collaboration between self-organising cross-functional teams. Scrum and Kanban are popular frameworks.

敏捷开发是迭代和增量的;需求通过自组织跨功能团队的协作来演进。Scrum和看板是流行的框架。

Testing levels: unit testing (individual components), integration testing (interaction between units), system testing (complete system), and acceptance testing (user validation). Test data should include normal, boundary, and erroneous inputs.

测试级别:单元测试(各个组件)、集成测试(单元之间的交互)、系统测试(完整系统)和验收测试(用户验证)。测试数据应包括正常、边界和错误输入。

Beta testing releases a near-complete version to a limited set of real users to gather feedback before full launch. Black-box testing checks functionality without knowledge of internal code; white-box testing examines internal logic.

Beta测试在全面发布前将接近完成的版本发布给有限的一组真实用户以收集反馈。黑盒测试在不了解内部代码的情况下检查功能;白盒测试检查内部逻辑。


12. Common Pitfalls and Quick Tips | 常见陷阱与速成技巧

When doing two’s complement conversions, remember to flip all bits and add 1 to get the negative representation. The range for n bits is -2^(n-1) to 2^(n-1)-1.

在进行补码转换时,记得将所有位取反再加1得到负数表示。n位的范围是-2^(n-1)到2^(n-1)-1。

In floating point, normalisation always aims to have the first bit after the sign opposite to the sign bit. A hidden bit (1) is often assumed for the mantissa in standard formats, increasing precision.

在浮点数中,规范化总是要使符号位后的第一位与符号位不同。标准格式中尾数通常隐含一个隐藏位(1),从而提高精度。

For logic circuit simplification, a common mistake is misinterpreting De Morgan’s law when breaking a bar over multiple variables. Use brackets carefully: ¬(A·B) = ¬A + ¬B.

在逻辑电路简化中,常见错误是拆分多个变量上的取反横线时误解德摩根定律。要小心使用括号:¬(A·B) = ¬A + ¬B。

When tracing algorithms with arrays, check for off-by-one errors (e.g., using <= instead of < in loop conditions). Indexes typically start at 0 in most languages, but some pseudocode uses 1.

在用数组跟踪算法时,检查差一错误(例如在循环条件中使用 <= 而不是 <)。多数语言中索引通常从0开始,但一些伪代码使用1。

In SQL, remember that strings are enclosed in single quotes (‘ ‘) and that pattern matching uses LIKE with % (any sequence) and _ (single character). A semicolon ends a statement.

在SQL中,记住字符串用单引号(’ ‘)括起来,模式匹配使用LIKE加上%(任意序列)和_(单个字符)。分号结束一条语句。

During exams, carefully identify whether a question refers to source code, object code, or intermediate representations like bytecode. Clarify the difference between compilers (entire code to machine code) and interpreters (line-by-line execution).

考试时,仔细辨别问题指的是源代码、目标代码还是像字节码这样的中间表示。澄清编译器(整个代码转为机器码)和解释器(逐行执行)之间的区别。


Published by TutorHao | Computer Science Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading