跳到主要内容

硬件

A-Level 计算机科学知识点 3

本主题的视频课程 打开视频页面
22:37

计算机与组件

打开任何一台电脑——穿过机箱,越过芯片,一直到底层的硅片——你会发现开关。不是成千上万个。而是数十亿个。每个开关都做……

英文讲解 · 可切换中英文字幕

3.1

计算机及其部件

教学大纲
考生应能: 注释与指导
展示对输入、输出、主存储器和**辅助(包括可移动)**存储需求的理解
展示对嵌入式系统的理解 包括:嵌入式系统的优点和缺点
描述硬件设备的主要操作 包括:激光打印机、3D打印机、麦克风、扬声器、磁性硬盘、固态(闪存)内存、光盘读写器、触摸屏、虚拟现实头戴式显示器
展示对缓冲区用途的理解
解释随机存取存储器(RAM)与只读存储器(ROM)之间的区别 包括它们在各类设备和系统中的使用
解释静态随机存取存储器(SRAM)与动态随机存取存储器(DRAM)之间的区别 包括SRAM和DRAM在各类设备和系统中的使用,以及根据设备及其用途选择其中一种而非另一种的原因
解释可编程只读存储器(PROM)、可擦除可编程只读存储器(EPROM)和电可擦除可编程只读存储器(EEPROM)之间的区别
展示对监控和控制系统的理解 包括:• 监控与控制的区别 • 传感器(包括温度、压力、红外、声音传感器)和执行器的使用 • 反馈的重要性

来源:Cambridge International 教学大纲

English

A general-purpose computer has four building blocks:

  • input devices 输入设备 — get data in (keyboard, mouse, microphone, scanner, sensors).
  • output devices 输出设备 — give results out (monitor, speakers, printer, actuators).
  • primary memory 主存储器 — fast memory the processor 处理器 (CPU) reaches directly (RAM and ROM). Holds the running program and its data.
  • secondary storage 辅助存储器 — slower, larger, keeps programs and data when not in use (hard disk, SSD, optical disc, USB stick).

The syllabus asks why each is needed. Input devices are needed because the computer can only work on data and instructions that have been entered. Output devices are needed to present the results in a form people can use. Primary memory is needed because the processor can only execute instructions and use data that are held in memory it can address directly, and it must reach them fast. Secondary storage is needed because RAM is volatile and primary memory is limited in capacity: programs and data must survive the power being switched off, in a larger and cheaper store, and removable storage lets data be moved between computers or kept as a backup.

A full-size white wireless QWERTY computer keyboard on a white background
A keyboard: a common input device for typing text and commands
A modern wireless computer mouse on a white background, with two buttons and a scroll wheel
A mouse: a pointing input device
A flatbed scanner on a white background, with a photo coming out of the front after scanning
A flatbed scanner: an input device that turns a paper page into a digital image
A silver flat-screen computer monitor on a round stand, with a dark screen
A monitor: a common output device that displays the screen image
探索

点击一个计算机系统的模块

探索四个模块加上 CPU。数据流动 输入 → 处理 → 输出,而主存储器保存运行中的程序,辅助存储为以后保留它。

探索

网络路由实验

跟踪设备通过网络硬件和协议的数据传输路径。

词汇 训练
English 中文 拼音
input devices/ˈɪnpʊt dɪˈvaɪsɪz/ 输入设备 shū rù shè bèi
output devices/ˈaʊtpʊt dɪˈvaɪsɪz/ 输出设备 shū chū shè bèi
primary memory/ˈpraɪməri ˈmeməri/ 主存储器 zhǔ cún chǔ qì
processor/ˈprəʊsesə/ 处理器 chǔ lǐ qì
secondary storage/ˈsekəndəri ˈstɔːrɪdʒ/ 辅助存储器 fǔ zhù cún chǔ qì
3.1

嵌入式系统

English

An embedded system 嵌入式系统 is a computer built into another device to do one fixed job (washing machine, microwave, car engine unit, thermostat).

  • benefits: optimised for one task, so it is small, uses little power and is cheap to make in volume; reliable, because it runs one fixed program with few chances to go wrong; starts quickly and needs no user set-up; easy to use through a simple interface.
  • drawbacks: limited to its one task, so it cannot be upgraded to do more; hard to update (its firmware 固件 may need special tools or cannot be changed at all); difficult to troubleshoot, and usually the whole device must be replaced when it fails; if it is connected to a network it can be a security weakness, because its software is rarely patched.

