Conversion of Units
Conversion of Units
Binary To Decimal:
Binary is a base-2 number system, while decimal is a base-10 number
system.
To convert a binary number to decimal, follow these steps:
Write down the binary number you want to convert.
Start from the right (the least significant bit) and assign each digit a
positional value, starting with 2^0 and doubling the exponent for each
digit as you move to the left.
Multiply each binary digit by its corresponding positional value.
Sum up all the results from step 3 to get the decimal equivalent.
Here's a step-by-step example using the binary number 1101:
Binary number: 1101
Assign positional values from right to left: 2^0, 2^1, 2^2, 2^3
Multiply each binary digit by its positional value:
1 * 2^0 = 1
0 * 2^1 = 0
1 * 2^2 = 4
1 * 2^3 = 8
Sum up the results: 1 + 0 + 4 + 8 = 13
So, the binary number 1101 is equivalent to the decimal number 13.
Decimal To Binary
Start with the decimal number you want to convert.
Divide the decimal number by 2.
Write down the remainder (either 0 or 1) as the rightmost digit of your
binary representation.
Continue dividing the quotient from the previous step by 2 and writing
down the remainders until the quotient becomes 0.
Your binary representation will consist of these remainders, read from
right to left.
Let's illustrate this with an example, converting the decimal number 25
to binary:
Start with the decimal number 25.
Divide 25 by 2: 25 ÷ 2 = 12 with a remainder of 1.
Write down the remainder as the rightmost digit: 1.
Divide the quotient (12) by 2: 12 ÷ 2 = 6 with a remainder of 0.
Write down the remainder: 01.
Divide the new quotient (6) by 2: 6 ÷ 2 = 3 with a remainder of 0.
Write down the remainder: 001.
Divide the new quotient (3) by 2: 3 ÷ 2 = 1 with a remainder of 1.
Write down the remainder: 1001.
Finally, divide the last quotient (1) by 2: 1 ÷ 2 = 0 with a remainder of 1.
Write down the remainder: 11001.
So, the decimal number 25 is equivalent to the binary number 11001.
Binary To Hexadecimal:
Hexadecimal is a base-16 number system, and binary is a base-2
number system. To convert binary to hexadecimal, you can group the
binary digits into sets of four, starting from the rightmost digit, and
then convert each group into its hexadecimal equivalent. Here's how
you can do it:
Start with the binary number you want to convert.
Group the binary digits into sets of four from right to left. If there are
not enough digits to make a group of four, pad with zeros on the left.
Convert each group of four binary digits into its hexadecimal
equivalent.
Write down the hexadecimal values for each group from step 3, in
order, to form the hexadecimal representation.
Here's an example using the binary number 110110101010:
Binary number: 110110101010
Group into sets of four: 0011 0110 1010 10
Convert each group into hexadecimal:
0011 = 3 in hexadecimal.
0110 = 6 in hexadecimal.
1010 = A in hexadecimal.
10 = 2 in hexadecimal.
Write down the hexadecimal values in order: 361A2.
So, the binary number 110110101010 is equivalent to the hexadecimal
number 361A2.
Hexadecimal To Binary
Since hexadecimal is a base-16 number system, and binary is a base-2
number system, you can convert each hexadecimal digit into its binary
equivalent. Here's how to do it:
Write down the hexadecimal number you want to convert.
Convert each hexadecimal digit into its 4-bit binary representation.
Here's a table to help you with the conversions:
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Decimal To Hexadecimal:
Hexadecimal is a base-16 number system, and decimal is a base-10
number system. To convert a decimal number to hexadecimal, follow
these steps:
Start with the decimal number you want to convert.
Divide the decimal number by 16.
Write down the remainder (which will be a hexadecimal digit) as the
least significant digit on the right.
Divide the quotient from step 2 by 16 and repeat steps 3 and 4 until the
quotient becomes 0.
Write down the hexadecimal digits you obtained in reverse order (from
right to left) to get the hexadecimal representation.
Here's an example using the decimal number 255:
Decimal number: 255
Divide 255 by 16: 255 ÷ 16 = 15 with a remainder of 15.
Write down the remainder as the least significant digit: F (in
hexadecimal).
Divide 15 by 16: 15 ÷ 16 = 0 with a remainder of 15.
Write down the remainder as the next hexadecimal digit: F.
Since the quotient is now 0, we stop.
So, the decimal number 255 is equivalent to the hexadecimal number
FF.
Here's another example using the decimal number 512:
Decimal number: 512
Divide 512 by 16: 512 ÷ 16 = 32 with a remainder of 0.
Write down the remainder as the least significant digit: 0 (in
hexadecimal).
Divide 32 by 16: 32 ÷ 16 = 2 with a remainder of 0.
Write down the remainder as the next hexadecimal digit: 0.
Divide 2 by 16: 2 ÷ 16 = 0 with a remainder of 2.
Write down the remainder as the next hexadecimal digit: 2.
Since the quotient is now 0, we stop.
So, the decimal number 512 is equivalent to the hexadecimal number
200.
Hexadecimal To Decimal:
Start with the hexadecimal number you want to convert.
Write down the positional values for each digit in the hexadecimal
number, starting from the right and increasing by powers of 16 (16^0,
16^1, 16^2, and so on).
Replace each hexadecimal digit with its equivalent decimal value.
Here's a conversion table:
Hexadecimal: 0 1 2 3 4 5 6 7 8 9 A B C D E F
Decimal: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15