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

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

This last-minute revision guide condenses the essential topics from IB and WJEC Computer Science syllabi into concise, bilingual notes. Whether you’re reviewing for the IB Diploma or the WJEC AS/A level, these notes focus on core concepts that appear across both curricula. Each section provides key definitions, principles, and exam tips to help you quickly reinforce your understanding before the exam.

本冲刺笔记将IB和WJEC计算机科学课程大纲的核心主题浓缩为简明的双语要点。无论您是为IB文凭考试还是WJEC AS/A level考试复习,这些笔记都聚焦于两个课程共有的核心概念。每个部分提供关键定义、原理和应试技巧,帮助您在考前快速巩固理解。


1. Number Systems and Data Representation | 数制与数据表示

Computers use binary (base-2) to represent all data. A binary digit (bit) is either 0 or 1. Converting from denary (base-10) to binary involves successive division by 2, recording remainders in reverse order. For example, 13 in denary is 1101 in binary. Hexadecimal (base-16) uses digits 0-9 and letters A-F to compactly represent groups of four bits, making it easier for humans to read memory addresses and colour codes.

计算机使用二进制(基数为2)表示所有数据。一个二进制位(比特)要么是0要么是1。将十进制转换为二进制需要反复除以2并逆向记录余数。例如,十进制13的二进制形式为1101。十六进制(基数为16)使用0-9及A-F来表示四位二进制组,使人们能更轻松地读取内存地址和颜色代码。

Negative integers are commonly stored using two’s complement. To find the two’s complement of an 8-bit number, invert all bits (one’s complement) and add 1. For instance, +5 is 00000101; its negative is 11111011 (invert to 11111010, then add 1). This representation simplifies hardware for subtraction by allowing addition of the complement.

负整数通常用补码(二补码)存储。求一个8位数的补码时,先反转所有位(一反码)再加1。例如,+5为00000101;其负数形式为11111011(先反转为11111010,再加1)。这种表示法简化了减法电路,因为可以通过补码加法实现减法。

Characters are encoded using standards like ASCII (7-bit, 128 characters) and Unicode (variable length, up to 4 bytes per character, covering global scripts and emojis). The exam may ask you to compare ASCII and Unicode, highlighting Unicode’s larger character set and its use of UTF-8 encoding for backward compatibility with ASCII.

字符通过诸如ASCII(7位,128个字符)和Unicode(变长编码,每个字符最多4字节,覆盖全球文字和表情符号)等标准编码。考题可能会要求比较ASCII与Unicode,突出Unicode更大的字符集以及其使用UTF-8编码以向后兼容ASCII的特点。

Real numbers are represented using floating-point format, typically IEEE 754 single (32-bit) or double precision (64-bit). A floating-point number consists of a sign bit, exponent (biased), and mantissa (fraction). Normalisation ensures a leading 1 in the mantissa for maximum precision. Understand overflow and underflow errors.

实数使用浮点格式表示,通常为IEEE 754单精度(32位)或双精度(64位)。浮点数由符号位、指数(带偏移)和尾数(小数部分)构成。规格化确保尾数前导1以获得最大精度。要理解溢出和下溢错误。


2. Boolean Logic and Digital Circuits | 布尔逻辑与数字电路

Boolean algebra operates on binary values (True/False or 1/0) using fundamental operators: AND (∧), OR (∨), NOT (¬), and XOR (⊕). AND outputs 1 only if all inputs are 1; OR outputs 1 if at least one input is 1; NOT inverts the input; XOR outputs 1 when inputs differ. Truth tables systematically list all input combinations and their outputs.

布尔代数用AND (∧), OR (∨), NOT (¬) 和 XOR (⊕) 等基本运算符处理二进制值(真/假或1/0)。AND仅在所有输入均为1时输出1;OR在至少一个输入为1时输出1;NOT反转输入值;XOR在输入不同时输出1。真值表系统地列出所有输入组合及对应输出。

Common logic gates correspond to these operators: AND gate, OR gate, NOT gate (inverter), XOR gate, NAND gate, and NOR gate. NAND and NOR are universal gates – any Boolean function can be constructed using only NAND or only NOR gates. This is often tested in IB and WJEC.

常见逻辑门与这些运算符对应:与门、或门、非门(反相器)、异或门、与非门和或非门。与非门和或非门是通用门——任何布尔函数都可以仅用与非门或仅用或非门构建。这一考点在IB和WJEC中经常出现。

