Search topics and sections

A bit is the basic unit of information in computer science and information theory. A single bit has one of two values, usually written 0 and 1, which can also stand for pairs such as false and true, no and yes, or off and on.[1] Groups of bits can hold more choices, because each added bit doubles the number of possible patterns.[2]

The word, short for binary digit, was suggested by John Tukey at Bell Labs in 1946 or 1947. Claude Shannon first used it in print in 1948, in the paper that made it a unit for measuring information.[3] In that sense, one bit is the information you gain by learning the result of a choice between two equally likely options, such as a fair coin toss.[3]

Counting with bits

Shannon noted that adding one relay to a group doubles the number of its possible states. So nn two-state devices have 2n2^n states and can store nn bits.[2]

M=2nM = 2^n

Here nn is the number of bits and MM is the number of different patterns they can form.

Counting the other way, choosing one of MM equally likely options takes log⁡2M\log_2 M bits of information.[2] Storing the choice needs a whole number of bits, so the number of bits needed is:

b=⌈log⁡2M⌉b = \lceil \log_2 M \rceil

Here bb is the number of stored bits, and the brackets ⌈ ⌉\lceil \ \rceil mean rounding up to the next whole number. When MM is a power of two, no rounding is needed.

  • 1 bit gives 2 patterns: 0 and 1.
  • 3 bits give 8 patterns, from 000 to 111.
  • 8 bits, one Byte, give 256 patterns.
  • A decimal digit has 10 values, so it carries about 3133\tfrac{1}{3} bits.[2] Storing one takes ⌈3.32⌉=4\lceil 3.32 \rceil = 4 bits.
Binary tree of bit patterns 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 bit: 2 patterns 2 bits: 4 patterns 3 bits: 8 patterns start 000 = 0 001 = 1 010 = 2 011 = 3 100 = 4 101 = 5 110 = 6 111 = 7
Each added bit doubles the number of distinct patterns, so nn bits can represent 2n2^n values. The path from the root to each leaf spells out one of the eight 3-bit patterns, from 000 = 0 to 111 = 7.

Bits as binary numbers

In a binary number, each bit is a digit whose place value is a power of two. Tukey's 1947 memo used bit in this sense, as the binary counterpart of a decimal digit.[3]

v=∑i=0n−1bi 2iv = \sum_{i=0}^{n-1} b_i \, 2^i

Here vv is the value of the number, bib_i is the bit (0 or 1) in position ii, and positions count from 0 at the right. For example, 1011 in binary is 8+0+2+1=118 + 0 + 2 + 1 = 11.

Two meanings of "bit"

The word bit names two related but different things. One is a binary digit, a slot that holds a 0 or a 1. The other is a unit of information, which the standard IEC 80000-13 calls the shannon (symbol Sh).[4][5]

Binary digit Unit of information
What it counts Two-state slots used to store or send data Uncertainty that a message removes
Example A byte holds 8 bits A fair coin toss gives 1 Sh
Name in IEC 80000-13 bit shannon (Sh)
Typical uses Memory size, file size, data rate Entropy, channel capacity

A stored bit carries at most one shannon, so there is no fixed conversion between the two.[5] It carries exactly one shannon only when its two values are equally likely.[2]

How hardware stores a bit

Any physical thing with two stable states that can be told apart can hold a bit. Shannon gave a relay and a flip-flop circuit as examples.[2]

Voltage levels

In digital circuits, a bit is a voltage on a wire, read as one of two ranges rather than as an exact value. In positive logic, a voltage in the higher range means 1 and a voltage in the lower range means 0.[6] These ranges are called logic levels.

For a TTL-compatible input, a voltage of at least 2 V reads as 1, and a voltage of at most 0.8 V reads as 0.[6] Voltages between these limits are not guaranteed to read as either value.