A "describe the drawbacks" question wants each drawback as a full point: what the limitation is and what it means for the user, for example "the firmware cannot be updated, so a security fault found later cannot be fixed".

词汇 训练
English 中文 拼音
embedded system/emˈbedɪd ˈsɪstəm/ 嵌入式系统 qiàn rù shì xì tǒng
firmware/ˈfɜːmweə/ 固件 gù jiàn
3.1

主要硬件设备

English

Laser printer

A laser printer 激光打印机 scans the page image onto a charged photosensitive drum 感光鼓. Toner 墨粉 sticks to the charged areas, transfers to the paper, and is melted on by a fuser. Fast, sharp, high-volume.

A black desktop laser printer on a white background, with a printed page coming out of the top
A laser printer: fast, sharp printing using a charged drum and toner

How it works, in the steps the mark scheme lists:

  1. The data for the page is sent to the printer's buffer.
  2. The drum is given a uniform electrostatic charge.
  3. A laser, reflected off a rotating mirror, scans the page image onto the drum, removing the charge where it strikes, so the charge left on the drum matches the image.
  4. Toner, a charged powder, is attracted to the charged parts of the drum only.
  5. The paper is given the opposite charge and rolled against the drum, so the toner transfers onto it.
  6. The fuser 定影器, a pair of heated rollers, melts the toner into the paper. The drum is then discharged and cleaned for the next page.

3D printer

A 3D printer 3D打印机 builds an object layer by layer: FDM melts plastic filament through a nozzle; stereolithography cures liquid resin with a UV laser. Used for prototypes and custom medical parts.

A black enclosed desktop FDM 3D printer with a glass front panel, a part being printed inside, on a white background
An FDM 3D printer builds an object layer by layer by melting plastic filament

How it works:

  1. A model of the object is designed in CAD software (or scanned).
  2. Slicing software divides the model into thin horizontal layers and produces the instructions for each one.
  3. The printer builds the object one layer at a time: an FDM printer melts plastic filament 塑料丝 and lays it down through a moving nozzle; a resin printer cures liquid resin with a laser or UV light; a powder printer fuses powder with a laser.
  4. Each layer bonds to the layer below, and the platform (or nozzle) moves by one layer's thickness.
  5. When the last layer is done, any support material is removed. Uses include prototypes, custom medical parts such as prosthetics, and spare parts printed on demand.

Microphone and speakers

A microphone 麦克风 turns sound into an electrical signal (a diaphragm vibrates, changing capacitor 电容器 charge or coil position); the signal is digitised by an analogue-to-digital converter 模数转换器 (ADC). A speaker does the reverse — a varying signal drives a coil in a magnetic field, moving a cone to make sound.

A black USB desktop microphone standing on its base, on a white background
A microphone turns sound into an electrical signal
Cutaway of a microphone: sound waves hit a diaphragm linked to a coil around a permanent magnet, giving an output current
Inside a microphone: sound vibrates the diaphragm and coil to produce a current
Cutaway of a loudspeaker: current in a coil around an iron core near a permanent magnet moves a paper cone to produce sound waves
Inside a loudspeaker: a varying current in the coil moves the cone to make sound

How a microphone works: sound waves make a diaphragm 膜片 vibrate; in a dynamic microphone a coil attached to the diaphragm moves in a magnetic field, so a varying current is induced in it, and in a condenser microphone the diaphragm is one plate of a capacitor whose capacitance changes as it moves; the varying analogue signal is then sampled by an ADC and stored as digital data. A speaker runs the chain backwards: a digital-to-analogue converter 数模转换器 (DAC) produces a varying current, the current in the coil creates a changing magnetic field that pushes against the permanent magnet, the coil and cone move in and out, and the cone's movement makes pressure waves in the air.

Magnetic hard disk (HDD)

A hard disk 硬盘 stores data on spinning platters coated with magnetic material. Each platter has tracks 磁道 divided into sectors 扇区. A read/write head 读写头 floats just above and magnetises tiny regions (write) or senses them (read). Cheap per gigabyte, but slower than SSDs and has moving parts.

