We know a regular computer basically only knows two states and that we name these states 0 and 1 respectively. This seems arbitrary, we could name them "a" and "b", or even 3 and 4. Is there a reason for the convention of naming them 0 and 1 ?
It most certainly is not arbitrary. Computing is rooted in mathematics. Binary notation in mathematics is also known as base-2.
Base-10 gives us 0-9 digits. Base-8 (octal) uses 0-7, and base-16 (hexadecimal) use 0-9 and a-f to represent the extra six digits not present in decimal notation.
The thing is, no matter what base you're using, zero is always zero, and one is always one. So, once you're using base-2 notation, you're pretty much resorting to 0 and 1.
The very earliest computers were actually decimal - used purely for calculations. Then mathematics started to incorporate logic, and computing theory really think of, and thanks to things like Turing completeness, and transistor states (on or off), computer scientists realised that true/false logic and base-2 mathematics were the best way to achieve the general purpose machines we use now.
It's not really true that they are (always) named
1. It depends on your point of view.
If you're dealing with numeric values, the computer does it in base-2, having the two digits named
1. And as numeric values make for very important computer applications, this naming is indeed very popular.
But a single bit can also stand for a boolean value
true, often abbreviated as
From an electrical engineering point of view, a bit is represented by one of two voltage levels, being
Low, abbreviated as
L. And the mapping from H/L to T/F can come in both vesions. The natural mapping is that H stands for 1 or T, and L for 0 or F. But sometimes the hardware designers choose to make L mean the active (true) state of the signal, and H the inactive (false) state: that's called "active-low".
Since machine-code is tagged here, I think it's because you can do number computation based. It's easier to see when you have more than one states to operate on, e.g. a series of 0s & 1s. If you use As & Bs, you can have AA and BB. But it's not clear what operations can you do on whatever represented by those states and you'd probably want to convert them into numbers to reason about them.
On the other hand, if you have 10 and 11, it's very intuitive to do base-2 arithmetic & logical operations on them.
Another way to see it, base-2 is used because the hardware is based on 2 states. It's not hard to imagine (you can emulate in software) to build a machine that can have 3 states that can do base-3 arithmetic on it. Once the exercise is done, you see the cost & benefit of non base-2 systems.