Skip to content

Hardware

A-Level Computer Science · Topic 3

Train
3.1

Computers and their components

Syllabus
Candidates should be able to: Notes and guidance
Show understanding of the need for input, output, primary memory and secondary (including removable) storage
Show understanding of embedded systems Including: benefits and drawbacks of embedded systems
Describe the principal operations of hardware devices Including: Laser printer, 3D printer, microphone, speakers, magnetic hard disk, solid state (flash) memory, optical disc reader/writer, touchscreen, virtual reality headset
Show understanding of the use of buffers
Explain the differences between Random Access Memory (RAM) and Read Only Memory (ROM) Including their use in a range of devices and systems
Explain the differences between Static RAM (SRAM) and Dynamic RAM (DRAM) Including the use of SRAM and DRAM in a range of devices and systems and the reasons for using one instead of the other depending on the device and its use
Explain the difference between Programmable ROM (PROM), Erasable Programmable ROM (EPROM) and Electrically Erasable Programmable ROM (EEPROM)
Show an understanding of monitoring and control systems Including: • difference between monitoring and control • use of sensors (including temperature, pressure, infra-red, sound) and actuators • importance of feedback

Source: Cambridge International syllabus

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 primary memory is volatile and small: 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
Explore

Tap the blocks of a computer system

Explore the four blocks plus the CPU. Data flows input → processing → output, while primary memory holds the running program and secondary storage keeps it for later.

Explore

Network route lab

Follow data from a device through network hardware and protocols.

Vocabulary Train
English Chinese Pinyin
input devices 输入设备 shū rù shè bèi
output devices 输出设备 shū chū shè bèi
primary memory 主存储器 zhǔ cún chǔ qì
processor 处理器 chǔ lǐ qì
secondary storage 辅助存储器 fǔ zhù cún chǔ qì
Exercise sheet
3.1

Embedded systems

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".

Vocabulary Train
English Chinese Pinyin
embedded system 嵌入式系统 qiàn rù shì xì tǒng
firmware 固件 gù jiàn
3.1

Principal hardware devices

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 a glass layer coated with a transparent conductor that holds a charge; a finger touching it draws a tiny current, the current is measured at each corner, and the controller works out the touch position from the differences. Capacitive screens respond to a light touch and to several fingers at once, but not 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.

Vocabulary Train
English Chinese Pinyin
laser printer 激光打印机 jī guāng dǎ yìn jī
drum 感光鼓 gǎn guāng gǔ
Toner 墨粉 mò fěn
fuser 定影器 dìng yǐng qì
filament 塑料丝 sù liào sī
microphone 麦克风 mài kè fēng
capacitor 电容器 diàn róng qì
analogue-to-digital converter 模数转换器 mó shù zhuǎn huàn qì
diaphragm 膜片 mó piàn
digital-to-analogue converter 数模转换器 shù mó zhuǎn huàn qì
hard disk 硬盘 yìng pán
tracks 磁道 cí dào
sectors 扇区 shàn qū
read/write head 读写头 dú xiě tóu
actuator arms 磁头臂 cí tóu bì
solid-state drive 固态硬盘 gù tài yìng pán
transistors 晶体管 jīng tǐ guǎn
floating-gate transistor 浮栅晶体管 fú zhà jīng tǐ guǎn
optical disc 光盘 guāng pán
pits 凹坑 āo kēng
lands 平台 píng tái
touchscreen 触摸屏 chù mō píng
Resistive 电阻式 diàn zǔ shì
Capacitive 电容式 diàn róng shì
virtual reality 虚拟现实 xū nǐ xiàn shí
accelerometer 加速度计 jiā sù dù jì
gyroscope 陀螺仪 tuó luó yí
3D printer 3D打印机 3D dǎ yìn jī
3.1

Buffers

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.

Vocabulary Train
English Chinese Pinyin
buffer 缓冲 huǎn chōng
interrupt 中断 zhōng duàn
3.1

RAM and ROM

  • 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
Explore

Device and storage lab

Classify computing examples by what job they do in a system.

Vocabulary Train
English Chinese Pinyin
RAM 随机存取存储器 suí jī cún qǔ cún chǔ qì
volatile 易失性 yì shī xìng
ROM 只读存储器 zhī dú cún chǔ qì
non-volatile 非易失性 fēi yì shī xìng
3.1

SRAM vs DRAM

  • 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.

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.

Vocabulary Train
English Chinese Pinyin
SRAM 静态 jìng tài
flip-flop 触发器 chù fā qì
cache 高速缓存 gāo sù huǎn cún
DRAM 动态 dòng tài
refreshed 刷新 shuā xīn
3.1

PROM, EPROM and EEPROM

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.
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

Monitoring and control systems

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

  • 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).

Explore

The control feedback loop

Tap round the loop a thermostat or autopilot repeats. A control system doesn't just read the world — it acts, then re-measures, correcting itself again and again.

Vocabulary Train
English Chinese Pinyin
monitoring 监控 jiān kòng
control system 控制系统 kòng zhì xì tǒng
preset value 预设值 yù shè zhí
sensor 传感器 chuán gǎn qì
thermistor 热敏电阻 rè mǐn diàn zǔ
actuator 执行器 zhí xíng qì
feedback 反馈 fǎn kuì
3.2

Logic gates

Syllabus
Candidates should be able to: Notes and guidance
Use the following logic gate symbols: [NOT, AND, OR, NAND, NOR, XOR]
Understand and define the functions of: NOT, AND, OR, NAND, NOR and XOR (EOR) gates All gates except the NOT gate will have two inputs only.
Construct the truth table for each of the logic gates above
Construct a logic circuit From: • a problem statement • a logic expression • a truth table
Construct a truth table From: • a problem statement • a logic circuit • a logic expression
Construct a logic expression From: • a problem statement • a logic circuit • a truth table

Source: Cambridge International syllabus

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
Explore

Logic gates

Switch the inputs and pick a gate. Each gate has its own rule — the building blocks of every digital circuit.

Vocabulary Train
English Chinese Pinyin
logic gate 逻辑门 luó jí mén
Boolean 布尔 bù ěr
truth table 真值表 zhēn zhí biǎo
Exercise sheet
3.2

Logic circuits

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.

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.

Explore

Half adder

Wire XOR and AND to the same two inputs: XOR gives the sum bit, AND gives the carry. Click A and B.

Explore

Logic circuits

gates combine into circuits

Each gate has a fixed rule; chaining them builds every circuit — start with one gate.

Vocabulary Train
English Chinese Pinyin
logic circuit 逻辑电路 luó jí diàn lù
3.2

Definitions the examiner accepts

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

Exam tips

  • 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 rows in a random order. Count in binary from 000 to 111 so 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.

Interactive lessons on this topic

Work through it step by step, with instant-check exercises.

A-Level Computer Science Past Papers

More topics in A-Level Computer Science

Log in or create account

IGCSE, A-Level & AP