An opened 3.5-inch hard disk drive: a shiny circular platter with the actuator arm and read/write head resting over it
An opened hard disk: the actuator arm carries the read/write head over a platter
A hard disk platter drawn as concentric track circles, one track highlighted, divided into sectors
Tracks and sectors on a hard disk platter

How it works: the platters spin at high speed (thousands of revolutions per minute); each surface is divided into concentric tracks and each track into sectors; read/write heads on actuator arms 磁头臂 move across the platters to the right track; to write, the head magnetises a tiny region with one of two polarities, representing 0 or 1; to read, it detects the polarity as the region passes beneath it. The delays, waiting for the arm to reach the track and for the sector to spin round, are why a hard disk is slower than an SSD.

Solid-state (flash) memory

A solid-state drive 固态硬盘 stores data as charge in transistors 晶体管, with no moving parts. Faster random access than HDDs, tougher, lower power, but dearer per gigabyte; each cell wears out after many writes.

The opened circuit board of a solid-state drive on a white background: a large black flash-memory chip on the left, a smaller controller chip, many tiny components, and a flat SATA connector along the bottom edge — no platters or moving parts
Inside an SSD: data is stored in flash memory chips, with no moving parts (compare the hard disk above)

How it works: each cell is a floating-gate transistor 浮栅晶体管; a charge trapped on the floating gate represents a bit and stays there when the power is off; a controller chip maps each address to a cell and spreads writes across the cells, because a cell survives only a limited number of writes.

Magnetic hard disk Solid-state drive
Moving parts platters and heads none
Speed slower: seek and rotation delays much faster random access
Cost per gigabyte lower higher
Robustness damaged by knocks; noisy; more power shock-resistant; silent; less power
Lifetime many rewrites; wears mechanically limited write cycles per cell

A "why a server uses hard disks rather than SSDs" question wants the left column: cheaper per gigabyte for very large capacities, a long life under constant rewriting, and easier data recovery.

Optical disc

A laser detects reflections from tiny pits on an optical disc 光盘 (CD, DVD, Blu-ray). The drive is an optical disc reader/writer: writing uses a stronger laser to change the surface's reflectivity.

An external optical disc drive on a white background, its tray open with a rainbow-coloured disc loaded
An optical disc drive: a laser reads tiny pits on a CD, DVD or Blu-ray disc

How it works: the disc carries one long spiral track of pits 凹坑 and lands 平台 (the flat areas between them); the disc spins and a laser is focused on the track; light reflected from a land differs from light reflected at the edge of a pit, and a light sensor reads each change as a 1 and no change as a 0. Writing uses a stronger laser to change the reflectivity of a dye or alloy layer. A Blu-ray uses a blue laser with a shorter wavelength, so its pits are smaller and closer together, which is why it holds more data than a DVD.

Touchscreen

A touchscreen 触摸屏 senses contact. Resistive 电阻式: two conductive layers pressed together; works with anything but is less accurate. Capacitive 电容式: a finger disturbs a charge field; accurate, multi-touch, used in phones.

People using a tablet touchscreen and a laptop
A touchscreen senses where a finger touches the glass

How it works: a resistive screen has two thin conductive layers separated by spacers; pressing pushes the top layer onto the bottom one, closing a circuit at that point, and the controller reads the voltage to find the coordinates. A capacitive screen has transparent electrodes that create an electric field; a finger changes the capacitance near the point of contact, and the controller uses this change to find the touch position. Projected capacitive screens can detect several fingers at once. Capacitive screens respond to a light touch but may not respond to a gloved finger or an ordinary stylus.

Virtual reality headset

A virtual reality 虚拟现实 (VR) headset has two small displays (one per eye) and motion sensors (accelerometer 加速度计, gyroscope 陀螺仪) that track head movement so the scene shifts as you look around.

A white virtual reality headset with its head strap and front cameras, on a white background
A virtual reality headset: two small displays and motion sensors track the head

How it works: each eye sees its own display through a lens, and the two images differ slightly, so the brain sees depth; sensors (accelerometer, gyroscope, sometimes cameras) report where the head is and which way it points; the computer re-renders the scene from that viewpoint many times a second, so turning the head turns the view; headphones give sound that matches the direction. Used for games, for training such as flight or surgery simulators, and for viewing designs before they are built.

