0195136047.pdf

(Joyce) #1
6.1 DIGITAL BUILDING BLOCKS 273

as a string of any combination of the 8 digits. In order to convert octal to decimal, one follows the
same procedure as for converting from binary to decimal, that is, by expressing the octal number
in its polynomial form and evaluating that polynomial by using decimal-system addition.
For converting from decimal to octal form, one follows the same procedure as for conversion
from decimal to binary; but instead of dividing by 2 for the integer part, one divides by 8
to obtain the octal equivalent. Also, instead of multiplying by 2 for the fractional part, one
multiplies by 8 to obtain the fractional octal equivalent of the decimal fraction. However, it
is more common to convert from binary to octal and vice versa. Binary to octal conversion
is accomplished by grouping the binary number into groups of 3 bits each, starting from
the binary point and proceeding to the right as well as to the left; each group is then re-
placed by its octal equivalent. For example, (100101111011.01011) 2 is arranged as 100 101
111 011. 010 11 0


(note that a trailing 0 is added to complete the last group in the fractional

part). Replacing each group by its octal “decimal” equivalent, one obtains (4573.26) 8. The
conversion from octal to binary is done by replacing each octal digit with its 3-bit binary
equivalent.
Thehexadecimal number systemis a base-16 system which has 16 distinct symbols in the
set:{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}, where A is equivalent to 10, B to 11, , and F to 15.
A hexadecimal number is therefore expressed as a string of any combination of the 16 symbols.
To convert from hexadecimal to decimal, for example,


(2AB) 16 =^2 ×^162 +A×^161 +B×^160 =^2 ×^162 +^10 ×^161 +^11 ×^160 =(^683 ) 10
(.F8) 16 =F× 16 −^1 + 8 × 16 −^2 = 15 × 16 −^1 + 8 × 16 −^2 =( 0. 96875 ) 10

and


(2AB.F8) 16 =( 683. 96875 ) 10

The conversion from binary to hexadecimal is accomplished by grouping the binary number into
groups of 4 bits each, starting from the binary point and proceeding to the right as well as to the
left. Each group is then replaced by its hexadecimal equivalent. For example,


( 11101110100100. 100111 ) 2 ⇒0011 1011 1010 0100.1001 1100⇒(3BA4.9C) 16

The conversion from hexadecimal to binary is achieved by reversing this process. Because the
internal structures of most digital computers manipulate data in groups of 4-bit packets, the
hexadecimal system is used for representing binary data.
Since there is a need for decimal-to-binary conversion at the input of a digital device and
for binary-to-decimal conversion at the output of the device, from a user’s point of view, the
binary-coded-decimal (BCD) number systemis developed for resolving the interface problem. In
a BCD number each of the decimal digits is coded in binary using 4 bits. For example,


( 163. 25 ) 10 =( 10100011. 01 ) 2 =(0001 0110 0011.0010 0101)BCD

Table 6.1.1 shows the first 20 numbers in the decimal, binary, octal, hexadecimal, and BCD
systems.


Logic Blocks


Boolean algebra,using Boolean variables (which are binary variables that can assume only
one of two distinct values, true or false), is a mathematical system with logic notation used to
describe different interconnections of digital circuits. There are two basic types of digital building

Free download pdf