A B A ∧ B A ∨ B A ⊕ B
0 0 0 0 0
0 1 0 1 1
1 0 0 1 1
1 1 1 1 0

Simplify Boolean expressions using laws (commutative, associative, distributive, De Morgan’s) and Karnaugh maps (K-maps) for up to 4 variables. De Morgan’s laws state: ¬(A ∧ B) = ¬A ∨ ¬B and ¬(A ∨ B) = ¬A ∧ ¬B. Logic circuits can be drawn as combinations of gates to implement any truth table.

使用定律(交换律、结合律、分配律、德摩根定律)和卡诺图(最高4变量)化简布尔表达式。德摩根定律为:¬(A ∧ B) = ¬A ∨ ¬B, ¬(A ∨ B) = ¬A ∧ ¬B。逻辑电路可通过组合逻辑门来实现任意真值表。


3. Computer Architecture and Organization | 计算机体系结构与组成

The von Neumann architecture stores both data and instructions in the same memory unit, with a single bus system. Key components include the Central Processing Unit (CPU), memory, and input/output devices. The CPU contains the Control Unit (CU) which decodes instructions, the Arithmetic Logic Unit (ALU) which performs calculations, and registers such as the Program Counter (PC), Memory Address Register (MAR), Memory Data Register (MDR), and Accumulator (ACC).

冯·诺依曼架构将数据和指令存储在同一内存单元中,使用单一总线系统。关键组件包括中央处理器(CPU)、内存和输入/输出设备。CPU包括负责解码指令的控制单元(CU)、执行运算的算术逻辑单元(ALU),以及程序计数器(PC)、内存地址寄存器(MAR)、内存数据寄存器(MDR)和累加器(ACC)等寄存器。

The fetch-decode-execute cycle describes how the CPU processes instructions: 1) Fetch: the address in PC is copied to MAR, instruction fetched from memory to MDR, then stored in the Current Instruction Register (CIR), PC incremented. 2) Decode: CU interprets the opcode and operand. 3) Execute: ALU performs the operation, result stored back in ACC or memory. This cycle repeats billions of times per second, controlled by a system clock.

取指-解码-执行周期描述CPU如何处理指令:1) 取指:PC中的地址复制到MAR,从内存取出指令存入MDR,然后存至当前指令寄存器(CIR),PC递增。2) 解码:CU解释操作码和操作数。3) 执行:ALU执行操作,结果存回ACC或内存。该周期在系统时钟控制下每秒重复数十亿次。

Performance factors include clock speed (GHz), number of cores, cache size, and bus width. Pipelining allows overlapping of fetch, decode, and execute stages for different instructions, improving throughput. Harvard architecture, contrasting von Neumann, uses separate memory for instructions and data, allowing simultaneous access and is common in microcontrollers.

性能因素包括时钟速度(GHz)、核心数量、缓存大小和总线宽度。流水线技术允许不同指令的取指、解码和执行阶段重叠,从而提高吞吐量。哈佛架构与冯·诺依曼不同,使用独立的指令存储器和数据存储器,允许同时访问,常见于微控制器。


4. Operating Systems and Resource Management | 操作系统与资源管理

The operating system (OS) acts as an intermediary between hardware and applications, managing resources such as memory, processes, files, and I/O devices. It provides a user interface (GUI or CLI), multitasking, and security. Key functions include process scheduling, memory management (paging, segmentation, virtual memory), file system management, and interrupt handling.

操作系统(OS)充当硬件与应用程序之间的中介,管理内存、进程、文件和I/O设备等资源。它提供用户界面(图形或命令行)、多任务处理和安全保障。关键功能包括进程调度、内存管理(分页、分段、虚拟内存)、文件系统管理和中断处理。

Virtual memory uses disk space to extend RAM, allowing execution of larger programs. Pages are swapped between RAM and disk as needed. Paging can cause page faults and thrashing if overused. Interrupts signal events needing immediate attention; the ISR (Interrupt Service Routine) handles them, saving processor state and restoring it afterward.

虚拟内存利用磁盘空间扩展RAM,使更大的程序得以运行。页面根据需要在RAM与磁盘之间交换。分页若使用过度,可能导致缺页和系统颠簸。中断发出需要立即处理的事件信号;中断服务程序(ISR)负责处理它们,保存并在此后恢复处理器状态。

Scheduling algorithms determine which process gets CPU time. Common ones: First Come First Served (FCFS), Shortest Job First (SJF), Round Robin (time slices), and Priority-based. Multitasking OSes use context switching to give the illusion of simultaneous execution.

