Jump to content

Nibble

From Wikipedia, the free encyclopedia

Template:Short description Template:CS1 config Template:Use American English Template:Use dmy dates Template:About Template:More citations needed [[File:Octets in CP866 ordered by nibbles.png|thumb|right|A [[Code page 866|Template:Abbr 866]] font lookup table for all possible octet values, with one nibble on each axis]] 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 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 (<math display="inline">2^4</math>) 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.Template:Citation needed

In the early 1980s, the alternative spelling nybble reflected the spelling of byte, as noted in editorials of Kilobaud Microcomputing and Byte.Template: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.Template: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.Template: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 <math display="inline">2^4 \times 2^4 = 2^8</math>, or <math display="inline">16 \times 16 = 256</math>. For example, a five-byte BCD value of <syntaxhighlight lang="text" class="" style="" inline="1">31</syntaxhighlight>Template:Narrow no-break space<syntaxhighlight lang="text" class="" style="" inline="1">59</syntaxhighlight>Template:Narrow no-break space<syntaxhighlight lang="text" class="" style="" inline="1">5C</syntaxhighlight> represents a decimal value of Template:Resize314,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, <math display="inline">(0110\ 0001)_2</math>, the high nibble is <math display="inline">0110_2</math> (<math display="inline">2^6 + 2^5 = 64 + 32 = 96</math>) and the low nibble is <math display="inline">0001_2</math> (<math display="inline">2^0 = 1</math>). That same number expressed in hexadecimal is simply <math display="inline">61_{16}</math>, with each nibble now reduced to a single digit that nonetheless represents the same value (<math display="inline">(6 \times 16^1) + (1 \times 16^0) = 96 + 1 = 97</math>).

Value representation

A nibble-sized value can be represented in different numeric bases:

continued at right
Nibble (binary) Decimal Template:Abbr Octal Template:Abbr
scope="row" Template:Yes 0 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 1 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 2 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 3 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 4 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 5 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 6 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 7 Template:Hexadecimal Template:Octal Template:Quaternary
Nibble (binary) Decimal Template:Abbr Octal Template:Abbr
scope="row" Template:Yes 8 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 9 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 10 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 11 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 12 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 13 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 14 Template:Hexadecimal Template:Octal Template:Quaternary
scope="row" Template:Yes 15 Template:Hexadecimal Template:Octal Template:Quaternary

See also

References

Template:Reflist


Template:Computer Storage Volumes

  1. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named aal_bsc1981
  2. ↑ 2.0 2.1 Cite error: Invalid <ref> tag; no text was provided for refs named raymond1991
  3. ↑ 3.0 3.1 Cite error: Invalid <ref> tag; no text was provided for refs named raphael1974
  4. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named hall1980
  5. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named warren2002
  6. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named carr1959
  7. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named speiser1965
  8. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named puzman2012
  9. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named horak2007
  10. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named brewster1994
  11. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named courbis2006
  12. ↑ 12.0 12.1 Cite error: Invalid <ref> tag; no text was provided for refs named heller1997
  13. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named intel1973
  14. ↑ Template:Cite book
  15. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named hollandbeck
  16. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named worth1982
  17. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named lechner1984
  18. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named copyiiplus9
  19. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named iwm1982
  20. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named baccala1997