# 字（计算机体系结构）

在计算机体系结构中，**字**是存储的基本单位，即处理器一次能够处理的数据量；字长是体系结构本身的特性，而非任何特定实现的特性<sup>[1](https://www.ibm.com/docs/en/ent-metalc-zos/3.1?topic=reference-glossary)</sup>。字是机器整数寄存器、运算单元以及典型内存传输的自然宽度，这一术语还锚定了一系列相关尺寸，如半字、双字和四字<sup>[1](https://www.ibm.com/docs/en/ent-metalc-zos/3.1?topic=reference-glossary)</sup>。

| 关键事实 | 详情 |
|---|---|
| 定义 | 字是存储的基本单位，即一次处理的数据量；字长是计算机体系结构的特性<sup>[1](https://www.ibm.com/docs/en/ent-metalc-zos/3.1?topic=reference-glossary)</sup> |
| x86 家族 | 字为 2 字节（16 位）；双字为 4 字节（32 位），四字为 8 字节（64 位），双四字为 16 字节（128 位）<sup>[2](https://www.intel.com/content/dam/develop/external/us/en/documents-tps/253665-sdm-vol-11.pdf)</sup> |
| RISC-V | 内存中的字定义为 32 位（4 字节）；一个硬件线程（hart）拥有 \(2^{\mathrm{XLEN}}\) 字节的字节可寻址地址空间，其中字节为 8 位<sup>[3](https://riscv.github.io/riscv-isa-manual/snapshot/spec/index.html)</sup> |
| 尺寸惯例 | 常用尺寸是地址解析单位的 2 的幂倍数，因此大多数现代字长是字节的 2 的幂倍数<sup>[4](https://ucan.us/doyetech/word.htm)</sup> |
| 历史范围 | 字长曾包括 12、16、32 和 36 位；IBM 的 System/360 于 1964 年确立了 8 位字节的事实上的全球标准<sup>[5](https://www.computerhistory.org/internethistory/1960s/)</sup> |
| 对齐代价 | 在 IA-32 上，跨越 4 字节边界的未对齐字或双字操作数需要两个独立的内存总线周期，而对齐访问只需一个<sup>[2](https://www.intel.com/content/dam/develop/external/us/en/documents-tps/253665-sdm-vol-11.pdf)</sup> |

## 字在设计中所固定的内容

处理器的字长决定了它在一次操作中所操作的数据宽度。IBM 的文档将字描述为一次能够处理的数据量，并将字长视为一种体系结构属性，与处理器 32 位或 64 位数据字宽度等属性并列<sup>[1](https://www.ibm.com/docs/en/ent-metalc-zos/3.1?topic=reference-glossary)</sup>。一个体系结构的内存模型深受字长影响，因为字设定了寄存器与内存之间数据移动的自然粒度<sup>[4](https://ucan.us/doyetech/word.htm)</sup>。

字也是其他尺寸命名的基准。在 x86 家族中，阶梯依次为字节（8 位）、字（16 位）、双字（32 位）、四字（64 位）、十字节（80 位，用于扩展浮点）和八字节（128 位）<sup>[6](https://learn.microsoft.com/zh-cn/windows-hardware/drivers/debugger/x86-architecture)</sup>。Intel 64 和 IA-32 手册以字节给出了相同的尺寸：字为 2 字节，双字为 4 字节，四字为 8 字节，双四字为 16 字节<sup>[2](https://www.intel.com/content/dam/develop/external/us/en/documents-tps/253665-sdm-vol-11.pdf)</sup>。四字数据类型随 Intel486 处理器引入 IA-32，双四字则随 [Pentium III](https://www.edgepedia.org/zh/pentium-iii) 和 SSE 扩展引入<sup>[2](https://www.intel.com/content/dam/develop/external/us/en/documents-tps/253665-sdm-vol-11.pdf)</sup>。

## 字长与内存寻址

内存通常以小于字的单位寻址。如果一个内存有 n 个可寻址位置，组织为 w 位的字，则其数据宽度等于 w 位，而地址宽度为 \( \lceil \log_2 n \rceil \) 位<sup>[7](https://www.uvm.edu/~cbcafier/cs2210/content/07_memory_hierarchy/memory_interface.html)</sup>。RISC-V 为一个硬件线程的所有内存访问指定了单一的 \( 2^{\mathrm{XLEN}} \) 字节的字节可寻址地址空间，其中字节为 8 位，并单独将内存中的字定义为 32 位<sup>[3](https://riscv.github.io/riscv-isa-manual/snapshot/spec/index.html)</sup>。这里的 XLEN 即整数寄存器的宽度，是对应于机器字长的量：RV64I 将整数寄存器和支持的用户地址空间扩展到 64 位，XLEN = 64<sup>[8](https://docs.riscv.org/reference/isa/v20240411/_attachments/riscv-unprivileged.pdf)</sup>。

由于字节是单独寻址的，一个多字节字占据多个连续地址。地址解码必须处理对齐，确保多字节字起始于字长整除的地址<sup>[7](https://www.uvm.edu/~cbcafier/cs2210/content/07_memory_hierarchy/memory_interface.html)</sup>。在字节可寻址内存中，一个 32 位字跨越 4 个字节，因此字地址以 4 为步长递增<sup>[9](https://classes.engineering.wustl.edu/cse3602/content/CSE3602-4.ISA-2-full.pdf)</sup>。

**对齐与性能。** 各体系结构在执行这一点的严格程度上有所不同。IA-32 不要求字、双字或四字位于自然边界上，自然边界分别是偶数地址、四的倍数地址和八的倍数地址；但跨越相关边界的操作数需要两个内存总线周期而非一个，因此对齐数据结构，尤其是栈，能提升性能<sup>[2](https://www.intel.com/content/dam/develop/external/us/en/documents-tps/253665-sdm-vol-11.pdf)</sup>。某些操作双四字的指令确实要求 16 字节对齐，并对未对齐操作数引发通用保护异常<sup>[2](https://www.intel.com/content/dam/develop/external/us/en/documents-tps/253665-sdm-vol-11.pdf)</sup>。

## 各体系结构中的字长

同一术语在不同机器上指称不同宽度，这是在指令集之间迁移时反复出现的混淆来源。

**x86。** x86 体系结构源自 16 位设计，因此尽管该体系结构现在有 32 位和 64 位模式，其字仍为 16 位；更大的尺寸带有复合名称，即双字和四字<sup>[6](https://learn.microsoft.com/zh-cn/windows-hardware/drivers/debugger/x86-architecture)</sup>。在 64 位模式下，通用寄存器为 64 位宽，而兼容模式保留 32 位寄存器和 4 GB 地址空间<sup>[10](https://www.intel.com/content/www/us/en/support/articles/000005898/processors.html)</sup>。

**RISC-V。** RISC-V 将字定义为 32 位，与其 RV32 基本整数 ISA 相匹配，并用“双字”一词指称 64 位单位<sup>[3](https://riscv.github.io/riscv-isa-manual/snapshot/spec/index.html)</sup>。即使在 RV64I 中，对 32 位量的运算仍可通过带有 W 后缀的指令进行：此类带 W 后缀的操作忽略其操作数最高有效的 32 位，产生有符号 32 位结果，并通过符号扩展将这些结果拓宽到 64 位，使第 XLEN-1 位至第 31 位保持相同。<sup>[8](https://docs.riscv.org/reference/isa/v20240411/_attachments/riscv-unprivileged.pdf)</sup> 编译器和调用约定维护一个不变式，即所有 32 位值在 64 位寄存器中以符号扩展形式保存，这使得有符号与无符号 32 位整数之间的转换成为空操作<sup>[8](https://docs.riscv.org/reference/isa/v20240411/_attachments/riscv-unprivileged.pdf)</sup>。

**36 位机器。** 字长跟随应用需求，而不仅仅是字节数。[数字设备公司](https://www.edgepedia.org/zh/digital-equipment-corporation)（Digital Equipment Corporation）的设计者为 PDP-6 选择了 36 位字，因为他们想直接寻址大容量内存，也因为麻省理工学院（MIT）青睐编程语言 LISP，其结构要求每个字有两个指针；当时在 DEC 任工程师的艾伦·科托克（Alan Kotok）回忆说，正因如此，36 位体系结构似乎是可行之道<sup>[11](https://archive.computerhistory.org/resources/text/DEC/dec.digital_at_work.1992.102630350.pdf)</sup>。IBM 更早的科学计算产品线使用了相同宽度：7094 II 提供最大 32K 个 36 位字的存储，其中 K 代表 1024<sup>[12](https://bitsavers.computerhistory.org/pdf/ibm/IBM_Journal_of_Research_and_Development/255/ibmrd2505D.pdf)</sup>。

**可变长度机器。** 并非所有体系结构都有固定字长。IBM 1401 是一台字符寻址的十进制机器，存储可变长度文本串，并使用字标记位来标记指令的第一个字符或可变长度数据串的最后一个高位字符，因此指令和数据长度由内存中的标记决定，而非由固定字长决定<sup>[13](https://ibm1401.computerhistory.org/1401GuidePosterV9.html)</sup>。

## 8 位字节如何标准化字长

字长曾经可以自由选择。机器使用 12 位和 36 位字，同时使用 6 位和 7 位字符编码，内存以字或字符而非字节计量<sup>[12](https://bitsavers.computerhistory.org/pdf/ibm/IBM_Journal_of_Research_and_Development/255/ibmrd2505D.pdf)</sup>。IBM 的 System/360 于 1964 年宣布，是由 50 亿美元投资支持的六种相互兼容计算机组成的家族，它进入市场并确立了 8 位字节的事实上的全球标准，帮助确立了这一标准，尽管此后仍有 12 位和 36 位字机器出现，例如 DEC 于 1964 年 10 月推出的 PDP-6；两年内，System/360 的订单达到每月 1,000 台<sup>[5](https://www.computerhistory.org/internethistory/1960s/)</sup><sup> • </sup><sup>[14](https://archive.computerhistory.org/resources/text/DEC/dec.digital_%28DEC%29_timeline_1957-1997.102630354/36-bit.htm)</sup>。

在那次趋同之后，字长稳定为字节的 2 的幂倍数。由于广泛使用的字长往往是地址解析单位的 2 的幂倍数，当代体系结构通常将其字以及其他操作数宽度定义为 2 的幂乘以字节。<sup>[4](https://ucan.us/doyetech/word.htm)</sup> 留存下来的差异在于命名以及体系结构将哪种尺寸称为字：x86 上出于历史原因称为 16 位，RISC-V 对内存字的定义中为 32 位，而 RV64I 机器的寄存器和地址空间则为 64 位 XLEN<sup>[6](https://learn.microsoft.com/zh-cn/windows-hardware/drivers/debugger/x86-architecture)</sup><sup> • </sup><sup>[3](https://riscv.github.io/riscv-isa-manual/snapshot/spec/index.html)</sup><sup> • </sup><sup>[8](https://docs.riscv.org/reference/isa/v20240411/_attachments/riscv-unprivileged.pdf)</sup>。

## References

1. [z/OS glossary: word, IBM Documentation](https://www.ibm.com/docs/en/ent-metalc-zos/3.1?topic=reference-glossary)
2. [Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1: Basic Architecture, Chapter 4, Data Types](https://www.intel.com/content/dam/develop/external/us/en/documents-tps/253665-sdm-vol-11.pdf)
3. [The RISC-V Instruction Set Manual (snapshot)](https://riscv.github.io/riscv-isa-manual/snapshot/spec/index.html)
4. [Computer Architecture: Word Size, Registers](https://ucan.us/doyetech/word.htm)
5. [Internet History, The 1960s, Computer History Museum](https://www.computerhistory.org/internethistory/1960s/)
6. [x86 architecture, Windows drivers, Microsoft Learn](https://learn.microsoft.com/zh-cn/windows-hardware/drivers/debugger/x86-architecture)
7. [Memory interface, CS 2210, University of Vermont](https://www.uvm.edu/~cbcafier/cs2210/content/07_memory_hierarchy/memory_interface.html)
8. [The RISC-V Instruction Set Manual, Volume I: Unprivileged Architecture (RV64I)](https://docs.riscv.org/reference/isa/v20240411/_attachments/riscv-unprivileged.pdf)
9. [Chapter 6: Architecture, CSE 3602, Washington University in St. Louis](https://classes.engineering.wustl.edu/cse3602/content/CSE3602-4.ISA-2-full.pdf)
10. [What Is Intel Extended Memory 64 Technology?, Intel Support](https://www.intel.com/content/www/us/en/support/articles/000005898/processors.html)
11. [Digital at Work: Snapshots from the First Thirty-Five Years, Computer History Museum](https://archive.computerhistory.org/resources/text/DEC/dec.digital_at_work.1992.102630350.pdf)
12. [The evolution of IBM System/360 architecture, IBM Journal of Research and Development](https://bitsavers.computerhistory.org/pdf/ibm/IBM_Journal_of_Research_and_Development/255/ibmrd2505D.pdf)
13. [IBM 1401 Guide, Computer History Museum](https://ibm1401.computerhistory.org/1401GuidePosterV9.html)
14. [36-bit Timeline](https://archive.computerhistory.org/resources/text/DEC/dec.digital_%28DEC%29_timeline_1957-1997.102630354/36-bit.htm)

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

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Processors & processor engineering › Instruction set architectures › ISA design concepts and classification

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/word-computer-architecture

English original: https://www.edgepedia.org/word-computer-architecture