调度算法决定哪个进程获得CPU时间。常见的有:先到先服务(FCFS)、最短作业优先(SJF)、轮转调度(时间片)和基于优先级的调度。多任务操作系统使用上下文切换营造并发执行的假象。


5. Programming Concepts and Constructs | 编程概念与结构

High-level programming languages offer structures like sequence, selection (if-else, switch-case), and iteration (definite loops like FOR, indefinite like WHILE, and recursive). Variables must be declared with a data type (integer, real, Boolean, character, string, etc.) which determines memory allocation and permitted operations. Constants hold values that do not change.

高级编程语言提供顺序、选择(if-else,switch-case)和迭代(确定循环如FOR,非确定循环如WHILE,以及递归)等结构。变量必须声明数据类型(整型、实型、布尔型、字符、字符串等),数据类型决定了内存分配和允许的操作。常量保存不变的值。

Modular programming breaks a problem into subprograms (functions/procedures), enhancing readability, reusability, and testing. A function returns a value; a procedure does not. Parameters can be passed by value (a copy) or by reference (the original variable). Recursion occurs when a function calls itself, requiring a base case to prevent infinite loops.

模块化编程将问题分解为子程序(函数/过程),提高可读性、可重用性和可测试性。函数返回值,过程不返回值。参数可以按值传递(拷贝)或按引用传递(原变量)。递归发生在函数调用自身时,需要基础条件防止无限循环。

IB exams often use pseudocode; WJEC may use a specific language or pseudocode. Ensure you can trace code, identify logic errors, and construct algorithms for tasks like finding max/min, counting, and accumulation. Use tracing tables to debug algorithms.

IB考试通常使用伪代码;WJEC可能使用特定语言或伪代码。确保您能跟踪代码、识别逻辑错误并构建算法以完成诸如寻找最大值/最小值、计数和累加等任务。使用跟踪表调试算法。


6. Data Structures (Arrays, Stacks, Queues, Trees) | 数据结构(数组、栈、队列、树)

An array is a static or dynamic collection of homogeneous elements stored in contiguous memory, accessed via index (0-based in many languages). 2D arrays represent tables. Stacks follow LIFO (Last In, First Out); operations push (add to top), pop (remove top), peek (view top). Queues are FIFO (First In, First Out); operations enqueue (add to rear), dequeue (remove front). Both can be implemented with arrays or linked lists, with circular queues preventing wasted space.

数组是存储在连续内存中的同类型元素的静态或动态集合,通过索引(多数语言中以0为基础)访问。二维数组表示表格。栈遵循后进先出(LIFO);操作包括压入(顶部添加)、弹出(移除顶部)、窥视(查看顶部)。队列是先进先出(FIFO);操作包括入队(从尾部添加)、出队(从头部移除)。两者都可用数组或链表实现,循环队列可避免空间浪费。

Linked lists consist of nodes, each containing data and a pointer to the next node. They allow efficient insertion/deletion but no direct access. A binary tree is a hierarchical structure with nodes having at most two children. Binary search trees (BST) maintain order: left child < parent < right child, enabling efficient search O(log n) if balanced. Traversal algorithms: pre-order, in-order, post-order.

链表由节点组成,每个节点包含数据和指向下一个节点的指针。它们允许高效的插入/删除,但不支持直接访问。二叉树是一种层级结构,每个节点最多有两个子节点。二叉搜索树(BST)保持顺序:左子节点 < 父节点 < 右子节点,若平衡则能实现O(log n)的高效搜索。遍历算法:前序、中序、后序遍历。


7. Algorithms: Searching, Sorting, Complexity | 算法:搜索、排序、复杂度

Searching algorithms locate a target in a dataset. Linear search checks each element sequentially: O(n). Binary search requires a sorted list, repeatedly dividing the search interval in half: O(log n). Sorting algorithms: Bubble sort repeatedly swaps adjacent elements if out of order (O(n²)); Insertion sort builds a sorted sublist (O(n²) worst, O(n) best); Merge sort recursively divides and merges (O(n log n)). Quick sort partitions around a pivot (average O(n log n), worst O(n²)).

搜索算法在数据集中定位目标。线性搜索逐一检查每个元素:O(n)。二分搜索要求列表已排序,反复将搜索区间对半分割:O(log n)。排序算法:冒泡排序反复交换顺序错误的相邻元素(O(n²));插入排序构建有序子列表(最坏O(n²),最佳O(n));归并排序递归地划分并合并(O(n log n));快速排序围绕枢轴分区(平均O(n log n),最坏O(n²))。