Logic voltage bands for a TTL-compatible input TTL-compatible input, positive logic Supply voltage 2 V 0.8 V 0 V Reads as 1 (high) Not guaranteed Reads as 0 (low) 1 1 0 0 0 VIH min = 2 V VIL max = 0.8 V Time
A TTL-compatible input in positive logic reads any voltage below VILV_{IL} max =0.8= 0.8 V as 0 and any voltage above VIHV_{IH} min =2= 2 V as 1. Between the two thresholds the result is not guaranteed, so a clean digital signal stays inside the outer bands and crosses the middle band only during fast transitions.

Memory cells

Each type of computer memory holds a bit in a different physical form.

Memory How one bit is held Note
SRAM Two inverters wired back to back, each holding the other in one of two states; the standard cell has six transistors Must stay connected to power[7]
DRAM Charge on a tiny capacitor, reached through one transistor Charge leaks away; standards require it to last at least 64 ms[7]
Flash Charge stored on an insulated floating gate Keeps data without power[7]
Hard disk A tiny area of the disk surface magnetized one way or the other Each bit covers about 100 magnetic grains[8]

In older hard disks, the magnetization pointed along the track. In perpendicular recording, it points up or down, at right angles to the disk surface.[8]

How memory stores one bit: a DRAM cell and perpendicular hard disk recording DRAM cell bit line word line transistor capacitor plate charged discharged two states = two bit values Hard disk (perpendicular recording) track direction magnetized down magnetized up one bit recording layer soft magnetic underlayer about 100 grains per bit
Two ways memory holds one bit. A DRAM cell stores it as charge on a capacitor reached through one transistor, and a perpendicular hard disk stores it as the up or down magnetization of a small region of grains in the recording layer.

Cells with more than two states

A cell that can be set to more than two states stores more than one bit. A device with nn possible states has an equivalent binary storage capacity of log⁡2n\log_2 n bits.[4] So a cell with four levels holds 2 bits, and a cell with eight levels holds 3 bits, as in multi-level cell flash memory.

Units and prefixes

The bit is one of several quantities of information and storage. Its symbol is bit, and one byte (symbol B) is 8 bits.[9] IEC 80000-13 notes that, as a count of storage slots, bit is not strictly a unit but is used like one.[4]

Byte has been used for sizes other than 8 bits in the past. The standard therefore recommends using the name only for 8 bits, which it also calls an octet (symbol o).[4]

Decimal and binary prefixes

Bits and bytes take either SI prefixes, which step by powers of 10, or binary prefixes, which step by powers of 2.[4][9]

Name Symbol Size
kilobit kbit 10310^3 bit = 1,000 bit
kibibit Kibit 2102^{10} bit = 1,024 bit
megabyte MB 10610^6 B = 1,000,000 B
mebibyte MiB 2202^{20} B = 1,048,576 B
gigabyte GB 10910^9 B = 1,000,000,000 B
gibibyte GiB 2302^{30} B = 1,073,741,824 B

The IEC first adopted the binary prefixes in an amendment to its standard IEC 60027-2, published in January 1999.[9] Before then, kilo often meant 1,024 in computing. A megabyte could mean 1,000,000 bytes, 1,048,576 bytes, or 1,024,000 bytes, the size used on the "1.44 MB" floppy disk.[9]

Bit rate

The speed of a data link is its bit rate, measured in bits per second (bit/s).[4] Telecommunications engineers use megabit per second to mean 10610^6 bit/s.[9]

Bits as a measure of information

Information theory measures information by how unlikely an outcome is. The less likely an outcome, the more you learn when it happens.

Information content of one outcome

The information content of an outcome xx is defined as:[4]

I(x)=log⁡21p(x) ShI(x) = \log_2 \frac{1}{p(x)} \ \text{Sh}

Here p(x)p(x) is the probability of xx, with 0<p(x)≤10 < p(x) \le 1.

  • A fair coin landing heads has p=1/2p = 1/2, so it gives 1 Sh.
  • One of 8 equally likely outcomes has p=1/8p = 1/8, so it gives 3 Sh.
  • A certain outcome has p=1p = 1, so it gives 0 Sh.

Entropy

