Skip to content
BetterDL

Bit

Also called: binary digit, bits

A binary digit: a single 0 or 1, the smallest unit of information a digital circuit stores. n bits can form 2ⁿ different patterns.

A bit (short for binary digit) is one 0 or 1. It's the smallest piece of information there is: the answer to a single yes/no question.

In hardware a bit is a wire or a storage cell that is either low (0) or high (1). Everything else is built from groups of bits:

  • 4 bits make a nibble, which is one hex digit
  • 8 bits make a byte
  • a number in a register is a fixed group of bits, such as 8, 16, 32 or 64

Each extra bit doubles the number of patterns, because every old pattern can be followed by a 0 or a 1. So n bits give 2ⁿ patterns. As unsigned numbers, those patterns cover 0 to 2ⁿ − 1.

Bits in a number are named by position. Bit 0 is the rightmost, the LSB. The leftmost is the MSB. A bit's weight is 2 raised to its position number.

A bit has no meaning on its own. 1 might mean the number one, "true", "light on", or the minus sign of a twos complement number. The format you choose decides.

1
16
0
8
1
4
1
2
0
1

Worked example

Example

How many patterns do 5 bits make?

Count the choices bit by bit.

  1. 1.

    Each bit has 2 choices.

  2. 2.

    5 bits: 2 × 2 × 2 × 2 × 2 = 2⁵ = 32 patterns.

  3. 3.

    As unsigned numbers they run from 00000 (0) to 11111 (31).

  4. 4.

    The count is 32 but the largest value is 31, because 0 uses up one pattern.

Common mistakes

  • Confusing the number of patterns (2ⁿ) with the largest unsigned value (2ⁿ − 1).

  • Thinking 8 bits can hold 256. The largest 8-bit unsigned value is 255.

  • Mixing up bits and bytes. A byte is 8 bits. Network speeds are usually quoted in bits, file sizes in bytes.

Practice Bit

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Bit is taught in Number Systems.