Nibble
Four-bit unit of binary data
From Wikipedia, the free encyclopedia
In computing, a nibble, also spelled nybble[1] to match byte,[2] is a unit of information consisting of four bits,[3] equivalent to one half of a byte or octet (data units of eight-bit length).[4][5] The unit is alternatively called a nybble, nybl, half-byte or tetrad.[6][7] In computer networking and telecommunications, the unit is also sometimes called a semi-octet,[8] quadbit,[9] or quartet.[10][11]

A nibble uses four digits in binary positional notation (base 2) to encode one of sixteen () possible values, representing the same amount of information stored by two digits in the quaternary numeral system (base 4) or just a single hexadecimal ("hex")[12] digit (base 16). That functional equivalence allows nibbles to typically be represented by a single hex digit, and likewise, byte values by a pair of hex digits.[12]
Four-bit computers use nibble-sized data for storage and operations, in the form of the word unit. Such computers were used in early microprocessors, pocket calculators and pocket computers, and continue to be used in some microcontrollers. In this context, 4-bit groups were sometimes also called characters[13] or digits[14] rather than nibbles.[3]
History
The term nibble originates from its representing half a byte, with byte a homophone of the English word bite.[2] David B. Benson may have coined its use to describe four-bit values as a joke while working as a professor at Washington State University in 1958.[15]
In 1977, an early use of the spelling nybble for the term was recorded within the consumer-banking technology group at Citibank. It created a pre-ISO 8583 standard for transactional messages between ATMs and Citibank's data centers that used the basic data unit nabble.[citation needed]
In the early 1980s, the alternative spelling nybble reflected the spelling of byte, as noted in editorials of Kilobaud Microcomputing and Byte.[citation needed]
Historically, nybble was used in several cases for data units longer than four bits. On the Apple II, much of the disk drive control and group coded recording was implemented in software, and writing data to a disk was done by converting 256-byte pages into sets of 5-bit[16] (later, 6-bit) nibbles whereas loading disk data required the reverse.[17][18] Moreover, 1982 documentation for the Integrated Woz Machine refers consistently to an "8 bit nibble".[19] The term byte once had the same ambiguity and meant a set of bits but not necessarily 8, hence the distinction of bytes and octets or of nibbles and quartets (or quadbits). Today, the terms byte and nibble almost always refer to 8-bit and 4-bit collections, respectively, and are very rarely used to express any other sizes.[citation needed]
Part of a byte
Nibble is used to describe the amount of memory used to store a digit of a number stored in packed decimal format (BCD) within an IBM mainframe. This technique is used to make computations faster and debugging easier. An 8-bit byte is split in half, and each nibble is used to store one decimal digit. The last (rightmost) nibble of the variable is reserved for the sign.[citation needed] Thus, a variable that can store up to nine digits would be packed into 5 bytes. Ease of debugging resulted from the numbers' being readable in a hex dump where two hex numbers are used to represent the value of a byte, as , or . For example, a five-byte BCD value of 31 41 59 26 5C represents a decimal value of +314,159,265.
Packed nibbles can also describe binary numbers. When converting from bytes to nibbles,the two halves are often referred to as the low (right) and high (left) nibbles rather than the more formal labels of least- and most-significant bits.[20] For example, in the binary representation for the natural number 97, , the high nibble is () and the low nibble is (). That same number expressed in hexadecimal is simply , with each nibble now reduced to a single digit that nonetheless represents the same value ().
Value representation
A nibble-sized value can be represented in different numeric bases:
See also
- Binary number – Number expressed in the base-2 numeral system
- Syllable – Platform-specific data size used for some historical digital hardware
- Word – Base memory unit handled by a computer