As only one bit changes at a time, the gray code is called as a unit distance code. Andrew Robinson explains how binary data is used when monitoring birds with a Raspberry Pi.
Adding these all up gives you the number in decimal.
Charles Babbage's Analytical Machine in and the Colossus used during the Second World War were operated using punched cards and tapes. This forms a binary switch.
For example, lowercase "a" is represented by as a bit string which is "97" in decimal. But Why Only Base 2? He believed that binary numbers were symbolic of the Christian idea of creatio ex nihilo or creation out of nothing. In the early days of computing, the only way to enter data into a computer was by flicking switches or by feeding in punched cards or punched paper tape.
The gray code is a cyclic code. Since computers work using binary, with data represented as 1s and 0s, both switches and punched holes were easily able to reflect these two states - 'on' to represent 1 and 'off' to represent 0; a hole to represent 1 and no hole to represent 0.
But this is not enough for communication between two computers because there we need many more symbols for communication. The relationships between the trigrams are represented in two arrangements, the primordial, "Earlier Heaven" or "Fuxi" bagua, and the manifested, "Later Heaven,"or "King Wen" bagua.
Modern software allows the end user to ignore this, but at the lowest levels of your computer, everything is represented by a binary electrical signal that registers in one of two states: on or off.