词汇 训练
English 中文 拼音
microphone/ˈmaɪkrəfəʊn/ 麦克风 mài kè fēng
hard disk/hɑːd dɪsk/ 硬盘 yìng pán
optical disc/ˈɒptɪkl dɪsk/ 光盘 guāng pán
laser printer/ˈleɪzə ˈprɪntə/ 激光打印机 jī guāng dǎ yìn jī
drum/drʌm/ 感光鼓 gǎn guāng gǔ
toner/ˈtəʊnə/ 墨粉 mò fěn
fuser/ˈfjuːsə/ 定影器 dìng yǐng qì
3D printer/ˌθriː ˈdiː ˈprɪntə/ 3D打印机 3D dǎ yìn jī
filament/ˈfɪləmənt/ 塑料丝 sù liào sī
diaphragm/ˈdaɪəfræm/ 膜片 mó piàn
capacitor/kəˈpæsɪtə/ 电容器 diàn róng qì
analogue-to-digital converter/ˈænəlɒɡ tə ˈdɪdʒɪtl kənˈvɜːtə/ 模数转换器 mó shù zhuǎn huàn qì
digital-to-analogue converter/ˈdɪdʒɪtl tʊ ˈænəlɒɡ kənˈvɜːtə/ 数模转换器 shù mó zhuǎn huàn qì
tracks/træks/ 磁道 cí dào
sectors/ˈsektəz/ 扇区 shàn qū
read/write head/riːd raɪt hed/ 读写头 dú xiě tóu
actuator arms/ˈæktʃuːeɪtə ɑːmz/ 磁头臂 cí tóu bì
solid-state drive/ˈsɒlɪd steɪt draɪv/ 固态硬盘 gù tài yìng pán
transistors/trænˈzɪstəz/ 晶体管 jīng tǐ guǎn
floating-gate transistor/ˈfləʊtɪŋ ɡeɪt trænˈzɪstə/ 浮栅晶体管 fú zhà jīng tǐ guǎn
pits/pɪts/ 凹坑 āo kēng
lands/lændz/ 平台 píng tái
touchscreen/ˈtʌtʃskriːn/ 触摸屏 chù mō píng
resistive/rɪˈzɪstɪv/ 电阻式 diàn zǔ shì
capacitive/kəˈpæsɪtɪv/ 电容式 diàn róng shì
virtual reality/ˈvɜːtʃuːəl rɪˈælɪti/ 虚拟现实 xū nǐ xiàn shí
accelerometer/əkˌseləˈrɒmɪtə/ 加速度计 jiā sù dù jì
gyroscope/ˈdʒaɪrəskəʊp/ 陀螺仪 tuó luó yí
3.1

缓冲区

English

A buffer 缓冲 is memory that holds data temporarily while it moves between devices of different speeds. Example: the CPU writes a document to a printer buffer quickly, then is free to do other work while the printer prints from the buffer at its own pace. Buffers stop the fast device waiting for the slow one (also used in streaming, the keyboard, and disk access).

"State why a 3D printer needs a buffer": the computer sends the print data much faster than the printer can build the layers, so the data is held in the buffer until the printer is ready for it, and the processor is freed to do other work. When the buffer runs low the printer sends an interrupt 中断 to ask for more (topic 4). A video stream works the same way: the buffer fills ahead of playback so a short drop in the network speed does not stop the picture.

词汇 训练
English 中文 拼音
buffer/ˈbʌfə/ 缓冲 huǎn chōng
interrupt/ˈɪntərʌpt/ 中断 zhōng duàn
3.1

RAM 与 ROM

English
  • RAM 随机存取存储器 (Random Access Memory) — volatile 易失性 (loses data without power). Holds the OS, running programs and their data; read and written constantly.
  • ROM 只读存储器 (Read-Only Memory) — non-volatile 非易失性 (keeps data without power). Usually written once; holds firmware needed at start-up (the BIOS / boot loader).
RAM is volatile and read/write; ROM is non-volatile and read-only
RAM is volatile and read/write; ROM is non-volatile and read-only

ROM starts the system; RAM then holds the active work.

