Skip to content

Bit

A bit is the fundamental unit of information. It represents a choice between two values: usually written as 0 and 1.

In computers, a bit represents an on-off state, and we can combine multiple bits to make larger units of information.

bits can represent different values.

For example:

  • 1 bit can represent 2 values: 0 or 1.
  • 2 bits can represent 4 values: 00, 01, 10, or 11.
  • 3 bits can represent 8 values: 000, 001, 010, 011, 100, 101, 110, or 111.
  • 4 bits can represent 16 values: 0000 to 1111.
  • And so on.

This is because each bit can be in one of two states, and the total number of combinations is .

We can also go in reverse (assuming we know how to calculate logarithms):

  • To represent different values, we need at least bits.
  • For example:
    • To represent 32 values, we need at least bits.
    • To represent a full RGB color (16,777,216 values), we need at least bits. (that’s why it’s called “24-bit color”).
  • Most systems use a 64-bit architecture nowadays, meaning they process data in chunks of 64 bits at a time.
  • Another common size is 32-bit, which was widely used in older systems and in old windows programs which are still using ancient technology - typical windows ;)