Computers store information using bits. A bit (short for "binary digit") stores either the value $\texttt{0}$ or $\texttt{1}$.
What fits in a bit?
A single bit can only represent two different values. That's not very much, but that's still enough to represent any two-valued state.
Is a lightbulb on or off?
State | Bit
- | - | -
[[โ image 2]] | $\texttt{0}$
[[โ image 6]] | $\texttt{1}$
Is a button enabled or disabled?
State | Bit
- | - | -
[[โ image 12]] | $\texttt{0}$
[[โ image 15]] | $\texttt{1}$
Is the current time AM or PM?
State | Bit
- | - | -
[[โ image 19]] | $\texttt{0}$
[[โ image 21]] | $\texttt{1}$
[[โ graded-group 1]]
Sequences of bits
Computers use multiple bits to represent data that is more complex than a simple on/off value.
A sequence of two bits can represent four ($2^2$) distinct values:
$\texttt{0}\texttt{0}$, $\texttt{0}\texttt{1}$, $\texttt{10}$, $\texttt{11}$
A sequence of three bits can represent eight ($2^3$) different values:
$\texttt{0}\texttt{0}\texttt{0}$, $\texttt{0}\texttt{0}\texttt{1}$, $\texttt{0}\texttt{10}$, $\texttt{0}\texttt{11}$, $\texttt{10}\texttt{0}$, $\texttt{101}$, $\texttt{110}$, $\texttt{111}$
A sequence can represent many things: a number, a character, a pixel. Plus, the same sequence can represent different types of data in different contexts. The sequence $\texttt{10}\texttt{0}\texttt{0}\texttt{0}\texttt{11}$ could represent $67$ in a calculator application while also representing the letter "C" in a text file. Learn more in our lessons on Binary numbers and Storing text in binary
[[โ graded-group 1]]
Physical storage
Computers typically store bits using electromechanical transistors which can map electrical signals to either an on or off state. Learn more in our article From electricity to bits or this video on how transistors work.