Hardware Reference
In-Depth Information
Solution
a. 100101011001
2
5 1001,0101,1001
2
5 959
16
b. 1011010101010
2
5 1,0110,1010,1010
2
5 0001,0110,1010,1110
2
5 16AE
16
▲
B.8 Convert from Hexadecimal to Binary
To convert from hex to binary, simply convert each hex digit into its 4-bit binary equiva-
lent and delete the leading 0s from the resultant binary number.
Example B.8
▼
Convert the following hex numbers into binary:
a. 5CB
16
b. 2A6
16
Solution
a. 5CB
16
5 0101,1100,1011
2
5 101,1100,1011
2
b. 2A6
16
5 0010,1010,0110
2
5 10,1010,0110
2
▲
B.9 Specifying the Number Base
To facilitate the specification of the number base used in a number representation, we use
a notation that adds a suffix to a number to indicate the base used in the number representa-
tion. The suffixes for hex, binary, and octal are H (or h), B (or b), and O (or o, Q, q), respectively.
Decimal numbers do not use a suffix. For example,
10101011B or 10101011b
specifies the binary number 10101011
2
.
123O, 123o, 123q, or 123Q
specifies the octal number 123
8
.
A097H or A097h
refers to the hexadecimal number A097
16
.
3467
is a decimal number.
Hex numbers are also represented by adding the prefix 0x to the number. For example,
0x1000 stands for the hex number 1000
16
. In this text, we will mix the use of these two meth-
ods for hexadecimal numbers.
Search WWH ::
Custom Search