RAM ROM
Volatile? yes: contents lost when the power is off no: contents kept without power
Read/write? read and written constantly read only in normal use
Holds the operating system, running programs and their data the firmware and bootstrap program that start the computer
Size large, and can usually be increased small and fixed
Typical use the main memory of a computer or phone the start-up code of a PC; the whole program of an embedded system such as a washing machine

More RAM lets a computer hold more programs and data at once, so it swaps less between memory and disk and runs faster; that is the answer to "explain why the computer with more RAM performs better".

A RAM module (DIMM): a circuit-board stick with a black heat-spreader over the memory chips and a gold-edged connector that plugs into a slot on the motherboard
A RAM module (DIMM) plugs into the motherboard as the computer's fast main memory

The same memory split matters in a wearable device: its fixed program must remain available after power off, while its live readings change during use.

A heart-rate monitor worn on a runner's wrist
A wrist-worn heart-rate monitor
探索

设备和存储实验室

根据计算示例在系统中的功能进行分类。

词汇 训练
English 中文 拼音
RAM/ræm/ 随机存取存储器 suí jī cún qǔ cún chǔ qì
ROM/rɒm/ 只读存储器 zhī dú cún chǔ qì
volatile/ˈvɒlətaɪl/ 易失性 yì shī xìng
non-volatile/nɒn ˈvɒlətaɪl/ 非易失性 fēi yì shī xìng
3.1

SRAM 与 DRAM

English
  • SRAM 静态RAM (Static RAM) stores each bit in a flip-flop 触发器 of several transistors. Fast, but expensive and not dense. Used for CPU cache 高速缓存.
  • DRAM 动态RAM (Dynamic RAM) stores each bit as charge on a tiny capacitor. Cheaper and denser but slower, and must be refreshed 刷新 (rewritten) thousands of times a second. Used for main memory.
SRAM bit held in a flip-flop of several transistors, fast with no refresh, used for cache; DRAM bit held as charge on a capacitor with one transistor, refreshed thousands of times a second, dense, used for main memory
A flip-flop needs no refresh; a leaking capacitor does.

Use SRAM for small fast memory (cache); DRAM for large main memory.

SRAM DRAM
Each bit stored in a flip-flop of several transistors one capacitor and one transistor
Needs refreshing? no yes, thousands of times a second
Speed faster slower
Density and cost fewer bits per chip, more expensive more bits per chip, cheaper
Power uses less power when idle uses more, because of the refresh
Used for processor cache main memory, including in embedded systems

"Explain why the embedded system uses DRAM": it needs a large amount of memory at low cost in a small space, and its speed requirement is modest, so the cheaper, denser DRAM is the right choice; SRAM is kept for the small cache where speed matters most.

词汇 训练
English 中文 拼音
SRAM/ˈesræm/ 静态 jìng tài
DRAM/ˈdiːræm/ 动态 dòng tài
flip-flop/flɪp flɒp/ 触发器 chù fā qì
cache/kæʃ/ 高速缓存 gāo sù huǎn cún
refreshed/rɪˈfreʃt/ 刷新 shuā xīn
3.1

PROM、EPROM 与 EEPROM

English

ROM variants you can program after manufacture:

  • PROM (Programmable ROM) — written once (fuses burned by a programmer); cannot be changed.
  • EPROM (Erasable Programmable ROM) — erased by strong UV light through a window, then rewritten (whole chip at once).
  • EEPROM (Electrically Erasable Programmable ROM) — erased and rewritten electrically, a byte at a time, in circuit. Flash memory is a derivative optimised for block erase.
A black EPROM chip with a circular quartz window exposing its silicon die
An EPROM chip with a window for ultraviolet erasure
PROM EPROM EEPROM
Written once, by the user with a programmer many times many times
Erased by cannot be erased ultraviolet light through a quartz window an electrical signal
Erases nothing the whole chip at once a byte or block at a time
Must be removed from the circuit to reprogram? not applicable yes no

"Give two differences between EPROM and EEPROM" wants two rows of this table, each stated for both types.

3.1

监测与控制系统

English

Both read sensors; the difference is what they do next.

