📚 Electricity in Computing | 计算中的电学基础
In modern computers, everything from the tiniest transistor to the largest data centre relies on the controlled flow of electricity. Understanding how electrical signals represent binary data and drive logic circuits is fundamental to studying computer science at IGCSE level. This article explores how electricity is harnessed to perform computation, store information, and power the digital world.
在现代计算机中,从微小的晶体管到庞大的数据中心,一切都依赖于对电流的控制。理解电信号如何表示二进制数据并驱动逻辑电路,是IGCSE计算机科学学习的基础。本文将探讨如何利用电能进行计算、存储信息并驱动数字世界。
1. Why Electricity Matters for Computers | 电力为何对计算机至关重要
At the heart of every computer lies a complex network of electronic components that use electricity to represent and process information. Without a stable flow of electric current, CPUs cannot execute instructions, memory cannot retain data, and input/output devices cannot function. The binary system, which uses only 0s and 1s, is physically implemented by two distinct electrical states: a high voltage for logic 1 and a low voltage for logic 0.
每台计算机的核心都是一个复杂的电子元件网络,利用电能来表示和处理信息。没有稳定的电流流动,CPU无法执行指令,存储器无法保留数据,输入/输出设备也无法工作。二进制系统仅使用0和1,物理上通过两种不同的电状态来实现:高电压表示逻辑1,低电压表示逻辑0。
2. Bits and Voltage Levels | 比特与电平
In digital electronics, a bit is the smallest unit of information. It is commonly represented by voltage levels within a circuit. For example, in TTL (transistor-transistor logic) circuits, a voltage between 2.0 and 5.0 volts is accepted as a logical 'high' (1), while a voltage between 0 and 0.8 volts is a logical 'low' (0). Other families, such as CMOS, may use different thresholds. The key is that the system distinguishes clearly between the two states, providing noise immunity.
在数字电子学中,比特是最小的信息单位,通常通过电路中的电平来表示。例如,在 TTL(晶体管-晶体管逻辑)电路中,2.0 至 5.0 伏的电压视为逻辑“高”(1),而 0 至 0.8 伏则是逻辑“低”(0)。其他的逻辑系列如 CMOS 可能使用不同的阈值。关键在于系统能够清晰区分这两种状态,从而提供抗噪声能力。
| Logic Family | Logic 1 (High) | Logic 0 (Low) |
|---|---|---|
| TTL | 2.0V - 5.0V | 0V - 0.8V |
| CMOS (5V) | 3.5V - 5.0V | 0V - 1.5V |
The table above shows typical input voltage ranges that guarantee a clean distinction between 0 and 1. The gaps between the thresholds provide a safety margin against electrical noise.
上表显示了确保 0 和 1 清晰区分的典型输入电压范围。阈值之间的间隙为抵抗电噪声提供了安全裕度。
3. Transistors as Switches | 充当开关的晶体管
The fundamental building block of digital circuits is the transistor, which acts as an electrically controlled switch. When a small voltage is applied to the gate (in a MOSFET), it allows current to flow between the source and drain, turning the switch 'on'. When the gate voltage is removed or low, the switch turns 'off'. By combining millions of transistors, we can create logic gates that perform Boolean operations.
数字电路的基本构件是晶体管,它就像一个电控开关。当向栅极(MOSFET 中)施加一个小电压时,允许电流在源极和漏极之间流动,使开关“导通”;当栅极电压移除或为低时,开关“截止”。通过组合数百万个晶体管,可以构建执行布尔运算的逻辑门。
4. Logic Gates and Transistor Circuits | 逻辑门与晶体管电路
Logic gates such as AND, OR, and NOT are implemented using specific transistor arrangements. A NOT gate (inverter) can be built with just one transistor and a resistor: a high input turns the transistor on, pulling the output low; a low input turns it off, and the output is pulled high through a resistor. This inverts the electrical signal.
与门、或门和非门等逻辑门是通过特定的晶体管排布实现的。一个非门(反相器)只需一个晶体管和一个电阻即可构成:高电平输入使晶体管导通,将输出拉低;低电平输入使晶体管截止,输出通过电阻拉高。这样就实现了电信号的反转。
5. The NOT Gate as a Voltage Inverter | 非门作为电压反相器
The simplest gate, the NOT gate, gives an output voltage that is the opposite of the input. If we define 5V as logic 1 and 0V as logic 0, the NOT gate outputs 0V when given 5V and vice versa. This is the electrical equivalent of the Boolean NOT operation. In circuit diagrams, it is symbolised by a triangle with a small circle.
最简单的门——非门,输出的电压与输入相反。如果将 5V 定义为逻辑1,0V 定义为逻辑0,当输入 5V 时,非门输出 0V,反之亦然。这就是布尔非运算在电气层面的等价实现。在电路图中,它用一个带小圆圈的三角形表示。
6. AND and OR Gates from Switches | 与门和或门的开关实现
An AND gate can be visualised as two switches connected in series. Both switches must be 'on' (closed) for current to flow, corresponding to both inputs being high for the output to be high. An OR gate is represented by two switches in parallel; if either switch is closed, current flows, making the output high. Transistor-based designs use this principle with multiple transistors.
与门可视为两个串联的开关。两个开关都必须“闭合”才能有电流通过,这与两个输入均为高电平时输出高电平相对应。或门则用两个并联的开关表示;只要其中一个开关闭合,电流就能流通,使输出为高。基于晶体管的设计正是利用这一原理,采用多个晶体管。
7. Boolean Algebra and Electrical States | 布尔代数与电学状态
Q = A AND B becomes an electrical circuit where Q is high only when both A and B are high.
布尔代数为数字电路提供了数学基础。与门、或门和非门的真值表直接对应各种电压组合。例如,布尔表达式 Q = A AND B 转换为电路时,仅当 A 和 B 均为高电平时 Q 才为高。
Q = A · B
Engineers use Boolean logic to simplify circuits and minimise the number of transistors, thus reducing power consumption and heat generation.
工程师利用布尔逻辑简化电路,尽量减少晶体管数量,从而降低功耗和发热量。
8. The System Clock: Electrical Pulses | 系统时钟:电脉冲
A computer's operations are synchronised by a system clock that generates a continuous stream of electrical pulses, typically a square wave oscillating between high and low voltage. Each pulse marks a clock cycle during which the CPU can perform part of an instruction. The clock speed, measured in hertz (Hz), indicates how many pulses occur per second, directly affecting performance.
计算机的操作由系统时钟同步,时钟会生成连续的电脉冲流,通常是在高低电平之间振荡的方波。每个脉冲代表一个时钟周期,CPU在此期间可执行指令的某一部分。时钟速度以赫兹 (Hz) 为单位,表示每秒产生多少个脉冲,直接影响性能。
9. Power Supply and Regulation | 电源与稳压
Computers require a stable direct current (DC) supply to function correctly. The power supply unit (PSU) converts alternating current (AC) from the mains into precise DC voltages such as +3.3V, +5V, and +12V. Voltage regulators on the motherboard further refine these supplies to meet the tight tolerances needed by processors and memory. Fluctuations can cause errors or damage components.
计算机需要稳定的直流电源才能正常工作。电源单元(PSU)将市电交流电(AC)转换为精确的直流电压,如 +3.3V、+5V 和 +12V。主板上的电压调节器进一步精炼这些供电,以满足处理器和存储器所需的严格公差。电压波动可能导致错误或损坏元件。
10. Heat Dissipation and Cooling | 散热与冷却
Electric current flowing through transistors and wires generates heat due to resistance. As the number of transistors in a processor increases, so does the heat output. Efficient cooling solutions – heat sinks, fans, and in high-performance systems, liquid cooling – are essential to prevent overheating, maintain performance, and prolong the lifespan of components.
电流流经晶体管和导线时,由于电阻的存在会产生热量。随着处理器中晶体管数量的增加,发热量也随之上升。高效的散热方案——散热片、风扇以及高性能系统中的液冷——对于防止过热、保持性能并延长元件寿命至关重要。
11. Electricity in Memory Cells | 存储器单元中的电学
Computer memory uses various electrical principles to store bits. In SRAM (Static RAM), a flip-flop circuit made of several transistors holds the state as long as power is supplied. DRAM (Dynamic RAM) stores each bit as a tiny electric charge in a capacitor, which must be refreshed thousands of times per second to prevent leakage. Non-volatile flash memory uses floating-gate transistors to trap charge without power.
计算机存储器利用多种电学原理来存储比特。在 SRAM(静态 RAM)中,由多个晶体管构成的触发器电路只要有电源就能保持状态。DRAM(动态 RAM)将每个比特存储为电容器中的微小电荷,需要每秒刷新数千次以防止漏电。非易失性闪存则使用浮栅晶体管,可在没有供电时捕获电荷。
12. Practical Safety in Computing | 计算中的电气安全
When working with computer hardware, electrical safety is paramount. Static electricity can discharge through sensitive components, causing permanent damage. Technicians use anti-static wrist straps and mats. Additionally, when building or repairing a PC, always ensure that the power supply is disconnected and capacitors are discharged to avoid electric shock.
在处理计算机硬件时,电气安全至关重要。静电可能通过敏感元件放电,造成永久性损坏。技术人员会使用防静电腕带和垫子。此外,在组装或维修PC时,务必确保电源已断开且电容器已放电,以避免触电。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图