The entropy HH of a source is the average information content of its outcomes.[4] With base-2 logarithms, Shannon's formula gives it in bits per symbol:[2]

H=−∑i=1npilog⁡2piH = -\sum_{i=1}^{n} p_i \log_2 p_i

Here pip_i is the probability of outcome ii, nn is the number of outcomes, and the sum runs over outcomes with pi>0p_i > 0.

Shannon showed two key properties.[2]

  • H=0H = 0 only when one outcome is certain.
  • For nn outcomes, HH is largest when all are equally likely, and then H=log⁡2nH = \log_2 n. For two outcomes, this maximum is 1 bit.

One two-valued source

For a source with two outcomes of probability pp and 1−p1 - p, the entropy is the binary entropy function:[2]

H(p)=−plog⁡2p−(1−p)log⁡2(1−p)H(p) = -p \log_2 p - (1 - p) \log_2 (1 - p)

It peaks at 1 bit when p=1/2p = 1/2 and falls to 0 at p=0p = 0 and p=1p = 1.[2] A stored bit that is 1 nine times out of ten has H(0.9)H(0.9), about 0.47 Sh.

Binary entropy function 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Probability p of a 1 Fair coin: 1 bit Entropy H (bits) 0 0.5 1 p = 0.9: about 0.47 bit
The binary entropy function H(p)=−plog⁡2p−(1−p)log⁡2(1−p)H(p) = -p \log_2 p - (1-p) \log_2 (1-p) peaks at exactly 1 bit for a fair coin (p=0.5p = 0.5) and falls to 0 when the outcome is certain. A coin that lands 1 with probability p=0.9p = 0.9 carries only about 0.47 bit per toss.

Other units of information

Choosing the base of the logarithm chooses the unit. To convert a value from base aa to base bb, multiply it by log⁡ba\log_b a.[2]

Unit Log base Conversion
shannon (bit) 2 1 Sh ≈ 0.693 nat ≈ 0.301 Hart[4]
nat ee 1 nat ≈ 1.443 Sh ≈ 0.434 Hart
hartley (ban, decimal digit) 10 1 Hart ≈ 3.322 Sh ≈ 2.303 nat[4]
trit[1] 3 1 trit ≈ 1.585 Sh

Each value in the last column comes from log⁡ba\log_b a, such as log⁡23≈1.585\log_2 3 \approx 1.585.

Rates and capacity

Information rates are given in bits per second. A 32-symbol teletype that allows any sequence of symbols carries 5 bits per symbol, so at nn symbols per second its channel capacity is 5n5n bit/s.[2]

The energy cost of erasing a bit

Landauer's principle sets a lower limit on the heat released when a bit is erased. In 1961, Rolf Landauer argued that erasing information must release heat.[10] The limit for each bit lost is:

Q≥kTln⁡2Q \ge k T \ln 2

Here QQ is the heat released, kk is the Boltzmann constant, and TT is the temperature. At room temperature (300 K), this is about 3×10−213 \times 10^{-21} J.[10]

The limit applies to operations that are logically irreversible, meaning the input cannot be worked out from the output. Erasing a bit is one. So are logic gates such as AND, OR, NAND, and XOR, which map several inputs onto the same output.[10]

Measuring the limit

An experiment reported in 2012 used a silica bead 2 μm across, held by laser light in a trap with two wells, as a one-bit memory.[10] The bead in the left well meant 0, and in the right well meant 1.

  1. Lower the energy barrier between the two wells.
  2. Tilt the trap so the bead ends up in the right well.
  3. Raise the barrier again. The memory now reads 1, whatever it held before.

When each erasure was done slowly, the average heat released approached the Landauer limit.[10] The authors noted that silicon circuits then used about 1,000 times more energy per logic operation than this limit. They also noted that the principle's validity has been repeatedly questioned.[10]

Landauer erasure of one bit in a double-well potentialstored biteither stateleft well = 0right well = 11. lower barrier2. tilt3. raise barrierreads 1average heat released ≥ kT ln 2
Landauer erasure of a bit stored as a bead in a double-well potential U(x)U(x). Lowering the barrier, tilting the potential, and raising the barrier again resets the bit to 1 whatever its starting state, and releases an average heat of at least kTln⁡2kT \ln 2.