A loop: a temperature sensor feeds the microprocessor, which signals an actuator to open a window, cooling the greenhouse, which the sensor then measures again
A sensor feeds the microprocessor, which compares the reading with a stored value and signals an actuator; the loop then repeats
  • monitoring 监控 — collects and reports data but takes no action (a weather station logging readings).
  • control system 控制系统 — uses sensor data to decide and act through actuators, usually in a feedback loop (a thermostat turning a boiler on/off).

The three-mark "describe the differences" answer: a monitoring system only measures, records or displays the readings, and at most raises a warning; a control system compares each reading with a preset value 预设值 and, if it is outside the range, sends signals to actuators that change the physical process; the change is then measured again, so a control system contains feedback and a monitoring system does not. Whether a given system is one or the other is decided by that test: a bridge system that measures a vehicle's height and switches on a warning sign is monitoring, because nothing it does changes the vehicle; a system that lowers a barrier is control.

Worked example. Describe how an automated system opens a door when a person is within 2 metres and closes it when nobody is.

An infra-red or ultrasonic sensor measures the distance to anything in front of the door; the analogue reading is converted to digital by an ADC and sent to the processor; the processor compares the distance with the preset 2 metres; if it is less, the processor sends a signal to the actuator (a motor) to open the door; the sensor keeps measuring, and when no reading below 2 metres is received the processor signals the motor to close the door. The repeated measuring after each action is the feedback that stops the door opening and closing at the wrong times.

Flowchart: sensors send signals through an ADC to the processor, which either reports a warning for monitoring or sends signals to actuators in a feedback loop for control
Monitoring reports data; a control system acts through a feedback loop

Sensors and actuators

A sensor 传感器 turns a physical quantity into a signal: temperature (a thermistor 热敏电阻 or thermocouple), pressure (strain gauge), infra-red, sound. Analogue signals need an ADC first. An actuator 执行器 does the reverse — turns a signal into an action (a motor, valve, heater, buzzer).

Small bead thermistors with two wire legs each, on a white background
A thermistor: a temperature sensor whose resistance changes with heat
A small metal stepper motor with a central shaft and coloured wires, on a dark studio background
A small electric motor: an actuator that turns a signal into movement

Feedback

In a control system the actuator changes the environment, which the sensors then re-measure — a feedback 反馈 loop. Without feedback the system cannot correct itself or know when to stop (a thermostat with no temperature feedback would heat forever).

探索

控制反馈回路

点击绕一个恒温器或自动驾驶仪重复的回路。一个控制系统不只是读取世界——它行动,然后重新测量,一次又一次地自我纠正。

词汇 训练
English 中文 拼音
sensor/ˈsensə/ 传感器 chuán gǎn qì
actuator/ˈæktʃuːeɪtə/ 执行器 zhí xíng qì
monitoring/ˈmɒnɪtərɪŋ/ 监控 jiān kòng
control system/kənˈtrəʊl ˈsɪstəm/ 控制系统 kòng zhì xì tǒng
feedback/ˈfiːdbæk/ 反馈 fǎn kuì
preset value/ˈpriːset ˈvæljuː/ 预设值 yù shè zhí
thermistor/ˈθɜːmɪstə/ 热敏电阻 rè mǐn diàn zǔ
3.2

逻辑门与逻辑电路

教学大纲
考生应能: 注释与指导
使用以下逻辑门符号:[非门、与门、或门、与非门、或非门、异或门]
理解并定义以下逻辑门的功能:非门、与门、或门、与非门、或非门和异或门(EOR) 除非门外,其余所有逻辑门均仅有两个输入端。
为上述每个逻辑门构建真值表
构建逻辑电路图 依据:• 问题陈述 • 逻辑表达式 • 真值表
构建真值表 依据:• 问题陈述 • 逻辑电路图 • 逻辑表达式
构建逻辑表达式 依据:• 问题陈述 • 逻辑电路图 • 真值表

来源:Cambridge International 教学大纲

English
The half adder: XOR + AND add two bits

A logic gate 逻辑门 is a small circuit that does one Boolean 布尔 operation. Inputs and outputs are 0 (false, low) or 1 (true, high). Know the symbol, function and truth table 真值表 for each gate.

The circuit symbols for NOT, AND, OR, NAND, NOR and XOR gates in a two-by-three grid
The symbols for the six logic gates

NOT (inverter)

A NOT A
0 1
1 0