Big O notation describes the upper bound of an algorithm’s runtime or space requirements as input size n grows. Common complexities: O(1) constant, O(log n) logarithmic, O(n) linear, O(n log n) linearithmic, O(n²) quadratic, O(2ⁿ) exponential. Understanding these helps compare efficiency and predict scalability.

大O表示法描述算法运行时间或空间需求随输入规模n增长的上限。常见复杂度:O(1) 常数,O(log n) 对数,O(n) 线性,O(n log n) 线性对数,O(n²) 平方,O(2ⁿ) 指数。理解这些有助于比较效率并预测可扩展性。

Binary search in pseudocode (assuming sorted array A, target T):

二分搜索伪代码(假设已排序数组A,目标T):

low ← 0, high ← length(A)-1
while low ≤ high:
mid ← (low+high) div 2
if A[mid] = T then return mid
else if A[mid] < T then low ← mid+1
else high ← mid-1
return -1


8. Object-Oriented Programming Principles | 面向对象编程原则

OOP models real-world entities as objects that combine state (attributes) and behaviour (methods). A class is a blueprint; objects are instances. Key principles: Encapsulation bundles data and methods, restricting direct access by using private attributes and public getter/setter methods, ensuring data integrity. Inheritance allows a subclass to reuse and extend a superclass’s members, promoting code reuse. Polymorphism allows objects of different classes to respond to the same method call in their own way, typically via method overriding.

OOP将现实世界实体建模为对象,对象结合了状态(属性)和行为(方法)。类是蓝图,对象是实例。关键原则:封装将数据和方法捆绑在一起,通过私有属性和公有getter/setter方法限制直接访问,确保数据完整性。继承允许子类重用并扩展父类的成员,促进代码重用。多态允许不同类的对象以各自方式响应相同的方法调用,通常通过方法重写实现。

An example: class Vehicle with attributes speed and colour, method accelerate(). Car inherits from Vehicle, adds numberOfDoors, and overrides accelerate() for a different behaviour. In IB and WJEC, you may need to design UML class diagrams showing relationships (aggregation, composition, dependency) and multiplicity.

例子:类Vehicle具有属性speed和colour,方法accelerate()。Car继承自Vehicle,添加numberOfDoors属性,并重写accelerate()实现不同行为。在IB和WJEC中,您可能需要设计UML类图,展示关系(聚合、组合、依赖)和多重性。


9. Databases and SQL | 数据库与SQL

A relational database organises data into tables (relations) made of rows (records) and columns (attributes). Each table has a primary key that uniquely identifies each row. Foreign keys link tables by referencing primary keys of other tables, establishing relationships (one-to-one, one-to-many, many-to-many via junction table). Normalisation reduces redundancy and anomalies: 1NF (atomic values), 2NF (no partial dependencies), 3NF (no transitive dependencies).

关系数据库将数据组织成表(关系),表由行(记录)和列(属性)组成。每张表有一个主键,唯一标识每一行。外键通过引用其他表的主键来连接表,建立关系(一对一、一对多、多对多通过连接表)。规范化减少冗余和异常:1NF(原子值),2NF(无部分依赖),3NF(无传递依赖)。

SQL (Structured Query Language) is used to define, manipulate, and query data. Basic commands: SELECT, FROM, WHERE, ORDER BY, GROUP BY, HAVING, JOIN. Example: SELECT StudentName, DateOfBirth FROM Students WHERE Grade=’A’ ORDER BY StudentName; Also know INSERT, UPDATE, DELETE. JOINs combine rows: INNER JOIN returns matching records only; LEFT JOIN returns all left table rows with matched right rows.

SQL(结构化查询语言)用于定义、操作和查询数据。基本命令:SELECT, FROM, WHERE, ORDER BY, GROUP BY, HAVING, JOIN。示例:SELECT StudentName, DateOfBirth FROM Students WHERE Grade=’A’ ORDER BY StudentName; 还要知道INSERT, UPDATE, DELETE。JOIN用于合并行:INNER JOIN仅返回匹配记录;LEFT JOIN返回左表所有行及匹配的右表行。


10. Networks and Protocols | 网络与协议

Networks connect devices to share resources. LAN (Local Area Network) covers a small area like a building; WAN (Wide Area Network) spans

Published by TutorHao | IB 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