The principle explains the Maxwell's demon paradox. The demon must reset its memory, and this costs more entropy than the demon removed from the gas.[10]

Quantum bits

A Qubit is the quantum version of a bit. It is a two-state quantum system whose basis states ∣0⟩|0\rangle and ∣1⟩|1\rangle stand for the classical values 0 and 1.[11] Unlike a bit, a qubit can also be in a superposition of both:

∣ψ⟩=α∣0⟩+β∣1⟩|\psi\rangle = \alpha|0\rangle + \beta|1\rangle

Here α\alpha and β\beta are complex numbers. Measuring the qubit gives 0 with probability ∣α∣2|\alpha|^2 and 1 with probability ∣β∣2|\beta|^2, so these two values add to 1.[11]

A bit compared with a qubit bit qubit 0 1 |0⟩ |1⟩ |ψ⟩
A classical bit takes exactly one of two separate values, 0 or 1. A qubit's state ∣ψ⟩|\psi\rangle can point anywhere on a sphere whose poles are ∣0⟩|0\rangle and ∣1⟩|1\rangle.

Measurement changes the state, so α\alpha and β\beta cannot be read out directly.[11] Holevo's bound implies that one qubit cannot send more than one bit of classical information. If sender and receiver share entangled qubits, superdense coding can send two classical bits with one qubit.[11]

History

The idea of measuring information came before the word bit. Shannon credited Ralph Hartley with choosing the logarithm of the number of possible messages as the measure.[2][12]

Date Event
1928 Hartley's paper "Transmission of Information" looks for a measure of information in the number of possible symbol sequences.[12]
1945 Shannon's classified Bell Labs memo "A Mathematical Theory of Cryptography" uses the word alternative for a binary choice.[3]
1946 At a Bell Labs discussion, probably over lunch, Tukey asks, "Well, isn't the word obviously bit?" Brockway McMillan recalled this happening between July and late November.[3]
9 January 1947 Tukey's memo "Sequential Conversion of Continuous Data to Digital Data" defines bit as the binary counterpart of a decimal digit.[3]
July 1948 Shannon's "A Mathematical Theory of Communication" uses bits as the unit of information and credits the word to Tukey.[2]
1954 Marcel Golay proposes binit for a binary digit, keeping bit for the unit of information. The word did not catch on.[3]
2008 IEC 80000-13 lists the shannon, nat, and hartley as units of information content.[4]

McMillan pointed out that the two early uses differ. In Tukey's memo, a bit was a digit in a binary number. Shannon used the word to count independent two-way choices, a significant extension, and his paper was probably the first open publication to use bit as a technical term.[3]

Not everyone liked the word. The science writer Lancelot Hogben wrote in 1969 that it had "nothing but irresponsible vulgarity to commend it."[3]

References

  1. A bit on the bit, Nature Physics, 2016.
  2. A Mathematical Theory of Communication, C. E. Shannon, Bell System Technical Journal, 1948.
  3. Anecdotes: Origin of the Term Bit, Annals of the History of Computing, 1984.
  4. IEC 80000-13:2008 Quantities and units, Part 13: Information science and technology, IEC, 2008.
  5. Unit: Bit, QUDT.
  6. Understanding and Interpreting Standard-Logic Data Sheets, Texas Instruments, 2016.
  7. Memory technologies: Status and Perspectives, Sandia National Laboratories, 2014.
  8. Perpendicular Magnetic Recording Technology, Western Digital (HGST), 2007.
  9. Definitions of the SI units: The binary prefixes, NIST.
  10. Experimental verification of Landauer's principle linking information and thermodynamics, Nature, 2012.
  11. Quantum information representation and manipulation, H. Schomerus, Lancaster University.
  12. Transmission of Information, R. V. L. Hartley, Bell System Technical Journal, 1928.

Figure