Nibble
{{Short description|Four-bit unit of binary data}}
{{About|the data storage unit}}
{{More citations needed|date=April 2015}}
{{Use dmy dates|date=March 2020|cs1-dates=y}}
{{Use American English|date=March 2019}}
File:Octets in CP866 ordered by nibbles.png code page 866 font table ordered by nibbles.]]
In computing, a nibble, or spelled nybble to match byte, is a unit of information that is an aggregation of four-bits; half of a byte/octet. The unit is alternatively called nyble, nybl, half-byte or tetrade. In networking or telecommunications, the unit is often called a semi-octet, quadbit, or quartet.
As a nibble can represent sixteen ({{math|24}}) possible values, a nibble value is often shown as a hexadecimal digit (hex digit). A byte is two nibbles, and therefore, a value can be shown as two hex digits.
Four-bit computers use nibble-sized data for storage and operations; as the word unit. Such computers were used in early microprocessors, pocket calculators and pocket computers. They continue to be used in some microcontrollers. In this context, 4-bit groups were sometimes also called characters rather than nibbles.
History
The term nibble originates from its representing "half a byte", with byte a homophone of the English word bite. In 2014, David B. Benson, a professor emeritus at Washington State University, remembered that he playfully used (and may have possibly coined) the term nibble as "half a byte" and unit of storage required to hold a binary-coded decimal (BCD) digit around 1958, when talking to a programmer from Los Alamos Scientific Laboratory. The alternative spelling nybble reflects the spelling of byte, as noted in editorials of Kilobaud and Byte in the early 1980s. Another early recorded use of the term nybble was in 1977 within the consumer-banking technology group at Citibank. It created a pre-ISO 8583 standard for transactional messages between cash machines and Citibank's data centers that used the basic data unit 'nabble'.
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. Thus a variable which 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|16×16 {{=}} 28}}. For example, a five-byte BCD value of {{code|31}} {{code|41}} {{code|59}} {{code|26}} {{code|5C}} represents a decimal value of +314159265.
Historically, there are cases where nybble was used for a group of bits greater than 4. On the Apple II, much of the disk drive control and group-coded recording was implemented in software. Writing data to a disk was done by converting 256-byte pages into sets of 5-bit (later, 6-bit) nibbles and loading disk data required the reverse. Moreover, 1982 documentation for the Integrated Woz Machine refers consistently to an "8 bit nibble". 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.
Value representation
A nibble-sized value can be represented in different numeric bases:
class="wikitable" style="margin:auto"
! Binary !! Decimal !! Hexadecimal | ||
{{Mono|0000}} | 0 | 0 |
{{Mono|0001}} | 1 | 1 |
{{Mono|0010}} | 2 | 2 |
{{Mono|0011}} | 3 | 3 |
{{Mono|0100}} | 4 | 4 |
{{Mono|0101}} | 5 | 5 |
{{Mono|0110}} | 6 | 6 |
{{Mono|0111}} | 7 | 7 |
{{Mono|1000}} | 8 | 8 |
{{Mono|1001}} | 9 | 9 |
{{Mono|1010}} | 10 | A |
{{Mono|1011}} | 11 | B |
{{Mono|1100}} | 12 | C |
{{Mono|1101}} | 13 | D |
{{Mono|1110}} | 14 | E |
{{Mono|1111}} | 15 | F |
Low and high nibbles <span class="anchor" id="Low"></span><span class="anchor" id="High"></span>
The low and high nibbles of a byte are its two halves that are the less and the more significant bits within the byte, respectively. In a graphical representation of bits within a byte, the leftmost bit could represent the most significant bit (MSB), corresponding to ordinary decimal notation in which the digit at the left of a number is the most significant. In such an illustration, the four bits on the left end of the byte form the high nibble, and the remaining four bits form the low nibble. For example,
: {{math|ninety-seven {{=}} 9710 {{=}} (0110 0001)2 {{=}} 6116}}
the high nibble is {{math|01102}} ({{math|616}}), and the low nibble is {{math|00012}} ({{math|116}}). The total value is {{math|high-nibble × 1610 + low-nibble}} ({{math|6 × 16 + 1 {{=}} 9710}}).
See also
- {{Annotated link|Binary number}}
- {{Annotated link|Syllable (computing)|Syllable}}
- {{Annotated link|Word (computer architecture)|Word}}
References
{{reflist|refs=
{{cite book |author-last=Hall |author-first=Douglas V. |title=Microprocessors and Digital Systems |publisher=McGraw-Hill |year=1980 |isbn=0-07-025571-7}}
{{Cite book |title=Hacker's Delight |title-link=Hacker's Delight |author-first=Henry S. |author-last=Warren Jr. |date=2013 |orig-year=2002 |edition=2 |publisher=Addison Wesley – Pearson Education, Inc. |isbn=978-0-321-84268-8 |id=0-321-84268-5}}
{{cite book |title=The New Hacker's Dictionary |author-first=Eric S. |author-last=Raymond |author-link=Eric S. Raymond |page=333 |url=https://books.google.com/books?id=g80P_4v4QbIC&pg=PA333 |publisher=MIT Press |year=1996 |isbn=978-0-262-68092-9}}
{{cite book |title=Introduction to the use of digital computers: Notes from the Summer Conference Held at the Computation Center of the University of North Carolina, Chapel Hill, N.C., August 17-28, 1959 |volume=1 |series=Frontier Research on Digital Computers |author-first=John W. |author-last=Carr |publisher=University of North Carolina at Chapel Hill, Computation Center |page=211 |quote=Each of these letters corresponds to one of the integers from zero to fifteen, therefore requiring 4 bits (one "tetrade") in binary representation.}}
{{cite book |author-first=Ambrosius Paul |author-last=Speiser |author-link=Ambrosius Paul Speiser |location=ETH Zürich, Zürich, Switzerland |title=Digitale Rechenanlagen – Grundlagen / Schaltungstechnik / Arbeitsweise / Betriebssicherheit |language=de |trans-title=Digital computers – Basics / Circuits / Operation / Reliability |edition=2 |date=1965 |orig-year=1961 |publisher=Springer-Verlag / IBM |lccn=65-14624 |id=0978 |pages=6, 34, 165, 183, 208, 213, 215}}
{{cite book |title=Public Data Networks: From Separate PDNs to the ISDN |author-first1=Josef |author-last1=Puzman |author-first2=Boris |author-last2=Kubin |publisher=Springer Science+Business Media |date=2012 |isbn=978-1-4471-1737-7 |page=113 |url=https://books.google.com/books?id=ZY7qBwAAQBAJ&pg=PA113}}
{{cite book |title=Webster's New World Telecom Dictionary |author-first=Ray |author-last=Horak |publisher=John Wiley & Sons |date=2007 |isbn=978-0-470-22571-4 |page=402 |url=https://books.google.com/books?id=L18YaEomzjMC&pg=PA402}}
{{cite book |title=Data Communications and Networks, Vol. III |volume=31 |series=IEE telecommunications series |publisher=Institution of Electrical Engineers |author-first=Ronald L. |author-last=Brewster |date=1994 |isbn=978-0-85296-804-8 |page=155 |url=https://books.google.com/books?id=7O5EXtN94PIC&pg=PA155 |quote=A data symbol represents one quartet (4 bits) of binary data.}}
{{cite book |title=Introduction to C++ |author-first=Steve |author-last=Heller |publisher=Morgan Kaufmann |date=1997 |isbn=978-0-12-339099-8 |page=27 |url=https://books.google.com/books?id=KbiDKrvExnsC&pg=PA27 |quote=Each hex digit (0–f) represents exactly 4 bits.}}
{{cite book |author-last2=Lechner |author-first2=Pieter M. |author-last1=Worth |author-first1=Don D. |title=Beneath Apple DOS |date=May 1982 |orig-year=1981 |edition=4th printing, 1st |publisher=Quality Software |location=Reseda, California, USA |url=https://archive.org/stream/Beneath_Apple_DOS_OCR#page/n24/mode/1up |access-date=2017-03-21 }} [http://asciiexpress.net/files/docs/Beneath%20Apple%20DOS%20OCR.pdf] [https://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Books/Beneath%20Apple%20DOS.pdf] [http://fd.fabiensanglard.net/prince_of_persia/Beneath%20Apple%20DOS.pdf] {{Webarchive|url=https://web.archive.org/web/20160309202219/http://fd.fabiensanglard.net/prince_of_persia/Beneath%20Apple%20DOS.pdf |date=9 March 2016 }}
{{cite book |author-last2=Lechner |author-first2=Pieter M. |author-last1=Worth |author-first1=Don D. |title=Beneath Apple ProDOS – For Users of Apple II Plus, Apple IIe and Apple IIc Computers |date=March 1985 |orig-year=1984 |edition=2nd printing, 1st |publisher=Quality Software |location=Chatsworth, California, USA |isbn=0-912985-05-4 |lccn=84-61383 |url=http://www.apple-iigs.info/doc/fichiers/beneathprodos.pdf |access-date=2017-03-21 |url-status=live |archive-url=https://web.archive.org/web/20170321014045/http://www.apple-iigs.info/doc/fichiers/beneathprodos.pdf |archive-date=2017-03-21}} [https://archive.org/details/A2_BENEATH_APPLE_PRODOS_1_1984]
{{cite book |title=Copy II Plus Version 9 – ProDOS/DOS Utilities – Data Recovery, File Management, Protected Software Backup |publisher=Central Point Software, Inc. |version=9.0 |date=1989-10-31 |orig-year=1982 |url=http://cps.applearchives.com/copy_ii_plus_9x_manual.pdf |access-date=2017-03-21 |url-status=dead |archive-url=https://archive.today/20170507224326/http://cps.applearchives.com/copy_ii_plus_9x_manual.pdf |archive-date=7 May 2017 }}
{{cite book |title=MCS-4 Assembly Language Programming Manual – The INTELLEC 4 Microcomputer System Programming Manual |chapter=Terms And Abbreviations |edition=Preliminary |publisher=Intel Corporation |date=December 1973 |location=Santa Clara, California, USA |id=MCS-030-1273-1 |pages=v, ((2–6)) |chapter-url=http://bitsavers.trailing-edge.com/components/intel/MCS4/MCS-4_Assembly_Language_Programming_Manual_Dec73.pdf |access-date=2020-03-02 |url-status=live |archive-url=https://web.archive.org/web/20200301235541/http://bitsavers.trailing-edge.com/components/intel/MCS4/MCS-4_Assembly_Language_Programming_Manual_Dec73.pdf |archive-date=2020-03-01 |quote=[...] Bit – The smallest unit of information which can be represented. (A bit may be in one of two states I 0 or 1). [...] Byte – A group of 8 contiguous bits occupying a single memory location. [...] Character – A group of 4 contiguous bits of data. [...]}} (NB. This Intel 4004 manual uses the term character referring to 4-bit rather than 8-bit data entities. Intel switched to use the more common term nibble for 4-bit entities in their documentation for the succeeding processor 4040 in 1974 already.)
{{cite book |title=MCS-40 User's Manual For Logic Designers |chapter=The Functions Of A Computer: Instruction Register And Decoder |publisher=Intel Corporation |editor-first=Howard A. |editor-last=Raphael |date=November 1974 |location=Santa Clara, California, USA |page=viii |chapter-url=http://bitsavers.trailing-edge.com/components/intel/MCS40/MCS-40_Users_Manual_Nov74.pdf |access-date=2020-03-03 |url-status=live |archive-url=https://web.archive.org/web/20200303024244/http://bitsavers.trailing-edge.com/components/intel/MCS40/MCS-40_Users_Manual_Nov74.pdf |archive-date=2020-03-03 |quote=[...] The characteristic eight bit field is sometimes referred to as a byte, a four bit field can be referred to as a nibble. [...]}}
}}
External links
- {{cite web |url=http://www.txbobsc.com/aal/1981/aal8105.html |title=Apple Assembly Line |date=May 1981 |volume=1 |number=8}}
{{Computer Storage Volumes}}
Category:Computing terminology
Category:Articles with example C code
Category:Articles with example Lisp (programming language) code