Explain Sum-of-Weights Method for Hexadecimal to Decimal-00330
This subjective question is related to the book/course vu cs201 Introduction to Programming. It can also be found in vu cs201 Mid Term Solved Past Paper No. 2.
The hexadecimal (Hex) numbering system provides even shorter notation than octal. Hexadecimal uses a base of 16. It employs 16 digits: number 0 through 9, and letters A through F, with A through F substituted for numbers 10 to 15, respectively,
Hexadecimal numbers can be expressed as their decimal equivalents by using the sum of weights method, as shown in the following example:
Weight 210Hex. Number 1B7
7 x 160 = 7 x 1 = 7
11 x 161 = 11x 16 = 176
1 x 162 = 1 x 256 = 256
Sum of products = 43910
Like octal numbers, hexadecimal numbers can easily be converted to binary or vise versa. Conversion is accomplished by writing the 4-bit binary equivalent of the hex digit for each position, as illustrated in the following example:
Hex. Number 1 B 7Binary number 0001 1011 0111
Hexadecimal Binary Decimal
0 0000 0
1 0001 1
2 0010 2