446 Computer Architecture and Organization
As the last obtained quotient is less than 2, we terminate our successive division by two procedure
and place this 1 at the left of the binary digits obtained so far. Thus, we get the binary equivalent of deci-
mal 19 as 10011. This may be veri ed from the Table A.1. Note that, similar to decimal numbers, we
may keep continue to place any number of 0s at the left of any binary number, without altering its value.
A.6.2 Binary to Decimal
We may directly use Eq. A.3 to convert any binary number to its decimal equivalent. Note that the pow-
ers of 2 must be carefully arranged as per its relevant place. Just for the sake of example, we take the just
converted binary equivalent of decimal 19, which is 10011 and try to convert it to its decimal equivalent
using Eq. A.3. We would obtain the following form
1 × 2
4
+ 0 × 2
3
+ 0 × 2
2
+ 1 × 2
1
+ 1 × 2
0
= 16 + 0 + 0 + 2 + 1
= 1 9
A.6.3 Binary to Hexadecimal
To convert from binary to hexadecimal notation, we take the binary digits in groups of four digits, start-
ing from the right-most side of the given binary number, and convert that group of four binary numbers
to its hexadecimal equivalent, using Table A.1. As an example case, we again take the binary number
10011, to convert it to its hexadecimal equivalent.
To start with, we take the right-most group of four binary digits, i.e., 0011 and using Table A.1, we nd
that its hexadecimal equivalent is 3. This 3, forms the right-most digit of our hexadecimal conversion.
The next group of four binary digits would be 0001 (we may place any number of 0s at left), which,
when converted to hex, would also be 1. Therefore, our hexadecimal conversion of 10011 in binary
becomes 13 (in hexadecimal). Table A.1 may be used to verify our conversion.
A.6.4 Hexadecimal to Binary
To convert from hexadecimal to its binary equivalent, we take each hexadecimal digit and convert it to
its binary equivalent using Table A.1. As a matter of fact, the procedure is just the reverse of the binary
to hexadecimal conversion. For example, if we take the hexadecimal number 13, then the conversion
of hexadecimal 1 would be 0001 in binary and conversion of hexadecimal 3 would be 0011 in binary.
Therefore, the binary equivalent of hexadecimal 13 would be 0001 0011, which may also be rewritten
as 10011.
SUMMARY
Decimal, binary, hexadecimal and octal number systems are explained in this Appendix. In all these
number systems, the weightage of any digit depends upon its relative place. This weightage is obtained
by a base raised to a power. The power is dependent upon the relative place of the digit. The base is
dependent upon the number system. For decimal number system the base is 10, while for binary num-
ber system the base is 2. For hexadecimal and octal number systems the base is 16 and 8, respectively.
Conversion techniques from one number system to another are also discussed.
Z01_GHOS1557_01_SE_C16_App_A.indd 446Z01_GHOS1557_01_SE_C16_App_A.indd 446 4/29/11 5:39 PM4/29/11 5:39 PM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.10.32