# 算术逻辑单元

算术逻辑单元（ALU）是一种组合数字电路，位于CPU或GPU的执行单元内，对二进制数据执行算术运算和按位逻辑运算。该单元接收两个操作数以及一个用于选择所需功能的代码，执行相应运算，并输出结果以及状态标志——这些标志用于指示进位、溢出、结果为零和符号等状况。<sup>[1](https://technav.ieee.org/topic/automatic-logic-units/)</sup> IBM的架构概述将ALU描述为执行所有算术运算和逻辑运算的组件，包括与特定计算机操作相关的数学方程式和基于逻辑的比较。<sup>[2](https://www.ibm.com/think/topics/central-processing-unit-history)</sup>

| 关键事实 | 详情 |
|---|---|
| 功能 | 作为处理器执行单元的一部分，对二进制数据执行算术运算和按位逻辑运算<sup>[1](https://technav.ieee.org/topic/automatic-logic-units/)</sup><sup> • </sup><sup>[3](https://www.computinghistory.org.uk/det/11977/EDSAC-II-Arithmetic-Unit/)</sup> |
| 接口 | 输入为两个操作数和一个功能选择代码；输出为结果及状态标志（进位、溢出、零、符号）<sup>[1](https://technav.ieee.org/topic/automatic-logic-units/)</sup> |
| 设计影响 | 所支持运算的选择、字宽和内部逻辑结构决定了处理器的指令集能力、周期时间和功耗<sup>[1](https://technav.ieee.org/topic/automatic-logic-units/)</sup> |
| 里程碑部件 | 德州仪器74181，在1978年DEC的一份历史文献中被称为最早、最著名的单芯片ALU，可对两个4位变量提供多达32种功能<sup>[4](https://archive.computerhistory.org/resources/text/DEC/dec.bell_mudge_mcnamara.computer_engineering_a_dec_view.1978.102630383.pdf)</sup> |
| 速度示例 | 8位AVR的ALU可在单个时钟周期内完成通用寄存器之间的算术运算<sup>[5](https://developerhelp.microchip.com/xwiki/bin/view/products/mcu-mpu/8-bit-avr/structure/alu/)</sup> |
| 现代扩展 | Arm Cortex-A76核心在一个四发射整数块中包含三个简单ALU和一个多周期整数单元<sup>[6](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/cortex-a76-laptop-class-performance-with-mobile-efficiency)</sup> |

## 操作与接口

ALU位于中央处理单元的执行单元之内，是所有CPU的核心组件。<sup>[3](https://www.computinghistory.org.uk/det/11977/EDSAC-II-Arithmetic-Unit/)</sup> 其输入是要操作的数据（操作数），以及指示执行何种运算的控制输入；其输出是结果。<sup>[1](https://technav.ieee.org/topic/automatic-logic-units/)</sup> 在简单设计中，所有请求的运算由各自的算术电路并行计算，再由多路复用器选出所需结果。这种做法易于构建且速度快，但会浪费电能，可以通过冻结当前运算不需要的电路的输入来降低功耗。<sup>[7](https://courses.grainger.illinois.edu/cs102/sp2026/text/architecture.html)</sup>

**状态标志。** 算术或逻辑运算之后，状态寄存器会更新以反映有关结果的信息。在8位AVR微控制器上，状态寄存器（SREG）在所有ALU操作之后更新。<sup>[8](https://developerhelp.microchip.com/xwiki/bin/view/products/mcu-mpu/8-bit-avr/structure/status/)</sup> 这些标志记录进位、溢出、结果为零和符号等状况，后续指令——尤其是条件分支——可以对其进行测试。<sup>[1](https://technav.ieee.org/topic/automatic-logic-units/)</sup> 王氏2280磁盘处理单元的一份维护手册在系统层面说明了这一做法：其状态寄存器包含一个进位位，指示前一次ALU算术运算产生了进位；还有一个A=B位，指示ALU的A总线上的数据等于B总线上的数据。<sup>[9](https://bitsavers.computerhistory.org/pdf/wang/peripherals/discs/742-0971_2280_Disk_Processing_Unit_Maintenance_19841220.pdf)</sup>

**运算类别。** 微控制器文档将ALU运算分为三大类：算术、逻辑和位功能。<sup>[5](https://developerhelp.microchip.com/xwiki/bin/view/products/mcu-mpu/8-bit-avr/structure/alu/)</sup> 加、减、乘、除等算术运算提供大多数软件——从电子表格到科学仿真——所需的数值计算。<sup>[1](https://technav.ieee.org/topic/automatic-logic-units/)</sup>

## 时序与多周期操作

某些运算（如除法）的机制得出结果所需的时间远长于其他运算（如加法）。由于处理器由单一时钟控制，若不采取其他措施，该时钟就必须慢到足以容纳最慢的运算。一种常见的解决方案是让某些电路占用多个时钟周期：除法器可能每周期计算若干位，完成一次完整除法约需15个周期，并在答案就绪时发出信号；随后ALU要么将结果送出，要么等待，在送出之前拒绝接收新输入。<sup>[7](https://courses.grainger.illinois.edu/cs102/sp2026/text/architecture.html)</sup> 高性能设计更进一步，采用多部件ALU以乱序和并行方式执行运算：指令被放入附属于功能单元的队列中——功能单元是各自计算一类运算的电路——每个单元处理依赖关系已满足的指令。<sup>[7](https://courses.grainger.illinois.edu/cs102/sp2026/text/architecture.html)</sup>

## 内部设计：进位链

ALU加法器内部的主要速度限制是进位链，设计者要在延迟与面积、功耗之间权衡选择不同架构。一项对采用Synopsys 32/28纳米CMOS工艺（1.05伏供电、25摄氏度、典型情况PVT）实现的同步32位加法器的比较发现：混合递归超前进位/行波进位加法器在速度、功耗延迟积和能量延迟积方面优于其他方案；非均匀输入分区进位选择加法器在面积延迟积方面更优；而由标准单元全加器构成的普通行波进位加法器在功耗延迟面积积方面更优。<sup>[10](https://arxiv.org/abs/1810.01115)</sup> 大体而言，行波进位加法器便宜但慢，超前进位在成本和速度上均适中，进位选择则昂贵而快；随着超前进位逻辑复杂度增加，其相对行波进位的速度优势可能减弱。<sup>[10](https://arxiv.org/abs/1810.01115)</sup>

74181将这一选择体现在硬件中。其数据手册指出，'LS181和'S181是ALU/函数发生器，在单片芯片上具有75个等效门的复杂度，对两个4位字执行16种二进制算术运算，由四条功能选择线选择，包括加法、减法、减量和直通传输。<sup>[11](https://www.ti.com/product/SN54S181)</sup> 进行算术运算时，必须通过模式控制输入使能内部进位；通过两个级联输出可提供完整的超前进位方案，当这些器件与SN54S182或SN74S182全超前进位电路配合使用时，可执行高速算术运算。如果高速不重要，则可改用行波进位输入和输出。<sup>[11](https://www.ti.com/product/SN54S181)</sup>

## 历史

早期机器的算术硬件是房间大小的电路集合。旋风（Whirlwind）计算机的算术单元占据了麻省理工学院巴塔大楼的一整个房间。<sup>[12](https://tcm.computerhistory.org/reports/TCMReportWinter1984-1985.pdf)</sup> 一台来自EDSAC II的算术单元机箱保存在计算历史中心（Centre for Computing History）的收藏中，该中心将ALU描述为执行单元的一部分、所有CPU的核心组件。<sup>[3](https://www.computinghistory.org.uk/det/11977/EDSAC-II-Arithmetic-Unit/)</sup>

**74181。** 随着集成电路密度接近100门，在单芯片上构建完整算术单元成为可能。1978年数字设备公司（Digital Equipment Corporation）的一份工程史称74181是最早、最著名的此类功能部件，可对两个4位变量提供多达32种功能。<sup>[4](https://archive.computerhistory.org/resources/text/DEC/dec.bell_mudge_mcnamara.computer_engineering_a_dec_view.1978.102630383.pdf)</sup> 该部件推广到了当时的系统设计中：例如王氏2280磁盘处理单元用两片74181集成电路在微码控制下构建其ALU，具有A总线和B总线数据输入以及C总线输出。<sup>[9](https://bitsavers.computerhistory.org/pdf/wang/peripherals/discs/742-0971_2280_Disk_Processing_Unit_Maintenance_19841220.pdf)</sup>

**集成到微处理器中。** 到1989年，英特尔的i860 RISC/协处理器芯片包含一个32位整数ALU——即CPU中执行加减等运算的部分——以及一个64位浮点单元，时钟频率为33 MHz，芯片晶体管数超过100万。<sup>[13](https://www.computerhistory.org/timeline/computers/?pStoreID=contenttest)</sup>

## 现代处理器中的ALU

现代高性能核心通过复制ALU来提高整数吞吐量。Arm Cortex-A76集成了四发射整数单元，其中包括三个简单ALU和一个多周期整数单元。<sup>[6](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/cortex-a76-laptop-class-performance-with-mobile-efficiency)</sup> 面向服务器的Neoverse V1又增加了一个ALU，共四个单元，并增加了第二个分支执行单元；Arm将整数性能提升25%归因于这些特性在15宽超标量设计中的共同作用。<sup>[14](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/neoverse-v1-platform-a-new-performance-tier-for-arm)</sup> 在英特尔核心上，性能分析工具统计微操作被派发到服务于ALU、分支和加载-存储工作的执行端口的频率，因此ALU端口压力是指令吞吐量的一项可测量限制。<sup>[15](https://www.intel.com/content/www/us/en/docs/vtune-profiler/user-guide/2026-1/cpu-metrics-reference.html)</sup>

GPU以不同的组织方式实现同一理念。执行单元是英特尔GPU架构的基础构建模块，驱动多发射的单指令多数据算术逻辑单元（SIMD ALU），这些单元跨线程流水线化，适用于高吞吐量的浮点和整数计算；Gen9 GT2 GPU有一个包含24个此类执行单元的切片。<sup>[16](https://www.intel.com/content/www/us/en/docs/vtune-profiler/cookbook/2023-1/software-optimization-for-intel-gpus.html)</sup>

## References

1. [Automatic logic units, IEEE Technology Navigator](https://technav.ieee.org/topic/automatic-logic-units/)
2. [The History of Central Processing Unit (CPU), IBM Think](https://www.ibm.com/think/topics/central-processing-unit-history)
3. [EDSAC II Arithmetic Unit, Centre for Computing History](https://www.computinghistory.org.uk/det/11977/EDSAC-II-Arithmetic-Unit/)
4. [Bell, Mudge, McNamara, Computer Engineering: A DEC View of Hardware Systems Design (1978), Computer History Museum archive](https://archive.computerhistory.org/resources/text/DEC/dec.bell_mudge_mcnamara.computer_engineering_a_dec_view.1978.102630383.pdf)
5. [8-Bit AVR Arithmetic Logic Unit, Microchip Developer Help](https://developerhelp.microchip.com/xwiki/bin/view/products/mcu-mpu/8-bit-avr/structure/alu/)
6. [Cortex-A76: Laptop-class performance with mobile efficiency, Arm Community](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/cortex-a76-laptop-class-performance-with-mobile-efficiency)
7. [Computer components and architecture, CS 102, University of Illinois Grainger College of Engineering](https://courses.grainger.illinois.edu/cs102/sp2026/text/architecture.html)
8. [AVR Status Register, Microchip Developer Help](https://developerhelp.microchip.com/xwiki/bin/view/products/mcu-mpu/8-bit-avr/structure/status/)
9. [Wang 2280 Disk Processing Unit Maintenance Manual (1984), bitsavers archive](https://bitsavers.computerhistory.org/pdf/wang/peripherals/discs/742-0971_2280_Disk_Processing_Unit_Maintenance_19841220.pdf)
10. [Performance Comparison of some Synchronous Adders, arXiv:1810.01115](https://arxiv.org/abs/1810.01115)
11. [SN54S181 Arithmetic Logic Units/Function Generators, Texas Instruments](https://www.ti.com/product/SN54S181)
12. [whirlwind entrance](https://tcm.computerhistory.org/reports/TCMReportWinter1984-1985.pdf)
13. [Timeline of Computer History, Computer History Museum](https://www.computerhistory.org/timeline/computers/?pStoreID=contenttest)
14. [Neoverse V1 platform: a new performance tier for Arm, Arm Community](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/neoverse-v1-platform-a-new-performance-tier-for-arm)
15. [CPU Metrics Reference and Software Optimization for Intel GPUs, Intel VTune Profiler documentation](https://www.intel.com/content/www/us/en/docs/vtune-profiler/user-guide/2026-1/cpu-metrics-reference.html)
16. [software optimization for intel® gpus (new)](https://www.intel.com/content/www/us/en/docs/vtune-profiler/cookbook/2023-1/software-optimization-for-intel-gpus.html)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Arithmetic and number systems › Computational arithmetic › Hardware arithmetic units

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/arithmetic-logic-unit

English original: https://www.edgepedia.org/arithmetic-logic-unit