AND — output 1 only if all inputs are 1

A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1

OR — output 1 if at least one input is 1

A B A OR B
0 0 0
0 1 1
1 0 1
1 1 1

NAND (NOT AND) — output 0 only when all inputs are 1

A B A NAND B
0 0 1
0 1 1
1 0 1
1 1 0

NOR (NOT OR) — output 1 only when all inputs are 0

A B A NOR B
0 0 1
0 1 0
1 0 0
1 1 0

XOR (Exclusive OR, also called EOR) — output 1 if the inputs are different

A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
探索

逻辑门

切换输入并选择一个逻辑门。每个逻辑门都有自己的规则——它们是构成所有数字电路的基础模块。

词汇 训练
English 中文 拼音
logic gate/ˈlɒdʒɪk ɡeɪt/ 逻辑门 luó jí mén
Boolean/ˈbuːlɪən/ 布尔 bù ěr
truth table/truːθ ˈteɪbl/ 真值表 zhēn zhí biǎo
3.2

逻辑电路

English

A logic circuit 逻辑电路 is a network of gates that carries out a Boolean expression. You should be able to move between a problem statement, a logic expression, a truth table, and a circuit diagram.

The paper writes expressions in words, X = (A AND NOT B) OR (B AND C), and accepts the algebraic form $X = A\overline{B} + BC$ where a dot (or nothing) is AND, a plus is OR, and a bar is NOT. Use whichever the question uses.

From expression to circuit

Draw one gate per operator and wire them up. For $X = (A \text{ AND } B) \text{ OR } (\text{NOT } C)$: a NOT gate on $C$, an AND gate on $A$ and $B$, then an OR gate on the two results.

A logic circuit: an AND gate on inputs A and B, a NOT gate on input C, both feeding an OR gate that gives output X
Gates wired together to carry out a Boolean expression

From circuit to expression

Work forwards from the inputs, labelling each gate's output, until you reach the final output.

A logic circuit for X = (T AND NOT W) OR H: input W passes through a NOT gate; T and NOT W go into an AND gate; the AND output and input H go into an OR gate whose output is X
The greenhouse fan: one NOT, one AND and one OR gate

Worked example. Write the expression for the circuit below, then complete its truth table.

A logic circuit with inputs A, B and C. B passes through a NOT gate; A and NOT B feed an AND gate whose output is labelled P; B and C feed a second AND gate whose output is labelled Q; P and Q feed an OR gate whose output is X
Label every intermediate output: here P is A AND NOT B and Q is B AND C, so X is P OR Q

Label the gate outputs: $P = A \text{ AND NOT } B$, $Q = B \text{ AND } C$, so $X = P \text{ OR } Q = (A \text{ AND NOT } B) \text{ OR } (B \text{ AND } C)$. Then give the truth table a column for each intermediate output, so every row can be checked one gate at a time:

A B C NOT B P Q X
0 0 0 1 0 0 0
0 0 1 1 0 0 0
0 1 0 0 0 0 0
0 1 1 0 0 1 1
1 0 0 1 1 0 1
1 0 1 1 1 0 1
1 1 0 0 0 0 0
1 1 1 0 0 1 1

Drawing a circuit from an expression is the same walk in reverse: start from the innermost brackets, draw one gate per operator, draw a NOT gate on the wire of any input that appears with NOT, keep the inputs on the left and the single output on the right, and label the output with its letter. Every line must end at a gate input or the output; a line that goes nowhere loses the mark.

From circuit to truth table

For $n$ inputs there are $2^{n}$ rows. List every input combination; for each, work out the internal gates then the output.

From truth table to expression (sum of products)

For each row that outputs 1, write an AND of the inputs (with NOT on any input that is 0 in that row); OR these together. Example: a table that is 1 only on $(A=0,B=1)$ and $(A=1,B=0)$ gives $\overline{A}B + A\overline{B}$, which is $A \text{ XOR } B$.

From a problem statement

Turn the English into a Boolean expression first: "A and B" → A AND B; "A or B or both" → A OR B; "exactly one of A and B" → A XOR B; "neither A nor B" → A NOR B; "not both" → A NAND B.

