بسم الله الرحمن الرحيم |
|
|
|
||||||
|
|
|||||||
|
![]() |
![]() |
![]() |
Number base Conversion: Binary to Decimal It is very easy to convert from a binary number to a decimal number. Just like the decimal system, we multiply each digit by its weighted position, and add each of the weighted values together. For example, the binary value 1100 1010 represents: 1*2^7 + 1*2^6 + 0*2^5 + 0*2^4 + 1*2^3 + 0*2^2 + 1*2^1 + 0*2^0 =202 Decimal to Binary To convert decimal to binary is slightly more difficult. There are two methods, that may be used to convert from decimal to binary, repeated division by 2, and repeated subtraction by the weighted position value. Repeated Division By 2 For this method, divide the decimal number by 2, if the remainder is 0, on the side write down a 0. If the remainder is 1, write down a 1. This process is continued by dividing the quotient by 2 and dropping the previous remainder until the quotient is 0. The remainders are written beginning at the least significant digit (right). Consider the number 2671.
Binary to Hex Conversion It is easy to convert from an integer binary number to hex. This is accomplished by: 1. Break the binary number into 4-bit sections. 2. Convert the 4-bit binary number to its Hex equivalent. For example, the binary value 1010111110110010 will be written:
Hex to Binary Conversion It is also easy to convert from an integer hex number to binary. This is accomplished by:
For example, the hex value 0AFB2 will be written:
This yields the binary number 1010111110110010 or 1010 1111 1011 0010 in our more readable format.
Hex to Decimal Conversion To convert from Hex to Decimal, multiply the value in each position by its hex weight and add each value. Using the value from the previous example, 0AFB2H, we would expect to obtain the decimal value 44978.
40960 + 3840 + 176 + 2 = 44978
Decimal to Hex Conversion To convert decimal to hex is slightly more difficult. The typical method to convert from decimal to hex is repeated division by 16. While we may also use repeated subtraction by the weighted position value, it is more difficult for large decimal numbers.
Binary to Octal Conversion It is easy to convert from an integer binary number to octal. This is accomplished by: 1. Break the binary number into 3-bit sections from the LSB to the MSB. 2. Convert the 3-bit binary number to its octal equivalent. For example, the binary value 1010111110110010 will be written:
Octal to Binary Conversion It is also easy to convert from an integer octal number to binary. This is accomplished by: 1. Convert the decimal number to its 3-bit binary equivalent. 2. Combine the 3-bit sections by removing the spaces. For example, the octal value 127662 will be written:
This yields the binary number 001010111110110010 or 00 1010 1111 1011 0010 in our more readable format |
- Unconventional Number System - Additive & Non-additive Multiplier - Counters |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||