Difference between binary octal decimal hexadecimal numbering systems
There are infinite ways to represent a number. The four commonly associated with modern computers and digital electronics are: Decimal base 10 is the way most human beings represent numbers. Decimal is sometimes abbreviated as dec.
Binary base 2 is the natural way most digital circuits represent and manipulate numbers. Binary numbers are sometimes represented by preceding the value with '0b', as in 0b Binary is sometimes abbreviated as bin. Octal base 8 was previously a popular choice for representing digital circuit numbers in a form that is more compact than binary.
Octal is sometimes abbreviated as oct. Hexadecimal base 16 is currently the most popular choice for representing digital circuit numbers in a form that is more compact than binary.
Hexadecimal numbers are sometimes represented by preceding the value with '0x', as in 0x1B Hexadecimal is sometimes abbreviated as hex. All four number systems are equally capable of representing any number. Furthermore, a number can be perfectly converted between the various number systems without any loss of numeric value. At first blush, it seems like using any number system other than human-centric decimal is complicated and unnecessary.
Furthermore, a number can be perfectly converted between the various number systems without any loss of numeric value. At first blush, it seems like using any number system other than human-centric decimal is complicated and unnecessary. However, since the job of electrical and software engineers is to work with digital circuits, engineers require number systems that can best transfer information between the human world and the digital circuit world.
It turns out that the way in which a number is represented can make it easier for the engineer to perceive the meaning of the number as it applies to a digital circuit. In other words, the appropriate number system can actually make things less complicated. Almost all modern digital circuits are based on two-state switches. The switches are either on or off.
Because the fundamental information element of digital circuits has two states, it is most naturally represented by a number system where each individual digit has two states: For example, switches that are 'on' are represented by '1' and switches that are 'off' are represented by '0'. It is easy to instantly comprehend the values of 8 switches represented in binary as It is also easy to build a circuit to display each switch state in binary, by having an LED lit or unlit for each binary digit.
As digital circuits grew more complex, a more compact form of representing circuit information became necessary. That means three binary digits convert neatly into one octal digit. That means four binary digits convert neatly into one hexadecimal digit. Unfortunately, decimal base 10 is not a whole power of 2.