In computer architecture, 4-bit integers, or other data units are those that are 4 bits wide. Also, 4-bit CPU and ALU architectures are those that are based on registers, or data buses of that size. Memory addresses (and thus address buses) for 4-bit CPUs are generally much larger than 4-bit (since only 16 memory locations would be very restrictive), such as 12-bit or more, while they could in theory be 8-bit. A group of four bits is also called a nibble and has 24 = 16 possible values.
Some of the first microprocessors had a 4-bit word length and were developed around 1970. Traditional (non-quantum) 4-bit computers are by now obsolete, while recent quantum computers are 4-bit,[1][2] but also based on qubits, such as the IBM Q Experience. See also: Bit slicing#Bit-sliced quantum computers.
The first commercial microprocessor was the binary-coded decimal (BCD-based) Intel 4004,[3][4] developed for calculator applications in 1971; it had a 4-bit word length, but had 8-bit instructions and 12-bit addresses. It was succeeded by the Intel 4040.
The Texas Instruments TMS 1000 (1974) was a 4-bit CPU; it had a Harvard architecture, with an on-chip instruction ROM, 8-bit-wide instructions and an on-chip data RAM with 4-bit words.[5]
The 4-bit processors were programmed in assembly language or Forth, e.g. "MARC4 Family of 4 bit Forth CPU"[6] because of the extreme size constraint on programs and because common programming languages (for microcontrollers, 8-bit and larger), such as the C programming language, do not support 4-bit data types (C requires that the size of the char data type be at least 8 bits,[7] and that all data types other than bitfields have a size that is a multiple of the character size[8][9][10]).
The 1970s saw the emergence of 4-bit software applications for mass markets like pocket calculators. During the 1980s 4-bit microprocessor were used in handheld electronic games to keep costs low.
In the 1970s and 1980s, a number of research and commercial computers used bit slicing, in which the CPU's arithmetic logic unit (ALU) was built from multiple 4-bit-wide sections, each section including a chip such as an Am2901 or 74181 chip.
The Zilog Z80, although it is an 8-bit microprocessor, has a 4-bit ALU.[11][12]
Although the Data General Nova is a series of 16-bit minicomputers, the original Nova and the Nova 1200 internally processed numbers 4 bits at a time with a 4-bit ALU,[13] sometimes called "nybble-serial".[14]
The HP Saturn processors, used in many Hewlett-Packard calculators between 1984 and 2003 (including the HP 48 series of scientific calculators) are "4-bit" (or hybrid 64-/4-bit) machines; as the Intel 4004 did, they string multiple 4-bit words together, e.g. to form a 20-bit memory address, and most of the registers are 64 bits wide, storing 16 4-bit digits.[15][16][17]
In addition, some early calculators – such as the 1967 Casio AL-1000, the 1972 Sinclair Executive, and the aforementioned 1984 HP Saturn – had 4-bit datapaths that accessed their registers 4 bits (one BCD digit) at a time.[18]
While 32- and 64-bit processors are more prominent in modern consumer electronics, 4-bit CPUs can as of 2021 be bought online at down to $0.23 (in bulk for 1000 units, or at $0.70 for one of the same kind or $2.55 for a different kind),[19][20] while an 8-bit microcontroller can be bought for $0.24 for a single one (also obsolete; and a non-obsolete 8-bit CPUs can be bought for $0.30 per unit, for 702 units at $210.60), a fraction of the 4-bit price, and even a single modern 32-bit microcontroller can be bought for $0.24 so it's unclear if 4-bit CPUs are still used for anything else than for replacement parts. For example, one bicycle computer specifies that it uses a "4 bit, 1-chip microcomputer".[21] Other typical uses include coffee makers, infrared remote controls,[22] and security alarms.[23]
The processor in Barbie typewriters that can encrypt is a 4-bit microcontroller.[24]
With 4 bits, it is possible to create 16 different values. All single-digit hexadecimal numbers can be written with four bits. Binary-coded decimal is a digital encoding method for numbers using decimal notation, with each decimal digit represented by four bits.
| Binary | Octal | Decimal | Hexadecimal |
|---|---|---|---|
| 0000 | 0 | 0 | 0 |
| 0001 | 1 | 1 | 1 |
| 0010 | 2 | 2 | 2 |
| 0011 | 3 | 3 | 3 |
| 0100 | 4 | 4 | 4 |
| 0101 | 5 | 5 | 5 |
| 0110 | 6 | 6 | 6 |
| 0111 | 7 | 7 | 7 |
| 1000 | 10 | 8 | 8 |
| 1001 | 11 | 9 | 9 |
| 1010 | 12 | 10 | A |
| 1011 | 13 | 11 | B |
| 1100 | 14 | 12 | C |
| 1101 | 15 | 13 | D |
| 1110 | 16 | 14 | E |
| 1111 | 17 | 15 | F |
Olympia CD700 Desktop Calculator using the National Semiconductor MAPS MM570X bit-serial 4-bit microcontroller
National Semiconductor MM5700CA/D bit-serial 4-bit microcontroller
bigadder.qasm: Quantum ripple-carry adder. 8-bit adder made out of 2 4-bit adders from adder.qasm.
The only storage types of Open QASM (version 2.0) are classical and quantum registers, which are one-dimensional arrays of bits and qubits, respectively.