Worked example. A machine's alarm $X$ sounds when the guard is open ($A=1$) and either the motor is running ($B=1$) or the temperature is high ($C=1$). Write the Boolean expression, and give the rows where $X=1$. Turn the English into logic one clause at a time: "either B or C" is $B + C$, and "A and that" is $X = A\cdot(B + C)$. For the rows, $X=1$ needs $A=1$ and at least one of $B$, $C$ equal to 1 - so $(A,B,C) = (1,0,1)$, $(1,1,0)$ and $(1,1,1)$, three rows out of eight. Notice $A=0$ can never sound the alarm, whatever $B$ and $C$ do. Bracket the OR before ANDing it: $X = A\cdot B + C$ is a different circuit altogether, one that would sound the alarm on a high temperature even with the guard closed.

Flash cells and light sensors

In a floating-gate flash cell, an insulated floating gate traps charge without continuous power. A voltage on the control gate is used to program or read the cell; trapped charge changes the voltage threshold at which the transistor conducts, so the read circuit distinguishes stored states. Erasing removes the trapped charge. NAND flash connects cells in strings and is suited to dense block storage; NOR flash allows direct access to individual locations, useful for firmware. Neither requires moving parts.

A light sensor measures light intensity, for example to control a street lamp when daylight falls. Its analogue signal can pass through an ADC before the processor compares it with a threshold. State the measured physical quantity, the conversion if needed, and the resulting control action.

探索

半加器

把 XOR 和 AND 接到相同的两个输入:XOR 给出和位,AND 给出进位。点击 A 和 B。

探索

逻辑电路

门组合成电路

每个门有一个固定的规则;把它们链接起来构建每个电路——从一个门开始。

词汇 训练
English 中文 拼音
logic circuit/ˈlɒdʒɪk ˈsɜːkɪt/ 逻辑电路 luó jí diàn lù
3.2

考官认可的定义

English

A definition question is marked against fixed wording. Learn these exactly, and give one answer only.

Term Definition
embedded system a computer system with a dedicated function built into a larger device
buffer an area of memory that temporarily stores data while it is transferred between devices working at different speeds
RAM volatile memory that can be read from and written to, holding the programs and data in use
ROM non-volatile memory whose contents cannot be changed in normal use, holding the start-up instructions
SRAM static RAM that stores each bit in a flip-flop and needs no refreshing
DRAM dynamic RAM that stores each bit as a charge on a capacitor and must be refreshed continually
monitoring system a system that uses sensors to measure and report on a physical process without changing it
control system a system that uses sensor readings to decide on and carry out actions, through actuators, that change a physical process
sensor a device that measures a physical quantity and converts it into a signal for the computer
actuator a device that converts a signal from the computer into a physical action
feedback the output of a control system being measured and fed back as input so that the system can correct itself
logic gate an electronic circuit that performs a Boolean operation on one or more binary inputs to give one binary output
truth table a table listing every combination of inputs to a logic circuit with the output for each
3.2

考试技巧

English
  • Distinguish RAM (volatile, read/write) from ROM (non-volatile, holds the bootstrap); SRAM (cache, faster) from DRAM (main memory, needs refreshing).
  • For a logic circuit, build the Boolean expression gate by gate, then a truth table covering every input combination.
  • Learn the symbol, expression and truth table for each gate (AND, OR, NOT, NAND, NOR, XOR).
  • Explain a buffer (a temporary store bridging two different speeds) and the role of an interrupt.

Common mistakes

  • Naming the device instead of describing its operation. "It uses a laser" earns nothing; the steps (charge the drum, laser removes charge, toner attracted, transferred, fused) earn the marks.
  • Saying a monitoring system "controls" something. If nothing changes the physical process, it is monitoring; add the actuator and the feedback and it becomes control.
  • Writing that RAM "stores files permanently" or that ROM "stores the user's data". RAM is volatile working memory; ROM holds the fixed start-up instructions.
  • A truth table with fewer than $2^{n}$ rows or a missing input combination. Counting in binary helps ensure no combination is missed.
  • Drawing two lines from one output of a gate to be safe, or leaving a wire that ends nowhere. Draw exactly the connections the expression needs.

该知识点的互动课程

逐步完成,配合即时检查练习。

历年真题

更多 A-Level 计算机科学 知识点

IGCSE, A-Level & AP