# 半字节

**半字节**（nibble，亦拼作 **nybble** 或 **nyble**）是一种数字信息单位，由四个连续的二进制位组成，即一个8位字节的一半。<sup>[1](https://www.techtarget.com/whatis/definition/nibble)</sup> 由于四位可取 \( 2^{4} = 16 \) 种可能的值，一个半字节恰好对应一个十六进制数字，而一个字节始终可以写成两个十六进制数字。<sup>[1](https://www.techtarget.com/whatis/definition/nibble)</sup><sup> • </sup><sup>[2](https://www.cl.cam.ac.uk/teaching/2021/PrepCS/CompFunds/NumberSystems.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 大小 | 四位，即一个8位字节（八位组）的一半<sup>[1](https://www.techtarget.com/whatis/definition/nibble)</sup> |
| 取值 | \( 2^{4} = 16 \) 种可能组合，从 0000 到 1111<sup>[1](https://www.techtarget.com/whatis/definition/nibble)</sup> |
| 十六进制对应 | 一个半字节恰好是一个十六进制数字；NIST 将十六进制数字定义为4位字符串的表示形式，例如“7”= 0111，“a”= 1010<sup>[3](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf)</sup> |
| 字节记法 | 在 NIST 的 0xab 记法中，a 和 b 各自指定一个字节中的四位；0xc6 表示 11000110<sup>[4](https://csrc.nist.gov/glossary/term/0xab)</sup> |
| 拼写 | 无标准拼写；nybble、nyble 和 nybl 均有使用，“nibble”延续了 bit 和 byte 的“可食用数据”隐喻<sup>[5](https://courses.grainger.illinois.edu/cs340/sp2024/text/bytes.html)</sup><sup> • </sup><sup>[1](https://www.techtarget.com/whatis/definition/nibble)</sup> |
| 压缩十进制中的用途 | 在 IBM 系统上，压缩十进制字节的每个半字节存放一个二进制编码十进制数字，最后一个半字节存储符号<sup>[6](https://www.ibm.com/docs/en/b2b-integrator/6.2.0?topic=fields-using-number-field)</sup> |
| 通信中的名称 | 在通信领域，半字节有时被称为四位组（quadbit）<sup>[1](https://www.techtarget.com/whatis/definition/nibble)</sup> |

## 与十六进制的关系

十六进制是以16为基数的计数系统，使用数字0到9，并用字母A到F表示10到15的值。由于16是2的四次方，每个十六进制数字恰好表示四个二进制位，因此两者之间的转换无需算术运算：将二进制串从最低有效位开始每四位分为一组，每组替换为对应的十六进制数字即可。<sup>[7](https://ocw.mit.edu/courses/6-004-computation-structures-spring-2017/pages/c1/c1s1/)</sup><sup> • </sup><sup>[8](https://www.academiq-edu.com/o-level/computer-science/cie/2026-2028/hexadecimal)</sup> 例如，一个32位字 1010 0001 0000 0011 1111 1110 0010 0011 因此变为八位十六进制串“a103fe23”，每个半字节对应一个十六进制数字。<sup>[3](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf)</sup>

这种一一映射正是半字节作为一个有名称的单位而存在的原因。使用十六进制是因为它比二进制短得多，便于人们读写，同时保持无损：一个字节始终可以容纳于两个十六进制数字之中，且按字节边界对齐，而十进制则不具备这种对齐性。<sup>[8](https://www.academiq-edu.com/o-level/computer-science/cie/2026-2028/hexadecimal)</sup><sup> • </sup><sup>[9](https://realpython.com/ref/computer-science-glossary/hexadecimal/)</sup> 剑桥大学计算机实验室的教学讲义直接以此定义半字节：字节的一半，事实上即4位或一个十六进制数字。<sup>[2](https://www.cl.cam.ac.uk/teaching/2021/PrepCS/CompFunds/NumberSystems.html)</sup>

## 压缩十进制与符号半字节

半字节在 IBM 系统的压缩十进制（二进制编码十进制，BCD）存储中有具体作用。一个十进制数字只有十种可能的值，即0到9，因此四位足以容纳，两个数字可以打包进每个8位字节；十进制数92存储为字节 1001 0010。因此，压缩数据所需的存储空间是字符数据的一半，后者每个字节存储一个数字。<sup>[6](https://www.ibm.com/docs/en/b2b-integrator/6.2.0?topic=fields-using-number-field)</sup>

压缩十进制数的最后一个半字节存储的是符号而非数字：十六进制 C 表示正值，十六进制 D 表示负值，十六进制 F 表示无符号值。<sup>[6](https://www.ibm.com/docs/en/b2b-integrator/6.2.0?topic=fields-using-number-field)</sup> IBM 其他产品的文档描述了相同的布局，每个字节由一对四位编码组成，包括十进制数字编码、符号编码和区码。<sup>[10](https://www.ibm.com/docs/en/module_1678991624569/pdf/SA22-7832-14.pdf?cp=HW11W)</sup> 该术语也出现在编译器行为中：IBM 的 Enterprise COBOL 选项控制编译器是否生成代码，在算术运算前修正压缩十进制数据中无效的符号半字节。<sup>[11](https://www.ibm.com/docs/en/SS6SG3_6.5/pdf/pgmvs.pdf)</sup>

## 四位硬件

半字节曾经是机器的原生单位。[英特尔 4004](https://www.edgepedia.org/zh/intel-4004)（Intel 4004）于1971年11月15日发布，通常被描述为第一款可编程微处理器，是一款面向二进制编码十进制的4位处理器，为 Busicom 141-PF 打印计算器而设计。<sup>[12](https://download.intel.com/newsroom/2021/data-center/4004-infographic.pdf)</sup><sup> • </sup><sup>[13](https://www.intel.com/content/www/us/en/history/virtual-vault/articles/the-intel-4004.html)</sup> 在此类架构中，四位一组是处理的基本单位，而非字节。

现代计算机很少以位或半字节这样小的单位进行操作；它们通常处理8位一组的数据，称为字节或八位组。伊利诺伊大学 CS340 课程讲义指出，在记录数值时“十六进制数字”是更常用的说法，而在将四位组作为数据的一部分提及时“半字节”更为常见。<sup>[5](https://courses.grainger.illinois.edu/cs340/sp2024/text/bytes.html)</sup> [TechTarget](https://www.edgepedia.org/zh/techtarget) 同样指出，半字节这一术语的使用频率已不如从前。<sup>[14](https://www.techtarget.com/whatis/definition/bit-binary-digit)</sup>

## 通信中的半字节

在通信领域，半字节有时被称为**四位组**（quadbit），仍然是4位、16种可能组合。信号可以按四位组而非单个位进行编码；在半字节交织这一多路复用技术中，来自低速信道的四位组被馈入承载于高速信道上的多路复用信号。<sup>[1](https://www.techtarget.com/whatis/definition/nibble)</sup>

## 词源与拼写

该术语借用了 bit 和 byte 所建立的“可食用数据”隐喻：半字节就是一小口，即字节的一半。<sup>[1](https://www.techtarget.com/whatis/definition/nibble)</sup> 由于与 byte 的关联，该单位偶尔拼作 nybble 或 nyble。<sup>[1](https://www.techtarget.com/whatis/definition/nibble)</sup> 没有标准拼写；伊利诺伊大学的讲义列出了 nybble、nyble 和 nybl 作为使用中的变体。<sup>[5](https://courses.grainger.illinois.edu/cs340/sp2024/text/bytes.html)</sup>

## References

1. [What is a nibble in computers and digital technology? TechTarget, Robert Sheldon (Nov 9, 2022)](https://www.techtarget.com/whatis/definition/nibble)
2. [Number Systems, Cambridge Computer Laboratory, Preparation for Computer Science](https://www.cl.cam.ac.uk/teaching/2021/PrepCS/CompFunds/NumberSystems.html)
3. [FIPS 180-4, Secure Hash Standard, NIST](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf)
4. [0xab, CSRC Glossary, NIST](https://csrc.nist.gov/glossary/term/0xab)
5. [Bits, Bytes, and Composite Values, CS340, University of Illinois Grainger College of Engineering](https://courses.grainger.illinois.edu/cs340/sp2024/text/bytes.html)
6. [Using a Number Field, IBM Sterling B2B Integrator documentation](https://www.ibm.com/docs/en/b2b-integrator/6.2.0?topic=fields-using-number-field)
7. [Computation Structures 1.1 Annotated Slides, MIT OpenCourseWare](https://ocw.mit.edu/courses/6-004-computation-structures-spring-2017/pages/c1/c1s1/)
8. [Hexadecimal, Cambridge O Level Computer Science 2210, Academiq Edu](https://www.academiq-edu.com/o-level/computer-science/cie/2026-2028/hexadecimal)
9. [Hexadecimal, Computer Science Glossary, Real Python](https://realpython.com/ref/computer-science-glossary/hexadecimal/)
10. [z/Architecture Principles of Operation, IBM](https://www.ibm.com/docs/en/module_1678991624569/pdf/SA22-7832-14.pdf?cp=HW11W)
11. [Enterprise COBOL for z/OS 6.5 Programming Guide, IBM](https://www.ibm.com/docs/en/SS6SG3_6.5/pdf/pgmvs.pdf)
12. [Intel 4004 50th Anniversary infographic, Intel Newsroom](https://download.intel.com/newsroom/2021/data-center/4004-infographic.pdf)
13. [Announcing a New Era of Integrated Electronics: The Intel 4004, Intel](https://www.intel.com/content/www/us/en/history/virtual-vault/articles/the-intel-4004.html)
14. [What is bit (binary digit) in computing? TechTarget](https://www.techtarget.com/whatis/definition/bit-binary-digit)

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

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Boards, peripherals & form factors › Boards & peripherals overview

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/nibble

English original: https://www.edgepedia.org/nibble
