In our everyday lives, we use the decimal number system known as base 10. This is an example of a positional number system. Computer science and engineering use other systems, such as binary and hexadecimal numbers, for various purposes.
Binary is a base-2 numerical system that uses only two symbols, 0 and 1, to represent numbers. Binary is used in electronic computer systems because they can be effectively mapped onto real electronic 'switches', which form the bases for modern computation.
Hexadecimal is a base-16 numerical system that uses the numbers 0 to 9 and the characters A to F to represent the values 10-15. Hexadecimal is used to store large numbers with fewer characters than binary and decimal, making it desirable in particular computational processes.
Calculation
This calculator is designed to convert decimal numbers from 0 to 1023 into binary equivalents. Since the calculator uses a 10-bit representation, the highest hexadecimal value that can be inputted is 3FF.
Equivalent decimal value
Equivalent Binary Value
Explanation
So how do we convert between the different systems?
To understand how decimal, binary and hexadecimal values it is pivotal to understand the underlying principles behind their notation.
Take the decimal system, for example, specifically the number 2304. If we break this down into its powers of 10, we can observe each digit as a weighted value of a 10th power.
2304=(2)∗103+(3)∗102+(0)∗101+(4)∗100=2000+300+0+4 We can perform this same step with each digit in a binary number, as each digit represents a power of 2. If we take a binary number, say 100100000000, we can break it down into its constituent parts and better understand how binary numbers function.
100100000000=(1)∗211+(0)∗210+(0)∗29+(1)∗28+(0)∗27+(0)∗26+(0)∗25+(0)∗24+(0)∗23+(0)∗22+(0)∗21+(0)∗20=211+28=2048+256=2304(decimal) As is the case with decimal and binary, this base-16 number system essentially entails that each digit or character corresponds with a power of 16. If we take a hexadecimal number, say 900, we can break it down again into a set of constituent components.
900=(9)∗162+(0)∗161+(0)∗160=(9∗256)+(0∗16)+(0∗1)=2304(decimal) - Hexadecimal numbers can be tricky, as A-F represents 10 through 15.
- The following table will help with any conversion between the number systems.
Converting Hexadecimal to Binary
Converting from hexadecimal to binary can be achieved using the above table. However, for larger numbers, this proves more difficult, and thus we will highlight a simple method for achieving conversion.
This method will involve converting from hexadecimal to decimal, then from decimal to binary. Let us use an example and explain the process simultaneously. Let's take the hexadecimal number 2D4.
- First, we must convert hexadecimal to decimal:
2D4=(2)∗162+(12)∗161+(4)∗160=708(decimal) - Next, we must employ the following method to convert to binary:
We will continually divide the decimal number by two until we reach 0, using the remainder to construct the binary number with the first remainder as the least significant bit and the last remainder as the most significant bit.
708/2=354r0354/2=177r0177/2=88r188/2=44r044/2=22r022/2=11r011/2=5r15/2=2r12/2=1r01/2=0r1 Now we have our equivalent binary number: 1011 0001 00
Details on the conversion
The calculator at the top of this page is designed to convert decimal numbers from 0 to 1023 into binary equivalents. Since the calculator uses a 10-bit representation, the highest hexadecimal value that can be inputted is 3FF.
To convert a decimal value that requires less than 10 bits (less than 512), you can find the last non-zero bit when reading the binary representation vertically from "Remainder_b1" to "Remainder_b10." This last non-zero bit will be the leading 1 in the binary representation.
It's important to note that the binary numbers 01001 and 1001 actually represent the same unsigned binary value. The leading 0 in the former case is discarded during the conversion process.
By following these steps, using this calculator, you can accurately convert decimal values to their binary equivalents! Here's a detailed breakdown of how this works (control the hex input from the top of the page).
Binary value1
:1,111,110,000.00
Conclusion
In this article, we have covered the fundamental principles behind decimal (base 10), binary (base 2) and hexadecimal (base 16) positional number systems.
We highlighted how to convert from binary and hexadecimal to a decimal number as well as conversion from a hexadecimal number to a binary number.
Developing a concrete understanding of these number systems as well as how they relate to each other is a foundational building block for building and developing modern digital systems.