กระดาษ 1 เป็นทฤษฎี được đánh giáตาม คำศัพท์ที่แม่นยำ — ความแตกต่างระหว่าง RAM และ ROM, คอมไพเลอร์และ интерпрيتер, การตรวจสอบ และ การยืนยัน. These are definition marks, and a paraphrase usually misses them.
Paper 2 is problem-solving and programming, where marks go to a working method: trace tables, pseudocode, and code that would actually run. Secure number bases and binary arithmetic first — they appear on their own and again inside data transmission, logic and hardware.
Why computers use binary · ทำไมคอมพิวเตอร์ใช้เลขฐานสอง
English
A computer can only work with two states: on and off. You write these as 1 and 0. A system that uses only two digits 数字 is called binary 二进制 (base 2).
Every kind of data 数据 — numbers, text, sound and images — must be changed into binary before a computer can use it. The computer processes this binary using logic gates 逻辑门, and stores it in registers 寄存器 (small, fast stores inside the processor 处理器).
1 Understand how and why computers use binary to represent all forms of data
• Any form of data needs to be converted to binary to be processed by a computer • Data is processed using logic gates and stored in registers
2 (a) Understand the denary, binary and hexadecimal number systems (b) Convert between (i) positive denary and positive binary (ii) positive denary and positive hexadecimal (iii) positive hexadecimal and positive binary
• Denary is a base 10 system • Binary is a base 2 system • Hexadecimal is a base 16 system • Values used will be integers only • Conversions in both directions, e.g. denary to binary or binary to denary • Maximum binary number length of 16-bit
3 Understand how and why hexadecimal is used as a beneficial method of data representation
• Areas within computer science that hexadecimal is used should be identified • Hexadecimal is easier for humans to understand than binary, as it is a shorter representation of binary
4 (a) Add two positive 8-bit binary integers (b) Understand the concept of overflow and why it occurs in binary addition
• An overflow error will occur if the value is greater than 255 in an 8-bit register • A computer or a device has a predefined limit that it can represent or store, for example 16-bit • An overflow error occurs when a value outside this limit should be returned
5 Perform a logical binary shift on a positive 8-bit binary integer and understand the effect this has on the positive binary integer
• Perform logical left shifts • Perform logical right shifts • Perform multiple shifts • Bits shifted from the end of the register are lost and zeros are shifted in at the opposite end of the register • The positive binary integer is multiplied or divided according to the shift performed • The most significant bit(s) or least significant bit(s) are lost
6 Use the two’s complement number system to represent positive and negative 8-bit binary integers
• Convert a positive binary or denary integer to a two’s complement 8-bit integer and vice versa • Convert a negative binary or denary integer to a two’s complement 8-bit integer and vice versa
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
Counting in binary: 0 to 15
A number system 数制 is a way of writing numbers using a fixed set of digits. You need three of them.
System
Base
Digits used
Denary
10
0–9
Binary
2
0 and 1
Hexadecimal
16
0–9 then A–F
denary 十进制 is the normal counting system (also called decimal).
binary uses only 0 and 1.
hexadecimal 十六进制 (hex) uses sixteen digits: 0–9, then A, B, C, D, E, F stand for 10, 11, 12, 13, 14, 15.
The base 基数 tells you how many different digits a system uses.
Place value
Each column in a number has a place value 位值. In binary the place values double from right to left. For an 8-bit number they are:
One bit 位 is a single 0 or 1. Eight bits make one byte 字节. Four bits (half a byte) is a nibble 半字节.
Converting between number systems
Denary → binary. Write the place values. Put a 1 under each value you need so they add up to your number; put 0 under the rest.
Binary → hexadecimal. Group the bits into nibbles of 4, starting from the right. Change each nibble to one hex digit.
Denary → hexadecimal. The easy way is to change to binary first, then binary to hex.
This table helps with the hex letters:
Denary
Binary
Hex
10
1010
A
11
1011
B
12
1100
C
13
1101
D
14
1110
E
15
1111
F
Cambridge questions use binary numbers up to 16 bits long.
Worked example. Convert denary 100 to 8-bit binary, then to hexadecimal.
$100 = 64 + 32 + 4$, so the binary is 01100100. Splitting into nibbles, 01100100$= 6$ and $4$, so the hexadecimal is 64.
Why hexadecimal is used
Hex is shorter than binary and easier for people to read and write. One hex digit replaces 4 binary digits, so you make fewer mistakes. The value does not change — hex is just a shorter way to show the same binary.
Type a number and see it in binary, denary and hex — and how the place values build it. · พิมพ์ตัวเลขและเห็น它在binary, denary and hex — และวิธีที่ตำแหน่งสร้างมันขึ้นมา
You can add two 8-bit binary numbers, column by column from the right, just like denary. The rules for one column are:
A
B
Result bit
Carry
0
0
0
0
0
1
1
0
1
0
1
0
1
1
0
1
When a carry also comes in, $1 + 1 + 1 = 1$ with a carry of 1.
Example: add 01110110 (118) and 00110000 (48).
Overflow
An 8-bit register can hold denary values from 0 to 255 only. If an addition gives a result above 255, the answer needs a 9th bit. The register cannot hold this extra bit, so it is lost. This is called overflow 溢出 (an overflow error). It happens when a value goes outside the limit the register can store.
Example: 11001000 (200) $+$01001000 (72) $= 272$. In binary that is 1 00010000, which needs 9 bits. The leading 1 will not fit in 8 bits, so the stored answer is wrong.
A logical binary shift 逻辑二进制移位 moves all the bits left or right by a number of places.
Bits that move off the end of the register are lost.
Zeros are added at the empty end.
A left shift multiplies the number by 2 for each place moved. A right shift divides it by 2 for each place; the right-most bits (the least significant bit(s) 最低有效位) are lost.
Example: left shift 00110101 (53) by 2 places.
The result is 11010100 (212), which is $53 \times 4$. The two left-most bits were lost and two zeros came in on the right. If a 1 is pushed off the end, that information is gone for good.
So far the numbers were positive. Two's complement 补码 lets an 8-bit register hold negative numbers too.
In two's complement, the left-most bit (the most significant bit 最高有效位, or MSB) has a negative place value:
If the MSB is 0, the number is positive.
If the MSB is 1, the number is negative.
To make a positive number negative: write the positive binary, flip every bit (0↔1), then add 1.
Example: make $-40$.
$+40$ = 00101000
flip the bits = 11010111
add 1 = 11011000
So $-40$ = 11011000. Check by adding the place values: $-128 + 64 + 16 + 8 = -40$.
To read a negative two's complement number, just add the place values (the MSB counts as $-128$). The range of an 8-bit two's complement number is $-128$ to $+127$.
1 Understand how and why a computer represents text and the use of character sets, including American standard code for information interchange (ASCII) and Unicode
• Text is converted to binary to be processed by a computer • Unicode allows for a greater range of characters and symbols than ASCII, including different languages and emojis • Unicode requires more bits per character than ASCII
2 Understand how and why a computer represents sound, including the effects of the sample rate and sample resolution
• A sound wave is sampled for sound to be converted to binary, which is processed by a computer • The sample rate is the number of samples taken in a second • The sample resolution is the number of bits per sample • The accuracy of the recording and the file size increases as the sample rate and resolution increase
3 Understand how and why a computer represents an image, including the effects of the resolution and colour depth
• An image is a series of pixels that are converted to binary, which is processed by a computer • The resolution is the number of pixels in the image • The colour depth is the number of bits used to represent each colour • The file size and quality of the image increase as the resolution and colour depth increase
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
Computers store text by giving every character a number, then storing that number in binary. The set of characters a computer can use, together with their numbers, is a character set 字符集.
ASCII uses 7 bits per character, so it has 128 different characters. This is enough for English letters, digits and common symbols.
Unicode uses more bits per character. It can represent far more characters — many languages, plus symbols and emoji 表情符号.
Because Unicode has more characters, it needs more bits per character than ASCII, so the same text takes more storage 存储.
A sound wave 声波 is smooth and always changing. To store it, the computer measures the height of the wave at regular moments. This is called sampling 采样, and each measurement is a sample.
sample rate 采样率 is the number of samples taken each second (measured in Hz).
sample resolution 采样分辨率 is the number of bits used for each sample. The height of the wave at a sample point is its amplitude 振幅.
A higher sample rate and a higher sample resolution give a more accurate recording, but a larger file.
• Including: – bit – nibble – byte – kibibyte (KiB) – mebibyte (MiB) – gibibyte (GiB) – tebibyte (TiB) – pebibyte (PiB) – exbibyte (EiB) • The amount of the previous denomination present in the data storage size, e.g.: – 8 bits in a byte – 1024 mebibytes in a gibibyte
2 Calculate the file size of an image file and a sound file, using information given
• Answers must be given in the units specified in the question. Calculations must use the measurement of 1024 and not 1000 • Information given may include: – image resolution and colour depth – sound sample rate, resolution and length of track
3 Understand the purpose of and need for data compression
• Compression exists to reduce the size of the file • What the impact of this is, e.g.: – less bandwidth required – less storage space required – shorter transmission time
4 Understand how files are compressed using lossy and lossless compression methods
• Lossy compression reduces the file size by permanently removing data, e.g. reducing resolution or colour depth, reducing sample rate or resolution • Lossless compression reduces the file size without permanent loss of data, e.g. run length encoding (RLE)
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
Data storage is measured in the units below. A nibble is 4 bits and a byte is 8 bits; from the kibibyte upward, each unit is 1024 times the one before it (because $1024 = 2^{10}$, which fits binary).
Sound file size (in bits) $=$ sample rate $\times$ sample resolution $\times$ length in seconds.
Always divide by 1024 (not 1000) to change to KiB, MiB and so on. Give your answer in the unit the question asks for.
Worked example. A sound is recorded for 30 seconds at a sample rate of 8,000 Hz with a sample resolution of 16 bits. Find the file size in kibibytes (KiB).
Compression 压缩 makes a file smaller. A smaller file:
uses less storage space,
needs less bandwidth 带宽 (the amount of data a connection can carry),
takes a shorter time to send (a shorter transmission 传输 time).
There are two types.
Lossless compression
Lossless 无损 compression makes the file smaller with no permanent loss of data. The original file can be rebuilt exactly.
One method is run-length encoding 行程编码 (RLE). It replaces a run of repeated values with one copy of the value and a count of how many times it repeats. For example WWWWWWWW (8 whites) is stored as "8 W". This works well when data has many repeats.
Lossy compression
Lossy 有损 compression makes the file much smaller by permanently removing some data. The removed data cannot be got back. For example:
reducing the resolution or colour depth of an image,
reducing the sample rate or sample resolution of a sound.
Use lossless when you must keep every detail (text and program files). Use lossy for photos, music and video, where a small loss of quality is worth a much smaller file.
Convert denary → binary by subtracting the place values (128, 64, 32 …); binary → denary by adding the place values that hold a 1.
To convert to hex, group the binary into nibbles of 4 bits from the right; each nibble is exactly one hex digit.
Overflow happens when a result needs more bits than the register has (an 8-bit register only holds 0–255), so the extra bit is lost.
File size in bits: for an image, width × height × colour depth; for sound, sample rate × resolution × seconds. Divide by 8 for bytes, then by 1024 for each larger unit.
Lossless compression keeps every bit (text; run-length encoding); lossy permanently removes data (photos, music) for a much smaller file.
What is data transmission? · การส่งผ่านข้อมูลคืออะไร?
English
Data transmission 数据传输 means moving data from one place to another — for example from your computer to a website, or from a phone to a printer.
Data often travels along a cable. Two common ones are shown below.
Before it is sent, the data is broken down into small, equal-sized pieces called packets 数据包. Each packet travels separately and they are put back together at the other end.
Using packets has benefits:
if one packet is lost or damaged, only that packet is sent again, not the whole file;
packets can take different routes, so a busy or broken route can be avoided;
many users can share the same connection at the same time.
The structure of a packet · โครงสร้างของแพ็กเก็ต
Syllabus · หลักสูตร
English
Candidates should be able to:
Notes and guidance
1 (a) Understand that data is broken down into packets to be transmitted
(b) Describe the structure of a packet
• A packet of data contains a: – packet header – payload – trailer • The packet header includes the: – destination address – packet number – originator’s address
(c) Describe the process of packet switching
• Data is broken down into packets • Each packet could take a different route • A router controls the route a packet takes • Packets may arrive out of order • Once the last packet has arrived, packets are reordered
2 (a) Describe how data is transmitted from one device to another using different methods of data transmission
How data travels in packets · วิธีการเดินทางของข้อมูลในแพ็กเก็ต
Step through packet switching. Splitting a file into addressed packets is why one lost packet only needs resending, and why many users can share the same line. · ขั้นตอนการทำงานของการสลับแพ็กเก็ต การแบ่งไฟล์ออกเป็นแพ็กเก็ตที่มีที่อยู่คือเหตุผลที่หากแพ็กเก็ตหนึ่งหายไปต้องส่งใหม่เพียงครั้งเดียว และเหตุว่าผู้ใช้หลายคนสามารถแชร์สายเดียวกันได้
Methods of data transmission · วิธีการส่งผ่านข้อมูล
English
Serial and parallel
Serial 串行
Parallel 并行
How
one bit at a time, down one wire
several bits at once, down several wires
Distance
good over long distances
good over short distances only
Cost
cheaper (fewer wires)
more expensive (more wires)
Errors
bits stay in order
bits can arrive at slightly different times over long wires
Serial sends one bit after another along a single wire. Parallel sends several bits at the same time along several wires, so it is faster over short distances.
Simplex, half-duplex and full-duplex
These describe the direction data can travel.
Method
Direction
simplex 单工
one direction only (e.g. computer → printer)
half-duplex 半双工
both directions, but only one at a time (e.g. walkie-talkie)
full-duplex 全双工
both directions at the same time (e.g. phone call)
Choosing a method
The choice depends on the distance, the speed needed, the cost, and whether data must travel both ways at once.
ตัวอย่างรูปร่างของขั้วต่อ USB บางส่วน ใช้มาตรฐาน USB เดียวกัน ดังนั้นอุปกรณ์จะถูกตรวจจับอัตโนมัติ
2.2
Why we check for errors · ทำไมเราต้องตรวจสอบความผิดพลาด
Syllabus · หลักสูตร
English
Candidates should be able to:
Notes and guidance
1 Understand the need to check for errors after data transmission and how these errors can occur
• Errors can occur during data transmission due to interference, e.g. data loss, data gain and data change
2 Describe the processes involved in each of the following error detection methods for detecting errors in data after transmission: parity check (odd and even), checksum and echo check
• Including parity byte and parity block check
3 Describe how a check digit is used to detect errors in data entry and identify examples of when a check digit is used, including international standard book numbers (ISBN) and bar codes
4 Describe how an automatic repeat query (ARQ) can be used to establish that data is received without error
• Including the use of: – positive/negative acknowledgements – timeout
2 อธิบายกระบวนการที่เกี่ยวข้องในแต่ละวิธีการตรวจจับข้อผิดพลาดต่อไปนี้用于 detect errors in data after transmission: parity check (odd and even), checksum และ echo check
• รวมถึง parity byte และ parity block check
3 อธิบายการใช้ check digit ในการตรวจจับข้อผิดพลาดในการป้อนข้อมูลและระบุตัวอย่างของการใช้ check digit รวมถึง international standard book numbers (ISBN) และ bar codes
A parity check 奇偶校验 adds one extra bit, the parity bit 奇偶校验位, to each byte. There are two types:
even parity — the total number of 1s in the byte (including the parity bit) must be even;
odd parity — the total number of 1s must be odd.
Example (even parity): the data 1011001 has four 1s, which is already even, so the parity bit is 0:
To find an error: the receiver counts the 1s. If even parity was agreed but a byte arrives with an odd number of 1s, an error has happened during transmission.
A parity check cannot find every error. If two bits flip, the count may still look correct.
Worked example. A single parity bit tells you that an error happened, but not where. A parity block 奇偶校验块 can find the exact bit. Several bytes are sent together, each with a row parity bit, and one extra parity byte 奇偶校验字节 at the bottom holds a parity bit for each column. Even parity is used below, and one bit was flipped during transmission. Find it.
Row byte 3 breaks even parity, and column b3 breaks even parity. The flipped bit is where they cross: byte 3, bit b3. Changing it back from 1 to 0 repairs the data. A single parity bit only says an error happened; a parity block says exactly where, so the receiver can even fix it.
Checksum
A checksum 校验和 is a value worked out from all the data before sending. The receiver works out the checksum again from the data it received. If the two values do not match, an error has occurred and the data is resent.
Echo check
In an echo check 回送校验, the receiver sends the data back to the sender. The sender compares it with the original. If they differ, an error happened. (This needs the data to be sent twice, so it is slow.)
Automatic Repeat reQuest (ARQ)
Automatic Repeat reQuest 自动重传请求 (ARQ) uses messages called acknowledgements 确认.
The receiver sends a positive acknowledgement if a packet arrived correctly, or a negative acknowledgement if it did not.
The sender starts a timeout 超时 timer. If no positive acknowledgement comes back in time, the sender sends the packet again.
Check digit
A check digit 校验码 is an extra digit placed at the end of a number, worked out from the other digits. It is used to find mistakes when a number is typed in.
When the number is entered, the check digit is calculated again and compared. It can catch:
an incorrect digit entered,
a transposition error 换位错误 (two digits swapped, e.g. 21 typed as 12),
a digit left out or an extra digit added,
a phonetic error (a digit that sounds similar, e.g. 13 and 30).
Check digits are used in barcodes 条形码 and ISBNs (book numbers).
• Asymmetric encryption รวมถึงการใช้ public และ private keys
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
Why we need encryption
Encryption 加密 scrambles data so that it cannot be understood if it is intercepted 拦截 (caught) by the wrong person. The readable data is called plaintext 明文; after encryption it becomes ciphertext 密文.
Encryption does not stop data from being intercepted. It only stops the data from being understood.
Symmetric encryption
Symmetric encryption 对称加密 uses a single key 密钥 to both encrypt and decrypt the data. The sender and receiver must share this same secret key. The risk is that the key itself could be stolen while being shared.
Asymmetric encryption
Asymmetric encryption 非对称加密 uses two different keys:
a public key 公钥 that anyone can have, used to encrypt;
a private key 私钥 that is kept secret, used to decrypt.
Data encrypted with the public key can only be decrypted with the matching private key, so the key never has to be shared. This is safer than sharing one secret key.
Shift each letter to encrypt a message — the simplest idea of a cipher and its key. · เลื่อนตัวอักษรแต่ละตัวเพื่อเข้ารหัสข้อความ — ความคิดพื้นฐานที่สุดของรหัสลับและ กุญแจ ของมัน
Data is sent in packets (a header with the addresses and packet number, a payload, and a trailer). Packets can take different routes and arrive out of order, then are reordered by their packet numbers.
Match the transmission types: serial (one bit at a time, good over long distances) vs parallel (several bits at once, short distances); simplex / half-duplex / full-duplex describe the direction.
A single parity bit only shows that an error happened; a parity block locates the exact wrong bit — the row and the column that both fail.
Learn the error-detection methods and what each does: parity check, checksum, echo check, ARQ, and the check digit (for typed-in numbers).
Symmetric encryption uses one shared key; asymmetric uses a public key to encrypt and a private key to decrypt, so no secret key is ever shared.
The central processing unit (CPU) · หน่วยประมวลผลกลาง (CPU)
Syllabus · หลักสูตร
English
Candidates should be able to:
Notes and guidance
1 (a) Understand the role of the central processing unit (CPU) in a computer
• The CPU processes instructions and data that are input into the computer so that the result can be output
(b) Understand what is meant by a microprocessor
• A microprocessor is a type of integrated circuit on a single chip
2 (a) Understand the purpose of the components in a CPU, in a computer that has a Von Neumann architecture
• Including: – units: arithmetic logic unit (ALU) and control unit (CU) – registers: program counter (PC), memory address register (MAR), memory data register (MDR), current instruction register (CIR) and accumulator (ACC) – buses: address bus, data bus and control bus
(b) Describe the process of the fetch–decode–execute (FDE) cycle, including the role of each component in the process
• How instructions and data are fetched from random access memory (RAM) into the CPU, how they are processed using each component and how they are then executed • Storing data and addresses into specific registers • Using buses to transmit data, addresses and signals • Using units to fetch, decode and execute data and instructions
3 Understand what is meant by a core, cache and clock in a CPU and explain how they can affect the performance of a CPU
• The number of cores, size of the cache and speed of the clock can affect the performance of a CPU
4 Understand the purpose and use of an instruction set for a CPU
• An instruction set is a list of all the commands that can be processed by a CPU, and the commands are machine code
5 Describe the purpose and characteristics of an embedded system and identify devices in which they are commonly used
• An embedded system is used to perform a dedicated functions. For example in, domestic appliances, cars, security systems, lighting systems or vending machines. This is different to a general purpose computer that is used to perform many different functions. For example in, a personal computer (PC) or a laptop
ไทย
ผู้เข้าสอบควรสามารถ:
หมายเหตุและคำแนะนำ
1 (a) เข้าใจบทบาทของ central processing unit (CPU) ในคอมพิวเตอร์
• CPU ประมวลผลคำสั่งและข้อมูลที่ป้อนเข้าในคอมพิวเตอร์เพื่อให้ผลลัพธ์สามารถ output ได้
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
The fetch-decode-execute cycle
The central processing unit 中央处理器 (CPU) is the part of the computer that processes data and carries out instructions 指令. It runs programs by repeating a cycle, millions of times each second.
Parts of the CPU
Part
What it does
arithmetic logic unit 算术逻辑单元 (ALU)
does calculations (add, subtract) and logical operations (compare)
control unit 控制单元 (CU)
sends control signals to manage all the parts and tell them what to do
registers 寄存器
very small, very fast stores that hold one piece of data at a time
The parts are joined by buses 总线 — sets of wires that carry information:
the address bus 地址总线 carries memory addresses (one direction);
the data bus 数据总线 carries data and instructions (both directions);
the control bus 控制总线 carries control signals.
Special registers
These registers are used during the fetch–execute cycle.
Register
Purpose
program counter 程序计数器 (PC)
holds the address of the next instruction
memory address register 内存地址寄存器 (MAR)
holds the address to read from or write to
memory data register 内存数据寄存器 (MDR)
holds the data or instruction just fetched
current instruction register 当前指令寄存器 (CIR)
holds the instruction now being carried out
accumulator 累加器 (ACC)
holds the result of the ALU's calculations
The fetch–execute cycle
The fetch–execute cycle 取指执行周期 has three stages, repeated again and again:
Fetch — the instruction is copied from memory 内存 into the CPU (using the PC, MAR and MDR). The PC then increases by 1.
Decode — the control unit works out what the instruction means.
Execute — the instruction is carried out (the ALU may do a calculation, with the result going to the accumulator).
Cache memory
Cache 高速缓存 is a small amount of very fast memory inside or close to the CPU. It stores data and instructions that the CPU uses often. The CPU can read from cache much faster than from main memory, so the computer runs faster.
What affects CPU performance
Feature
Effect
number of cores 核心
each core can run instructions on its own, so more cores can do more work at the same time
cache size
a larger cache holds more data ready for the CPU, so it waits less
clock speed 时钟速度
the number of cycles per second; a higher clock speed runs more instructions per second
Worked example. Two computers are identical except that A has a 3.0 GHz single-core CPU with 2 MB of cache, and B has a 2.4 GHz quad-core CPU with 8 MB of cache. Which is better for video editing, and why? Video editing splits into many tasks that can run at the same time, so B's four cores can process several streams in parallel while A can only work on one at a time. B's larger cache also keeps more frequently used data close to the CPU, so it has to fetch from RAM less often. B is the better choice, even though A has the higher clock speed. Never answer on clock speed alone: weigh cores, cache and clock speed together, and tie each one to the job being done.
Embedded systems
An embedded system 嵌入式系统 is a small computer built inside a larger device to do one fixed job. It is dedicated to that task, is usually small and low-cost, and has no general operating system. Examples: a washing machine, a microwave, a set-top box.
แคช เป็นหน่วยความจำขนาดเล็กแต่เร็วมาก ที่อยู่ภายในหรือใกล้กับ CPU ใช้สำหรับเก็บข้อมูลที่และคำสั่งที่ CPU มักจะใช้งาน CPU สามารถอ่านข้อมูลจากแคชได้เร็วกว่าหน่วยความจำหลักมาก ทำให้คอมพิวเตอร์ทำงานได้เร็วขึ้น
Tap round the loop the CPU repeats billions of times a second — fetch the instruction, decode what it means, execute it, then do it all again. · วนลูปที่ CPU ทำซ้ำหลายพันล้านครั้งต่อวินาที — ดึงคำสั่ง, ตีความความหมาย, ประมวลผล, แล้วทำทั้งหมดนี้อีกครั้ง
3 (a) Understand what is meant by a sensor and the purposes of sensors
• Limited to: – acoustic – accelerometer – flow – gas – humidity – infra-red – level – light – magnetic field – moisture – pH – pressure – proximity – temperature
(b) Identify the type of data captured by each sensor and understand when each sensor would be used, including selecting the most suitable sensor for a given context
Primary storage: RAM and ROM · หน่วยความจำหลัก: RAM และ ROM
Syllabus · หลักสูตร
English
Candidates should be able to:
Notes and guidance
1 Understand what is meant by primary storage
• Primary storage is directly accessed by the CPU • Including the role of: – random access memory (RAM) – read only memory (ROM) • Including why a computer needs both RAM and ROM, and the difference between them
2 Understand what is meant by secondary storage
• Secondary storage is not directly accessed by the CPU and is necessary for more permanent storage of data
3 Describe the operation of magnetic, optical and solid-state (flash memory) storage and give examples of each
• Magnetic storage uses platters which are divided into tracks and sectors. Data is read and written using electromagnets. Including hard disk drive (HDD) • Optical storage uses lasers to create and read pits and lands. Including: CD, DVD and Blu-ray • Solid-state (flash memory) uses NAND or NOR technology. Transistors are used as control gates and floating gates. Including: solid-state drive (SSD), SD card and USB drive
4 Describe what is meant by virtual memory, how it is created and used and why it is necessary
• Pages of data are transferred between RAM and virtual memory when needed
5 Understand what is meant by cloud storage
• Cloud storage can be accessed remotely in comparison to storing data locally
6 Explain the advantages and disadvantages of storing data on the cloud in comparison to storing it locally
• Physical servers and storage are needed to store data in cloud storage
ไทย
ผู้เข้าสอบควรสามารถ:
หมายเหตุและคำแนะนำ
1 เข้าใจความหมายของ หน่วยความจำหลัก
• หน่วยความจำหลักถูกเข้าถึงโดยตรงโดย CPU • รวมถึงบทบาทของ: – หน่วยความจำเข้าถึงแบบสุ่ม (RAM) – หน่วยความจำอ่านเพียงอย่างเดียว (ROM) • รวมถึงเหตุผลที่คอมพิวเตอร์จำเป็นต้องมีทั้ง RAM และ ROM และความแตกต่างระหว่างทั้งสอง
2 เข้าใจความหมายของ หน่วยความจำรอง
• หน่วยความจำรองไม่ถูกเข้าถึงโดยตรงโดย CPU และเป็นสิ่งจำเป็นสำหรับการจัดเก็บข้อมูลอย่างถาวรมากขึ้น
Secondary storage 辅助存储器 keeps data permanently, even when the power is off. It is non-volatile and is used for long-term storage. There are three types.
Type
How it stores data
Examples
magnetic storage 磁存储
data is stored as magnetised spots on spinning disks
hard disk drive (HDD), magnetic tape
optical storage 光存储
data is stored as marks read by a laser
CD, DVD, Blu-ray
solid state storage 固态存储
data is stored in flash memory 闪存, with no moving parts
When the RAM becomes full, the computer can use part of the secondary storage as extra, pretend RAM. This is called virtual memory 虚拟内存.
Data that is not needed right now is moved out of RAM onto the disk, which frees space in RAM for other programs. This lets you run more programs than the RAM alone could hold. It is slower, because secondary storage is much slower than RAM.
• Primary storage is directly accessed by the CPU • Including the role of: – random access memory (RAM) – read only memory (ROM) • Including why a computer needs both RAM and ROM, and the difference between them
2 Understand what is meant by secondary storage
• Secondary storage is not directly accessed by the CPU and is necessary for more permanent storage of data
3 Describe the operation of magnetic, optical and solid-state (flash memory) storage and give examples of each
• Magnetic storage uses platters which are divided into tracks and sectors. Data is read and written using electromagnets. Including hard disk drive (HDD) • Optical storage uses lasers to create and read pits and lands. Including: CD, DVD and Blu-ray • Solid-state (flash memory) uses NAND or NOR technology. Transistors are used as control gates and floating gates. Including: solid-state drive (SSD), SD card and USB drive
4 Describe what is meant by virtual memory, how it is created and used and why it is necessary
• Pages of data are transferred between RAM and virtual memory when needed
5 Understand what is meant by cloud storage
• Cloud storage can be accessed remotely in comparison to storing data locally
6 Explain the advantages and disadvantages of storing data on the cloud in comparison to storing it locally
• Physical servers and storage are needed to store data in cloud storage
ไทย
ผู้เข้าสอบควรสามารถ:
หมายเหตุและคำแนะนำ
1 เข้าใจความหมายของ หน่วยความจำหลัก
• หน่วยความจำหลักถูกเข้าถึงโดยตรงโดย CPU • รวมถึงบทบาทของ: – หน่วยความจำเข้าถึงแบบสุ่ม (RAM) – หน่วยความจำอ่านเพียงอย่างเดียว (ROM) • รวมถึงเหตุผลที่คอมพิวเตอร์จำเป็นต้องมีทั้ง RAM และ ROM และความแตกต่างระหว่างทั้งสอง
2 เข้าใจความหมายของ หน่วยความจำรอง
• หน่วยความจำรองไม่ถูกเข้าถึงโดยตรงโดย CPU และเป็นสิ่งจำเป็นสำหรับการจัดเก็บข้อมูลอย่างถาวรมากขึ้น
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
Cloud storage 云存储 keeps your data on remote physical servers, reached over the internet, instead of on your own device.
Advantages: reach it from anywhere on any device; no local storage hardware to buy or maintain; easy to share files and to back up automatically.
Disadvantages: needs a working internet connection; an ongoing subscription cost; security and privacy depend on the provider; you rely on that provider staying available and in business.
1 Understand that a computer needs a network interface card (NIC) to access a network
2 Understand what is meant by, and the purpose of, a media access control (MAC) address, including its structure
• A network interface card is given a MAC address at the point of manufacture • MAC addresses are usually written as hexadecimal • MAC addresses are created using the manufacturer code and the serial code
3 (a) Understand what is meant by, and the purpose of, an internet protocol (IP) address (b) Understand that there are different types of IP address
• An IP address is allocated by the network and it can be static or dynamic • Including the characteristics of, and differences between, IPv4 and IPv6
4 Describe the role of a router in a network
• A router sends data to a specific destination on a network • A router can assign IP addresses • A router can connect a local network to the internet
2 เข้าใจความหมายและวัตถุประสงค์ของ MAC address (media access control address) รวมถึงโครงสร้างของมัน
• การ์ดอินเตอร์เฟซเครือข่ายจะได้รับ MAC address ที่จุดการผลิต • MAC addresses มักเขียนในรูปแบบเลขหกสิบ进制 • MAC addresses ถูกสร้างโดยใช้รหัสผู้ผลิตและรหัสserial
3 (a) เข้าใจความหมายและวัตถุประสงค์ของ IP address (internet protocol address) (b) เข้าใจว่ามี IP address ประเภทต่างๆ
• IP address ถูกกำหนดโดยเครือข่ายและอาจเป็นแบบคงที่หรือแบบพลวัต • รวมถึงลักษณะและความแตกต่างระหว่าง IPv4 และ IPv6
4 อธิบายบทบาทของ เราเตอร์ (router) ในเครือข่าย
• เราเตอร์ส่งข้อมูลไปยังเป้าหมายเฉพาะในเครือข่าย • เราเตอร์สามารถมอบ IP address ได้ • เราเตอร์สามารถเชื่อมต่อเครือข่ายท้องถิ่นเข้ากับอินเทอร์เน็ต
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
Network interface card (NIC)
A network interface card 网络接口卡 (NIC) is the hardware that lets a device join a network and send and receive data. Each NIC has a built-in MAC address.
MAC address and IP address
A MAC address (media access control 介质访问控制 address) is a number that identifies one physical device. The maker sets it, and it does not normally change. It is written in hexadecimal.
An IP address (internet protocol 网际协议 address) is a number that identifies a device on a network. It is given by the network and can change.
So a MAC address stays with the device, while an IP address depends on the network the device is using.
There are two versions of IP address. IPv4 is 32-bit, written as four denary numbers 0–255 (for example 192.168.0.1); the newer IPv6 is 128-bit, written as eight groups of hexadecimal separated by colons, giving vastly more addresses. An address is also either static 静态 (fixed, set by hand and never changing) or dynamic 动态 (handed out by the router/network each time the device connects, so it can change).
Router
A router 路由器 connects different networks together — for example, your home network to the internet. It reads the IP address in each packet and forwards it towards the right network.
ไทย
บัตรอินเทอร์เฟซเครือข่าย (NIC)
บัตรอินเทอร์เฟซเครือข่าย (NIC) คือฮาร์ดแวร์ที่ทำให้อุปกรณ์สามารถเชื่อมต่อกับเครือข่ายและส่งและรับข้อมูลได้ แต่ละ NIC จะมี MAC Address ในตัว
MAC Address และ IP Address
MAC Address (Media Access Control Address) คือหมายเลขที่ใช้ระบุอุปกรณ์ทางกายภาพหนึ่งเครื่อง ผู้ผลิตเป็นผู้กำหนดและโดยปกติจะไม่เปลี่ยน เขียนในรูปแบบเฮกซาดิมอล
IP Address (Internet Protocol Address) คือหมายเลขที่ใช้ระบุอุปกรณ์บนเครือข่าย ถูกมอบโดยเครือข่ายและสามารถเปลี่ยนแปลงได้
ดังนั้น MAC Address จะติดอยู่กับอุปกรณ์เสมอ ในขณะที่ IP Address ขึ้นอยู่กับเครือข่ายที่ใช้อุปกรณ์นั้นอยู่
Learn the fetch–decode–execute cycle and the special registers: the program counter holds the address of the next instruction, the MAR/MDR carry the address/data, and the accumulator holds the ALU's result.
CPU performance improves with more cores, a larger cache, and a higher clock speed.
RAM is volatile (it loses its data with no power) and holds programs in use; ROM is non-volatile and read-only (the start-up instructions).
Match the secondary-storage types: magnetic (HDD, tape), optical (CD/DVD, read by a laser), solid state (SSD, USB, flash — no moving parts).
A MAC address identifies the physical device and does not normally change; an IP address is given by the network and can change.
ไทย
เรียนรู้วงจร fetch–decode–execute และรีจิสเตอร์พิเศษ: program counter เก็บที่อยู่ของคำสั่ง ถัดไป, MAR/MDR搬运ที่อยู่/ข้อมูล, และ accumulator เก็บผลลัพธ์ของ ALU
ประสิทธิภาพ CPU ดีขึ้นเมื่อมี cores越多, cache越大, และ clock speed越高
RAM เป็นข้อมูลชั่วคราว (สูญเสียข้อมูลเมื่อไม่มีไฟ) เก็บโปรแกรมที่กำลังใช้งาน; ROM เป็นข้อมูลถาวรและอ่านได้เท่านั้น (คำสั่งเริ่มต้น)
จับคู่ประเภทการเก็บข้อมูลรอง: magnetic (HDD, เทป), optical (CD/DVD, อ่านด้วยเลเซอร์), solid state (SSD, USB, Flash — ไม่มีชิ้นส่วนเคลื่อนที่)
MAC Address ระบุอุปกรณ์ทางกายภาพและไม่เปลี่ยน; IP Address มอบโดยเครือข่ายและอาจเปลี่ยนได้
1 Describe the difference between system software and application software and provide examples of each
• System software provides the services that the computer requires, including operating system and utility software • Application software provides the services that the user requires
2 Describe the role and basic functions of an operating system
• Including: – managing files – handling interrupts – providing an interface – managing peripherals and drivers – managing memory – managing multitasking – providing a platform for running applications – providing system security – managing user accounts
3 Understand how hardware, firmware and an operating system are required to run applications software
• Applications are run on the operating system • The operating system is run on the firmware • The bootloader (firmware) is run on the hardware
4 Describe the role and operation of interrupts
• Including: – how an interrupt is generated – how it is handled using an interrupt service routine – what happens as a result of the interrupts • Software interrupts include division by zero and two processes trying to access the same memory location • Hardware interrupts include pressing a key on the keyboard and moving the mouse
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
Software is split into two types.
System software
System software 系统软件 controls the computer itself and gives a base for other programs to run on. Examples:
operating system 操作系统 (see below);
compiler 编译器 and linker 链接器 (tools that turn programs into a form the computer can run);
device driver 设备驱动程序 — software that lets the operating system control a piece of hardware;
utility software 实用程序 — small tools that look after the computer (for example anti-virus, backup, disk clean-up).
Below the operating system sits firmware 固件 – software stored permanently on ROM or flash that runs the moment the computer is switched on. The BIOS and the bootloader 引导程序 are firmware: they test the hardware and then load the operating system. So the layers stack up hardware → firmware → operating system → application software, each running on the layer below.
Application software
Application software 应用软件 lets the user do a useful task. Examples:
word processing 文字处理 software (writing documents);
spreadsheet 电子表格 software (working with numbers in a grid);
database management system 数据库管理系统 (storing and searching data);
providing a user interface/prəˈvaɪdɪŋ ə ˈjuːzə ˈɪntəfeɪs/
การจัดเตรียมอินเทอร์เฟซผู้ใช้
managing peripherals/ˈmænɪdʒɪŋ pəˈrɪfərəlz/
การจัดการอุปกรณ์ต่อพ่วง
managing multitasking/ˈmænɪdʒɪŋ ˈmʌltitæskɪŋ/
การจัดการ_multitasking
providing a platform/prəˈvaɪdɪŋ ə ˈplætfɔːm/
การจัดเตรียมแพลตฟอร์ม
4.1
The operating system · ระบบปฏิบัติการ
English
An operating system (OS) is the main system software. It controls the whole computer and lets the hardware, the application software and the user work together. Without an OS the computer is very hard to use.
The OS has many roles:
managing files — saving, opening, naming, moving and deleting files;
handling interrupts (see below);
providing a user interface 用户界面 so the user can control the computer;
managing memory — deciding what is kept in RAM and where;
managing peripherals 外围设备 and their drivers — controlling devices like printers;
managing multitasking 多任务处理 — letting several programs run at once;
providing a platform 平台 for running application software;
managing security — user accounts, passwords and access rights.
ไทย
ระบบปฏิบัติการ (OS) เป็นระบบซอฟต์แวร์หลัก ควบคุมคอมพิวเตอร์ทั้งเครื่องและทำให้ฮาร์ดแวร์ ซอฟต์แวร์แอปพลิเคชัน และผู้ใช้ทำงานร่วมกันได้ โดยไม่มี OS การใช้คอมพิวเตอร์จะยากมาก
An interrupt 中断 is a signal sent to the processor 处理器 to tell it that something needs attention now.
An interrupt can come from three sources:
hardware — for example a key is pressed, or a printer runs out of paper;
software — for example a program tries to divide by zero;
the user — for example the user presses a "cancel" key.
When an interrupt arrives, the processor stops what it is doing, saves its place, and services (deals with) the interrupt. When that is done, it goes back to what it was doing before. This lets the computer react quickly to important events.
เมื่อเกิดการขัดจังหวะ CPU จะบันทึกตำแหน่ง, รัน routine การจัดการขัดจังหวะ, แล้วฟื้นฟูตำแหน่งและดำเนินต่อไป
Explore · สำรวจ
How the CPU handles an interrupt · วิธีที่ CPU จัดการกับอินเทอร์รัปต์
Step through an interrupt. The CPU pauses what it's doing, deals with the urgent event, then carries on exactly where it left off — which is how one processor juggles the keyboard, printer and timer at once. · ขั้นตอนการจัดการอินเทอร์รัปต์: CPU หยุดสิ่งที่กำลังทำไว้ชั่วคราว, แก้ไขเหตุการณ์เร่งด่วน, แล้วดำเนินต่อไปจากจุดที่หยุดไว้ — นี่คือวิธีที่โปรเซสเซอร์เดียวจัดการคีย์บอร์ด พริ้นเตอร์ และนาฬิกาไปพร้อมกัน
central processing unit/ˈsentrəl ˈprəʊsesɪŋ ˈjuːnɪt/
หน่วยประมวลผลกลาง
programming language/ˈprəʊɡræmɪŋ ˈlæŋɡwɪdʒ/
ภาษาโปรแกรม
high-level language/haɪ ˈlevl ˈlæŋɡwɪdʒ/
ภาษาโปรแกรมระดับสูง
low-level language/ləʊ ˈlevl ˈlæŋɡwɪdʒ/
ภาษาระดับต่ำ
4.2
Programming languages · ภาษาการเขียนโปรแกรม
Syllabus · หลักสูตร
English
Candidates should be able to:
Notes and guidance
1 Explain what is meant by a high-level language and a low-level language, including the advantages and disadvantages of each
• Advantages and disadvantages include: – ease of reading and writing code, e.g. low-level is hard to read – ease of debugging code – machine independence – direct manipulation of hardware
2 Understand that assembly language is a form of low-level language that uses mnemonics, and that an assembler is needed to translate an assembly language program into machine code
3 Describe the operation of a compiler and an interpreter, including how high-level language is translated by each and how errors are reported
• A compiler translates the whole code at once before executing it, producing an executable file • An interpreter translates and executes the code line-by-line • A compiler provides an error report for the whole code if errors are detected • An interpreter stops execution when an error is found
4 Explain the advantages and disadvantages of a compiler and an interpreter
• Including an understanding that an interpreter is mostly used when developing a program and a compiler is used to translate the final program
5 Explain the role of an IDE in writing program code and the common functions IDEs provide
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
All computers process data using the central processing unit 中央处理器 (CPU). To make the CPU do work, people write programs in a programming language 编程语言. There are two kinds.
High-level languages
A high-level language 高级语言 is written in words that look a bit like English (for example Python). It is:
easy for people to read, write and fix;
independent of the computer — the same program can run on different types of computer.
Low-level languages
A low-level language 低级语言 is close to what the hardware actually uses. It includes:
machine code 机器码 — instructions written in binary (0s and 1s), which the CPU runs directly;
assembly language 汇编语言 — machine code written with short word codes (mnemonics) instead of binary.
A low-level language relates to the specific 特定的 type of CPU, so a program written for one CPU may not run on another. It is used when the programmer needs full control of the hardware or very fast, small code.
ภาษาระดับต่ำเกี่ยวข้องกับ ประเภทเฉพาะ ของ CPU ดังนั้นโปรแกรมที่เขียนสำหรับ CPU ตัวหนึ่งอาจไม่รันบนอีกตัวหนึ่ง ใช้เมื่อโปรแกรมเมอร์ต้องการควบคุมฮาร์ดแวร์เต็มรูปแบบหรือต้องการโค้ดที่เร็วและเล็กมาก
ภาษาระดับสูงใกล้เคียงกับภาษามนุษย์และรันได้ทุกคอมพิวเตอร์; ภาษาระดับต่ำ (แอสsembly และรหัสเครื่อง) ใกล้เคียงกับฮาร์ดแวร์และผูกติดกับ CPU ประเภทหนึ่ง
The CPU can only run machine code. A high-level program must first be changed into machine code. The software that does this is a translator 翻译程序. There are three types: a compiler and an interpreter (for high-level code), and an assembler (for low-level code).
Compiler
A compiler translates the whole program into machine code before it is run. After translating, the machine code can be run many times without translating again.
translation happens once, in full;
it reports all the errors together, at the end of translating;
the finished program runs fast and does not need the compiler to run.
Interpreter
An interpreter 解释器 translates and runs the program one line at a time.
it stops at the first error it finds, which helps when testing;
the program runs more slowly, because it is translated each time it runs;
the interpreter must be present every time the program runs.
Compiler
Interpreter
Translates
the whole program at once
one line at a time
Errors
all reported at the end
stops at the first error
Speed of finished program
faster
slower
Needed to run later?
no
yes
Use a compiler when you want to share a fast, finished program. Use an interpreter when you are writing and testing a program and want to find errors easily.
Assembler
An assembler 汇编器 translates a low-level assembly-language program (written in mnemonics such as LDA, ADD) into machine code. Each mnemonic becomes one machine instruction – a direct one-to-one translation, unlike a compiler or interpreter, which work on high-level code.
Worked example. A team is writing a program. While developing it they want to find and fix errors quickly; when they ship it they want customers to run it fast without seeing the source code. Which translator suits each stage? While developing, use an interpreter: it translates and runs one line at a time and stops at the first error, so a mistake is easy to locate. To ship, use a compiler: it translates the whole program once into machine code, which then runs quickly with no translator present, and the customer receives only the executable rather than the source. The two are not rivals - name the stage and give the reason, because "a compiler is faster" on its own earns nothing.
Hardware is the physical parts; software is the programs. System software runs the computer (OS, drivers, utilities); application software does a task for the user.
A compiler translates the whole program at once (the finished program runs fast, and all errors are reported at the end); an interpreter translates line by line (it stops at the first error, runs slower, and is needed every time).
High-level languages are close to English and run on any computer; low-level languages (assembly, machine code) are tied to one type of CPU.
An interrupt is a signal that makes the CPU stop, save its place, service the event, then carry on where it left off.
Learn the operating system's roles: managing files, memory, peripherals, multitasking, security and the user interface.
The internet and the world wide web · อินเทอร์เน็ตและเวิลด์ไวด์เว็บ
Syllabus · หลักสูตร
English
Candidates should be able to:
Notes and guidance
1 Understand the difference between the internet and the world wide web
• The internet is the infrastructure • The world wide web is the collection of websites and web pages accessed using the internet
2 Understand what is meant by a uniform resource locator (URL)
• A URL is a text-based address for a web page; it can contain the protocol, the domain name and the web page/file name
3 Describe the purpose and operation of hypertext transfer protocol (HTTP) and hypertext transfer protocol secure (HTTPS)
4 Explain the purpose and functions of a web browser
• The main purpose of a web browser is to render hypertext markup language (HTML) and display web pages • Functions include: – storing bookmarks and favourites – recording user history – allowing use of multiple tabs – storing cookies – providing navigation tools – providing an address bar
5 Describe how web pages are located, retrieved and displayed on a device when a user enters a URL
• Including the role of: – the web browser – IP addresses – the domain name server (DNS) – the web server – HTML
6 Explain what is meant by cookies and how they are used, including session cookies and persistent cookies
• Cookies are used for functions, including: – saving personal details – tracking user preferences – holding items in an online shopping cart – storing login details
Internet คือ infrastructure — โครงสร้างพื้นฐาน ซึ่งเป็นเครือข่ายคอมพิวเตอร์ทั่วโลกขนาดใหญ่พร้อมสายเคเบิล เกร้าเตอร์ และการเชื่อมต่อต่างๆ ที่เชื่อมโยงกัน
World wide web (WWW) คือกลุ่มของ websites และหน้าเว็บที่คุณดูโดยใช้ Internet
ดังนั้น Internet คือเครือข่าย ส่วน Web เป็นหนึ่งในสิ่งที่คุณใช้ บน เครือข่ายนั้น
The internet is the worldwide network; the world wide web is one of the things you use on itเราเตอร์เชื่อมเครือข่ายในบ้านเข้ากับอินเตอร์เน็ตและส่งข้อมูลไปยังที่ถูกต้อง
A uniform resource locator 统一资源定位符 (URL) is a text-based address for a web page. You type it into a web browser 网页浏览器 to visit a page, for example https://www.example.com/index.html.
How a web page reaches you · วิธีที่หน้าเว็บถึงคุณ
English
When you type a URL and press enter, several steps happen:
The browser needs the website's IP address 网际协议地址, but a URL uses a name, not a number.
The browser asks a domain name service 域名服务 (DNS) — a system that stores the IP address for each web address.
The DNS finds the matching IP address and sends it back to the browser.
The browser uses the IP address to contact the web server 网页服务器 that stores the page.
The web server sends the page's HTML back to the browser.
The browser turns the HTML into the page and displays it.
If the DNS does not have the address, it asks another DNS server until the address is found.
Worked example. Break down the URL https://www.example.com/books/index.html. https is the protocol, the set of rules used to transfer the page (the s means the transfer is encrypted). www.example.com is the domain name, which identifies the web server and which a DNS server turns into an IP address. /books/index.html is the file path and file name of the resource stored on that server. Name each part together with its job: an answer that says "the first bit" and "the last bit" describes the URL without ever explaining it.
ไทย
เมื่อกะพิมพ์ URL แล้วกด Enter จะเกิดขั้นตอนต่างๆ ดังนี้:
Browser ต้องการ IP address ของเว็บไซต์ แต่ URL ใช้ชื่อแทนตัวเลข
Browser ถาม domain name service (DNS) — ระบบที่เก็บ IP address สำหรับแต่ละที่อยู่เว็บ
DNS หา IP address ที่ตรงกันและส่งกลับไปยัง Browser
Browser ใช้ IP address tersebut ติดต่อ web server ที่เก็บหน้าเว็บ
Web server ส่ง HTML ของหน้าเว็บกลับไปยัง Browser
Browser แปลง HTML ให้เป็นหน้าเว็บและแสดงออกมา
The browser asks a DNS for the site's IP address, then requests the page from the web server, which returns the HTML
หาก DNS ไม่มีที่อยู่ที่ระบุไว้ มันจะถาม DNS Server อื่นจนกว่าจะพบที่อยู่ที่ต้องการ
Worked example. แยกส่วนประกอบของ URL https://www.example.com/books/index.html ออกมา https คือ protocol, ชุดกฎเกณฑ์ที่ใช้ส่งข้อมูลหน้าเว็บ (s หมายถึงการส่งข้อมูลมีการเข้ารหัส) www.example.com คือ domain name, ซึ่งระบุ web server และเปลี่ยนโดย DNS Server ให้เป็น IP address /books/index.html คือ file path and file name ของทรัพยากรที่เก็บอยู่บนเซิร์ฟเวอร์นั้น ชี้ชื่อแต่ละส่วนพร้อมกับ job: คำตอบที่บอกว่า "ส่วนแรก" และ "ส่วนสุดท้าย" นั้นอธิบาย URL โดยไม่อธิบายเนื้อหาจริง
Explore · สำรวจ
What happens when you load a web page · เกิดอะไรขึ้นเมื่อคุณโหลดหน้าเว็บ
Step through it. The web address is just a name — DNS turns it into an IP address before the browser can ask the right server for the page. · ให้เดินตามขั้นตอนนั้นๆ ที่อยู่เว็บเป็นเพียงชื่อ — DNS จะแปลงชื่อนั้นเป็นหมายเลข IP ก่อนที่เบราว์เซอร์จะขอหน้าที่ถูกต้องจากเซิร์ฟเวอร์
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
A digital currency 数字货币 is money that exists only in electronic form 电子形式. There are no coins or notes. It is stored and moved between people using computers, and can be used to pay for things online.
A problem with digital money is trust: how do you stop someone spending the same money twice, or changing the records? Blockchain solves this.
ไทย
Digital currency คือเงินที่มีอยู่เฉพาะใน electronic form ไม่มีเหรียญหรือธนบัตร เก็บและถ่ายโอนระหว่างบุคคลผ่านคอมพิวเตอร์ และสามารถใช้จ่ายซื้อสินค้าออนไลน์ได้
A blockchain 区块链 is a digital ledger 数字账本 — a shared record of every transaction 交易. The record is copied across many computers, so no single person controls it and it is very hard to change.
The transactions are kept in blocks joined in a chain. Each block holds:
the data of the transaction (who paid whom, and how much);
a timestamp 时间戳 (the date and time);
a hash value 哈希值 — a special code worked out from the block's contents.
Each block also stores the hash of the block before it. If someone changes an old block, its hash changes, so it no longer matches the next block. This breaks the chain and the change is spotted at once. This is how blockchain tracks transactions safely.
ไทย
Blockchain คือ digital ledger — บันทึกshared ของทุก transaction บันทึกนี้ถูกคัดลอกข้ามหลายเครื่อง ทำให้ไม่มีบุคคลใดควบคุมได้เพียงคนเดียวและแก้ไขได้ยากมาก
Hashing behind a blockchain · การแฮชเบื้องหลังบล็อกเชน
A hash is one-way and a tiny change to the input flips much of the output — a blockchain chains these hashes so any tamper is obvious. · การแฮชเป็นทางเดียวและการเปลี่ยนแปลงเล็กน้อยที่อินพุตจะทำให้เอาต์พุตเปลี่ยนไปมาก — บล็อกเชนเชื่อมโยงแฮชเหล่านี้เข้าด้วยกันเพื่อให้การแทรกแซงใด ๆ เห็นชัดทันที
1 Describe the processes involved in, and the aim of carrying out, a range of cyber security threats
• Including: – brute-force attack – data interception – distributed denial of service (DDoS) attack – hacking – malware (virus, worm, Trojan horse, spyware, adware, ransomware) – pharming – phishing – social engineering
2 Explain how a range of solutions are used to help keep data safe from security threats
• Including: – access levels – anti-malware, including anti-virus and anti-spyware – authentication (username and password, biometrics, two-step verification) – automating software updates – checking the spelling and tone of communications – checking the URL attached to a link – firewalls – privacy settings – proxy-servers – secure socket layer (SSL) security protocol
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
Cyber security 网络安全 means keeping computers, networks and data safe from attack. You must know these threats.
Threat
What it is
brute force attack 暴力破解
trying many passwords very quickly until the right one is found
data interception 数据拦截
"listening in" to steal data while it travels across a network
distributed denial of service 分布式拒绝服务 (DDoS) attack
flooding a server with so many requests that it cannot respond, so the website goes down
hacking 黑客攻击
gaining access to a computer system without permission
malware 恶意软件
harmful software (see the table below)
pharming 域名欺骗
secret code sends you to a fake website even when you type the correct address
phishing 网络钓鱼
fake emails or messages that trick you into giving away private details
social engineering 社会工程
tricking a person (not a computer) into breaking security, e.g. pretending to be the boss
Types of malware
Malware is any software made to harm a computer. The main types are:
Malware
What it does
virus 病毒
attaches to a file and copies itself when the file is opened; can delete or damage data
worm 蠕虫
copies itself across a network on its own, without needing a file to be opened
Trojan horse 特洛伊木马
pretends to be useful software, but harms the computer once installed
spyware 间谍软件
secretly records what you do, such as the keys you press
adware 广告软件
floods you with unwanted adverts
ransomware 勒索软件
locks your files and demands payment to unlock them
Impact of the threats
These attacks can steal personal data, delete or change files, stop a service from working, cost money, and make users lose trust in a company. For example, a DDoS attack can make an online shop unusable, so it loses sales.
proxy server — ตั้งอยู่ระหว่างผู้ใช้และอินเทอร์เน็ต ซ่อน IP Address ของผู้ใช้และกรองเนื้อหาที่ไม่ปลอดภัยออก
Explore · สำรวจ
Encryption with a key · การเข้ารหัสด้วยกุญแจ
Change the shift — that is the key. Each letter slides that many places to make ciphertext, and the same key slides it back. That is symmetric encryption. · เปลี่ยนค่าการเลื่อน — นั่นคือกุญแจสำคัญ ตัวอักษรแต่ละตัวเลื่อนจำนวนตำแหน่งนั้นเพื่อสร้างข้อความที่เข้ารหัส และกุญแจเดียวกันก็เลื่อนกลับ ทำให้เป็นระบบเข้ารหัสแบบสมมาตร
The internet is the worldwide network (the infrastructure); the world wide web is the pages you view on it — do not mix the two up.
Learn how a page loads: the browser asks a DNS for the site's IP address, then requests the page from the web server, which returns the HTML.
Match the malware types: virus (attaches to a file), worm (spreads by itself across a network), Trojan horse (pretends to be useful), spyware, ransomware.
Match each threat to a defence: phishing/pharming → check the URL; brute force → strong passwords + two-step verification; interception → encryption; hacking/DDoS → a firewall.
A session cookie is deleted when you close the browser; a persistent cookie is saved to remember you between visits.
ไทย
internet คือเครือข่ายทั่วโลก (โครงสร้างพื้นฐาน); world wide web คือหน้าเว็บที่คุณดูบนนั้น — อย่าสับสนทั้งสองอย่าง
เรียนรู้วิธีการโหลดหน้าเว็บ: Browser จะถาม DNS สำหรับ IP Address ของเว็บไซต์ แล้วขอหน้าเว็บจาก web server ซึ่งส่ง HTML กลับมา
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
An automated system 自动化系统 is a mix of software and hardware that senses and responds to data in its environment 环境, with no need for human intervention 人工干预. In other words, it works on its own.
Examples of automated systems:
a central heating 中央供暖 system;
a chemical process 化学过程 in a factory;
a greenhouse 温室 (for growing plants);
a car park barrier 停车场道闸.
Sensors, microprocessors and actuators
Three parts work together in an automated system.
Part
Job
sensor 传感器
measures a physical quantity (such as temperature or light) and sends the data
microprocessor 微处理器
compares the data with stored values and makes decisions
actuator 执行器
receives a signal and causes movement or action (such as opening a valve)
The cycle works like this:
The sensor sends data to the microprocessor.
The microprocessor compares this data with stored values 存储值 and makes a decision.
The microprocessor sends signals to the actuators to take action.
For example, in a greenhouse: a temperature sensor reads the heat; the microprocessor compares it with the wanted value; if it is too hot, the microprocessor signals an actuator to open a window.
The syllabus names many sensor types 传感器类型, each reading one physical quantity – for example an accelerometer 加速度计 (movement or tilt), a humidity 湿度 sensor (water in the air), and a proximity 接近 sensor (a nearby object):
Sensor
Measures
Typical use
temperature
heat
ovens, greenhouses, heating
light
brightness
automatic lights, cameras
pressure
force on a surface
alarm floor mats, touchscreens
infra-red / proximity
a nearby object
automatic doors, parking sensors
acoustic (sound)
sound level
noise monitors
humidity / moisture
water in air or soil
greenhouses, irrigation
gas
a gas being present
smoke and CO alarms
pH
acidity
pools, fish tanks
accelerometer
movement or tilt
phones, airbag triggers
magnetic field
magnetism
door contacts, compasses
flow / level
fluid flow or depth
pipes, tanks
To pick a sensor for a scenario, choose the one that reads the right physical quantity: a fish tank needs pH and temperature sensors; an automatic door needs an infra-red / proximity sensor.
Advantages and disadvantages
Automated systems are used in many situations, such as industry, transport, agriculture 农业 (farming), weather (gathering data), gaming and lighting.
Advantages
Disadvantages
work all day and night, without rest
cost a lot to buy and set up
faster and more consistent 一致的 than people
can break down and need expert repair
can work in places unsafe for people
may replace people's jobs
fewer human mistakes
cannot easily react to a situation they were not built for
Worked example. Describe how an automatic greenhouse holds the temperature at 25 °C. A temperature sensor continuously measures the temperature and sends its reading, converted to digital by an ADC, to the microprocessor. The microprocessor compares the reading with the stored value of 25 °C. If the temperature is above it, the microprocessor signals an actuator to open a window or switch on a fan; if it is below, it switches on a heater. The whole loop then repeats continuously. Two marks nearly always sit on the words "compares with a stored (pre-set) value" and "the process repeats" - a description that stops at "the sensor tells the computer" leaves them behind.
ไทย
Automated system คือชุดรวมของ software และ hardware ที่รับรู้และตอบสนองต่อข้อมูลใน environment ของมัน โดยไม่ต้องมี human intervention. กล่าวคือ มันทำงานได้ด้วยตัวเอง
Tap round the loop. An automated system senses, compares against a target, then acts — and because the action changes what it senses, it keeps correcting itself with no human needed. · วนรอบที่ลูป ระบบอัตโนมัติจะรับรู้ เปรียบเทียบกับเป้าหมาย แล้วดำเนินการ — และเนื่องจากกระทำนั้นเปลี่ยนแปลงสิ่งที่มันรับรู้ มันจึงปรับแก้ตัวเองอย่างต่อเนื่องโดยไม่ต้องใช้มนุษย์
lack of independent decision-making/læk ɒv ˌɪndɪˈpendənt dɪˈsɪʒn ˈmeɪkɪŋ/
การขาดการตัดสินใจอย่างอิสระ
Artificial intelligence/ˌɑːtɪˈfɪʃl ɪnˈtelɪdʒəns/
ปัญญาประดิษฐ์
simulation/ˌsɪmjʊˈleɪʃn/
การจำลอง
6.2
Robotics · หุ่นยนต์วิทยา
Syllabus · หลักสูตร
English
Candidates should be able to:
Notes and guidance
1 Understand what is meant by robotics
• Robotics is a branch of computer science that incorporates the design, construction and operation of robots • Examples include factory equipment, domestic robots and drones
2 Describe the characteristics of a robot
• Including: – a mechanical structure or framework – electrical components, such as sensors, microprocessors and actuators – programmable
3 Understand the roles that robots can perform and describe the advantages and disadvantages of their use
• Robots can be used in areas including: – industry – transport – agriculture – medicine – domestic settings – entertainment
1 Understand what is meant by artificial intelligence (AI)
• AI is a branch of computer science dealing with the simulation of intelligent behaviours by computers
2 Describe the main characteristics of AI as the collection of data and the rules for using that data, the ability to reason, and it can include the ability to learn and adapt
3 Explain the basic operation and components of AI systems to simulate intelligent behaviour
• Limited to: – expert systems – machine learning • Expert systems have a knowledge base, a rule base, an inference engine and an interface • Machine learning is when a program has the ability to automatically adapt its own processes and/or data
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
Artificial intelligence 人工智能 (AI) is the simulation 模拟 of human intelligence by computer systems. This means a computer doing tasks that normally need human thinking.
Characteristics of AI
AI systems usually have these features:
they collect data and the rules 规则 for using that data;
they have the ability to reason 推理 (work things out using the rules);
they have the ability to draw conclusions 得出结论, which may be approximate 近似的 (a best guess) or definite 确定的 (certain);
they have the ability to learn 学习 from data;
they have the ability to adapt 适应 — to change their behaviour as they get new data.
Examples of AI
expert systems 专家系统 — software that gives advice like a human expert (for example, helping a doctor with a diagnosis);
natural language processing 自然语言处理 — understanding human speech or text;
self-driving cars 自动驾驶汽车.
Inside an expert system
An expert system stores human expertise and reasons from it. It has four parts:
a knowledge base 知识库 – the stored facts about the subject;
a rule base 规则库 – the "if… then…" rules a human expert would apply;
an inference engine 推理引擎 – applies the rules to the facts to reach a conclusion;
a user interface 用户界面 – asks the user questions and shows the result.
The interface collects facts from the user; the inference engine runs the rule base against the knowledge base; and the system outputs a diagnosis or a probability – as used to help a doctor diagnose an illness or to find a car fault.
Machine learning
Machine learning 机器学习 is a program that improves its own performance from experience, without being explicitly reprogrammed. It finds patterns in data and adapts: a search engine gets better at ranking results, a voice assistant recognises spoken commands more accurately, and a robot vacuum gradually learns the layout of a room.
Narrow, general and strong AI
Type
What it means
narrow AI 弱人工智能
can do only one task or a small set of tasks (for example, a chess program). All AI today is narrow AI.
general AI 通用人工智能
could do any task a human can do, switching between many different tasks.
strong AI 强人工智能
would think and be aware like a real human mind. This does not exist yet.
Learn the control loop: a sensor measures a quantity → the microprocessor compares it with a stored value → an actuator takes action; then the loop repeats.
Do not confuse the parts: a sensor sends data in; an actuator causes movement out.
A robot follows programmable instructions and cannot make its own decisions when something unexpected happens.
AI simulates human thinking: it collects data and rules, reasons, draws conclusions, and can learn and adapt.
Know the AI levels: narrow (one task; all AI today), general (any human task), strong (self-aware; does not exist yet).
1 Understand the program development life cycle, limited to: analysis, design, coding and testing
• Including identifying each stage and performing these tasks for each stage: – analysis: abstraction, decomposition of the problem, identification of the problem and requirements – design: decomposition, structure diagrams, flowcharts, pseudocode – coding: writing program code and iterative testing – testing: testing program code with the use of test data
2 (a) Understand that every computer system is made up of sub-systems, which are made up of further sub-systems (b) Understand how a problem can be decomposed into its component parts
• Including: – stating the purpose of an algorithm – describing the processes involved in an algorithm
4 Understand standard methods of solution
• Limited to: – linear search – bubble sort – totalling – counting – finding maximum, minimum and average values
5 (a) Understand the need for validation checks to be made on input data and the different types of validation check
• Including: – range check – length check – type check – presence check – format check – check digit
(b) Understand the need for verification checks to be made on input data and the different types of verification check
• Including: – visual check – double entry check
6 Suggest and apply suitable test data
• Limited to: – normal – abnormal – extreme – boundary • Extreme data is the largest/smallest acceptable value • Boundary data is the largest/smallest acceptable value and the corresponding smallest/largest rejected value
7 Complete a trace table to document a dry-run of an algorithm
• Including, at each step in an algorithm: – variables – outputs – user prompts
8 Identify errors in given algorithms and suggest ways of correcting these errors
9 Write and amend algorithms for given problems or scenarios, using: pseudocode, program code and flowcharts
• Precision is required when writing algorithms, e.g. x > y is acceptable but x is greater than y is not acceptable • See section 4 for flowchart symbols • See section 4 for pseudocode
• ต้องมีความแม่นยำในการเขียนอัลกอริทึม เช่น x > y ยอมรับได้ แต่ x is greater than y ไม่ยอมรับ • ดูส่วนที่ 4 สำหรับสัญลักษณ์ในแผนผังการไหล • ดูส่วนที่ 4 สำหรับรหัสเทียม
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
7.1
The program development life cycle · วัฏจักรการพัฒนาโปรแกรม
English
The program development life cycle 程序开发生命周期 is the set of stages used to make a program. There are four stages.
Stage
What you do
analysis 分析
study the problem and work out what is needed
design 设计
plan how the program will work
coding 编码
write the program code and test it as you go
testing 测试
run the finished program with test data to find errors
Analysis
In analysis you understand the problem. Two key skills help:
abstraction 抽象 — keep only the important details and ignore the rest;
decomposition 分解 — break a big problem into smaller, easier parts.
Design
In design you plan the solution, often using decomposition. You can show the parts as sub-systems 子系统 in a structure diagram 结构图 (a chart that splits a system into smaller boxes).
Coding and testing
In coding you write the program code. You use iterative testing 迭代测试 — test small parts again and again as you build them. In testing you run the whole program with test data 测试数据 to check it works.
An algorithm 算法 is a set of steps, in the right order, that solves a problem. Every algorithm can be split into three parts:
input 输入 — the data that goes in;
processing 处理 — the work done on the data;
output 输出 — the result that comes out.
This is called decomposition into inputs, processes and outputs. For example, for "find the average of three marks": the inputs are the three marks; the processing is adding them and dividing by 3; the output is the average.
A trace table 追踪表 records the value of each variable as an algorithm runs, step by step. It helps you:
check that an algorithm works correctly;
work out what an algorithm does by following it with given data.
Example: trace this algorithm with the input 5.
i
total
OUTPUT
1
1
2
3
3
6
4
10
5
15
15
The trace shows the algorithm adds up 1 to n. With input 5 the output is 15.
Worked example. Trace this algorithm and give the output.
DIV gives only the whole-number part of a division. Take one row per pass: x becomes 10 (count 1), then 5 (count 2), then 2 (count 3), then 1 (count 4). Now x > 1 is false, so the loop stops and the output is 4. Two habits protect these marks: test the condition before each pass rather than after, and write a new row for every pass - trying to hold the values in your head is what makes traces go wrong.
Standard methods of solution · วิธีการแก้ปัญหามาตรฐาน
English
You must know these common algorithms.
Linear search
A linear search 线性查找 checks each item in a list, one by one, until it finds the value it wants or reaches the end.
Bubble sort
A bubble sort 冒泡排序 puts a list in order. It compares each pair of side-by-side items and swaps them if they are in the wrong order. It repeats this until no more swaps are needed.
Totalling and counting
totalling 求和 — keep adding values to a running total (Total ← Total + Value).
counting 计数 — add 1 to a counter each time something happens (Count ← Count + 1).
Maximum, minimum and average
to find the maximum 最大值: keep the largest value seen so far.
to find the minimum 最小值: keep the smallest value seen so far.
to find the average 平均值: divide the total by how many values there are.
Learn the four life-cycle stages: analysis → design → coding → testing. Abstraction keeps only the important details; decomposition breaks a problem into smaller parts.
Validation checks data is sensible (range, length, type, presence, format checks); verification checks it was copied correctly (a visual check or double entry).
Learn the four test-data types: normal (accepted), abnormal (rejected), extreme (the largest/smallest still allowed), boundary (the values either side of a limit).
To work out what an algorithm does, fill in a trace table — write down every variable's value at each step.
Know the standard algorithms: linear search (check each item in turn) and bubble sort (swap side-by-side pairs until no swaps are needed).
(d) Understand and use the concepts of totalling and counting
(e) Understand and use the concept of string handling
• Including: – length – substring – upper – lower • The first character of the string can be position zero or one
(f) Understand and use arithmetic, relational and logical operators
• Arithmetic, limited to: – + – – – / – * – ^ (raised to power of) – MOD – DIV • Relational, limited to: – = – < – <= – > – >= – <> (not equal to) • Logical, limited to: – AND – OR – NOT
5 Understand and use nested statements
• Including nested selection and iteration • Candidates will not be required to write more than three levels of nested statements
6 (a) Understand what is meant by procedures, functions and parameters (b) Define and use procedures and functions, with or without parameters (c) Understand and use local and global variables
• Procedures and functions may have up to three parameters
7 Understand and use library routines
• Including: – MOD – DIV – ROUND – RANDOM
8 Understand how to create a maintainable program
• Including appropriate use of: – meaningful identifiers – the commenting feature provided by the programming language – procedures and functions – relevant and appropriate commenting of syntax • Use meaningful identifiers for: – variables – constants – arrays – procedures and functions
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
English
A variable 变量 is a named store that holds a value which can change while the program runs. A constant 常量 is a named store whose value is fixed and does not change.
You should declare 声明 them (say their name and type) before use:
Use a constant for a value that never changes (like Pi), so it is set in one place and is easy to read.
totalling 求和 — keep adding values to a running total: Total ← Total + Value.
counting 计数 — add 1 to a counter each time: Count ← Count + 1.
Worked example. A program must read 5 marks, then output the total and the average.
Two lines carry the marks. Total ← 0 must sit before the loop: put it inside and the total resets on every pass, so the program outputs only the last mark. And Average ← Total / 5 must sit after the loop, because the total is not complete until every mark has been added. Initialise before, calculate after - that ordering is what the question is really testing.
ไทย
การรวมผล (totalling) — เพิ่มค่าเข้าไปในผลรวมสะสม: Total ← Total + Value.
The first character is at position 1. SUBSTRING(Word, Start, Length) takes Length characters beginning at Start — drag the two handles and read the call it builds.
1 Define a single-table database from given data storage requirements
• Including: – fields – records – validation
2 Suggest suitable basic data types
• Including: – text/alphanumeric – character – Boolean – integer – real – date/time
3 Understand the purpose of a primary key and identify a suitable primary key for a given database table
4 Read, understand and complete structured query language (SQL) scripts to query data stored in a single database table
• Limited to: – SELECT – FROM – WHERE – ORDER BY DESCENDING – ORDER BY ASCENDING – SUM – COUNT – AND – OR • Identifying the output given by an SQL statement that will query the given contents of a database table
4 อ่าน ทำความเข้าใจ และเติม สคริปต์ structured query language (SQL) เพื่อค้นหาข้อมูลที่จัดเก็บในตารางฐานข้อมูลเดียว
•จำกัดอยู่ที่: – SELECT – FROM – WHERE – ORDER BY DESCENDING – ORDER BY ASCENDING – SUM – COUNT – AND – OR • ระบุผลลัพธ์ที่ได้จากคำสั่ง SQL ที่จะค้นหาเนื้อหาที่กำหนดของตารางฐานข้อมูล
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
9.1
What is a database? · ฐานข้อมูลคืออะไร?
English
A database 数据库 is an organised store of data, kept so that it is easy to search, sort and update. At IGCSE you work with a single-table database 单表数据库 — all the data is held in one table.
A primary key 主键 is a field that holds a unique 唯一的 value for every record. No two records can have the same primary key, so it lets you pick out exactly one record.
In the table above, StudentID is a good primary key because every student has a different number. A field like FormClass would be a bad primary key, because many students share the same class.
Validation in a database · การตรวจสอบความถูกต้องในฐานข้อมูล
English
When data is put into a database, validation 验证 checks make sure it is sensible — for example a range check on an age field, or a presence check so a field is not left empty. (You saw these checks in topic 7.)
Structured Query Language 结构化查询语言 (SQL) is a language used to query 查询 a database — to pick out the records you want. You must understand and complete SQL scripts.
SELECT, FROM and WHERE
SELECT says which fields to show.
FROM says which table to use.
WHERE gives a condition 条件, so only matching records are shown.
This shows the first name and class of every student who has paid the fees.
Use * to select all fields:
ORDER BY
ORDER BY sorts the results. Use ASC for ascending 升序 (smallest first, A→Z) or DESC for descending 降序 (largest first, Z→A).
AND and OR
Join conditions with AND (both must be true) or OR (at least one must be true).
SUM and COUNT
SUM adds up the values in a number field.
COUNT counts how many records match.
This counts how many students have not paid. SUM works the same way but adds a number field instead of counting rows.
Working out the output
To find the output of an SQL script, read it in this order:
FROM — which table;
WHERE — keep only the records that match the condition;
SELECT — show only the chosen fields;
ORDER BY — put the results in order.
Following these steps, you can write down exactly which rows and columns the query returns.
Worked example. A Book table has the fields Title, Author, Price and InStock. Write a query showing the title and price of every book by Orwell that is in stock, cheapest first.
Build it in the reading order: FROM names the table; WHERE keeps only the matching records, and because there are two conditions they need AND; SELECT shows only the two fields asked for; ORDER BY … ASC sorts them. Text values go in quotes, and only the fields the question asks for belong in SELECT - adding Author just because you filtered on it is the commonest way to lose a mark here.
1 Identify and use the standard symbols for logic gates
• See section 4 for logic gate symbols
2 Define and understand the functions of logic gates
• Including: – NOT – AND – OR – NAND – NOR – XOR (EOR) – the binary output produced from all the possible binary inputs • NOT is a single input gate • All other gates are limited to two inputs
3 (a) Use logic gates to create given logic circuits from a: (i) problem statement (ii) logic expression (iii) truth table (b) Complete a truth table from a: (i) problem statement (ii) logic expression (iii) logic circuit
• Circuits must be drawn for the statement given, without simplification • Logic circuits will be limited to a maximum of three inputs and one output • An example truth table with three inputs, for completion: A B C Output | 0 0 0 | 0 0 1 | 0 1 0 | 0 1 1 | 1 0 0 | 1 0 1 | 1 1 0 | 1 1 1
(c) Write a logic expression from a: (i) problem statement (ii) logic circuit (iii) truth table
ไทย
ผู้เข้าสอบควรสามารถ:
หมายเหตุและคำแนะนำ
1 ระบุและใช้สัญลักษณ์มาตรฐานสำหรับ เกตตรรกะ
• ดูส่วนที่ 4 สำหรับสัญลักษณ์เกตตรรกะ
2 นิยามและเข้าใจหน้าที่ของ เกตตรรกะ
• รวมถึง: – NOT – AND – OR – NAND – NOR – XOR (EOR) •เอาต์พุตแบบไบนารีที่เกิดขึ้นจากอินพุตแบบไบนerseyที่เป็นไปได้ทั้งหมด • NOT เป็นเกตที่มีอินพุตเดียว • เกตอื่นๆ ถูกจำกัดให้อินพุตได้เพียงสองเท่านั้น
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
10.1
What is Boolean logic? · บูลีนลอจิกคืออะไร?
English
Boolean logic 布尔逻辑 works with values that are either true or false. In electronics these are shown as 1 (true) and 0 (false). A logic gate 逻辑门 takes one or more of these inputs and gives one output, following a fixed rule.
A truth table 真值表 lists every possible set of inputs and the output for each. You build it by writing out all the input combinations.
Switch the inputs and pick a gate to see its output — AND, OR, NOT, NAND, NOR, XOR. · สลับอินพุตและเลือกประตูเพื่อดูเอาต์พุต — AND, OR, NOT, NAND, NOR, XOR
ตัวอย่างเช่น-expression (A AND B) OR (NOT C) หมายความว่า: ทำ A AND B, ทำ NOT C, แล้วนำผลลัพธ์ทั้งสองมา OR together
Expression X = (A AND B) OR (NOT C) วาดเป็นวงจรลอจิก
Explore · สำรวจ
Truth tables · ตารางความจริง
Build the truth table for AND, OR, XOR and NOT — the logic behind every expression. · สร้างตารางความจริงสำหรับ AND, OR, XOR และ NOT — ตรรกะเบื้องหลังทุกนิพจน์
A logic circuit 逻辑电路 joins gates together to carry out a task. The output of one gate can become the input of another. At IGCSE a circuit has up to three inputs and one output.
You must be able to move between four forms:
a problem statement 问题陈述 (a description in words),
a logic expression,
a logic circuit,
a truth table.
From a problem statement to a circuit
Read the statement and pick out the conditions and the logic words (and, or, not). For example:
An alarm (X) sounds when the door is open (A) AND the system is switched on (B).
This is X = A AND B, so you draw one AND gate with inputs A and B.
Completing a truth table from a circuit or expression
To fill in a truth table:
Write all the input combinations. For three inputs there are 8 rows (000 up to 111).
Work out each gate's output in order, one column at a time.
The last column is the final output.
A
B
C
A AND B
(A AND B) OR C
0
0
0
0
0
0
0
1
0
1
0
1
0
0
0
0
1
1
0
1
1
0
0
0
0
1
0
1
0
1
1
1
0
1
1
1
1
1
1
1
Adding a middle "working" column for each gate makes the final output easy to fill in. Always draw the circuit exactly as the statement says, without simplifying it.
Worked example. Complete the truth table for X = (A AND B) OR (NOT C) for the row A = 1, B = 0, C = 0. Work outwards from the brackets, one gate at a time. First A AND B = 1 AND 0 = 0, because AND needs both inputs to be 1. Next NOT C = NOT 0 = 1. Finally OR the two results: 0 OR 1 = 1. So X = 1. Give each intermediate gate its own column rather than trying to do the whole expression in one step: with three inputs there are $2^3 = 8$ rows, and those intermediate columns are where the method marks live even if the final answer slips.
ตัวอย่างทำข้อ. เติมตารางความจริงสำหรับ X = (A AND B) OR (NOT C) สำหรับแถว A = 1, B = 0, C = 0. ทำ จากวงเล็บออกไปด้านนอก ก้อนหนึ่งต่อหนึ่ง ก่อนอื่น A AND B = 1 AND 0 = 0 เพราะ AND ต้องมีอินพุตทั้งสองเป็น 1 ต่อมา NOT C = NOT 0 = 1. สุดท้ายนำผลลัพธ์ทั้งสองมา OR กัน: 0 OR 1 = 1. ดังนั้น X = 1. ให้แต่ละ gates ระหว่างกลางมี คอลัมน์ของตัวเอง แทนที่จะพยายามคำนวณทั้ง-expression ในขั้นตอนเดียว: เมื่อมีอินพุตสามตัวจะมี $2^3 = 8$ แถว และคอลัมน์ระหว่างกลางเหล่านั้นคือจุดที่วิธีการทำงานอยู่ แม้คำตอบสุดท้ายจะผิดพลาดก็ตาม
Pick one and the site follows you — notes, papers, videos and practice all open on it. · เลือกหนึ่งตัว และเว็บจะติดตามคุณ — หมายเหตุ, ใบงาน, วิดีโอ และการฝึกฝนจะเปิดอยู่ที่นั้น
Type to search notes, lessons, code, vocabulary and past-paper questions across every subject. · พิมพ์เพื่อค้นหาบันทึก, บทเรียน, โค้ด, คำศัพท์ และคำถามข้อสอบเก่าในทุกวิชา