Professional Documents
Culture Documents
DLD Lec1
DLD Lec1
Lecture 1
Digital systems are characterized by signals restricted to two possible values which
are represented by an alphabet of only two characters, 0 and 1. Digital systems use
several number systems. Hence, this course will start by cons9idering the numerical
representations.
Decimal
Binary
Octal
Hexadecimal
Binary-coded decimal (BCD)
The binary system is the most natural to use in the digital system. However, other
number systems may be more convenient such as the decimal number systems. In
such cases, the numbers are manipulated within the number system in use but are
nevertheless, represented as binary numbers within the digital system.
Radix point convention is used to differentiate between fractions and mixed integer-
fraction numbers. The integer part of a number is located to the left of the radix point,
while its fraction appears to the right of the radix point. Consider the digit string
(67.354)10. The radix (decimal) point separates the number (67) from the fractional
part (354) where its numerical value is given by:
As it is clearly shown, just as the digits to the left of the radix point are the
coefficients of the polynomial of decreasing positive powers of the base 10, the digits
to the right of the radix point are the coefficients of a polynomial of increasing
negative powers of the base. This can be generalized to any number N of base r whose
integer part consists of n digits and whose fractional part consists of m digits.
remainder = (8)10=(8)16
remainder = (11)10=(B)16
remainder = (3)10=(3)16
Hence (15247)10 = (3B8F)16
integer part = 1
integer part = 1
integer part = 0
integer part = 0
integer part = 0
integer part = 0
integer part = 1
integer part = 0
As shown in this example, the process of converting a fraction might not terminate.
This means that, it might be impossible to exactly represent the fraction in a new base
with a finite number of digits, the number of digits retained after the radix depends on
how precise we want the conversion to be.
Since 8(=23) and 16(=24) are both powers of two, conversions between the binary,
octal, and hexadecimal number systems are simple. In fact, this relations implies that
each octal digit can be binary coded by three bits, while each hexadecimal digit can be
binary coded by four bits.
Table 1.1 Binary-coded octal
Decimal Binary Octal
0 000 0
1 001 1
2 010 2
3 011 3
4 100 4
5 101 5
6 110 6
7 111 7
To convert from binary to octal, the binary number is partitioned starting from the
radix point, into groups of three bits each. The octal digit corresponding to each group
is then assigned using the previous table. To convert from octal to binary, the process
is reversed. Then, the equivalent binary number is obtained by concatenating these
groups. For example, convert (110111010011)2 to octal.
To obtain the octal number we start from the least significant bit, partition the assign
number into groups of three bits each. Then, assign to each group the corresponding
octal digit, . Hence, the equivalent octal number is (6723)8. On the
other hand, consider an integer-fractional mixed number case (1101000101.01011)2.
To convert this number to octal, the number is partitioned into the integer and
fractional parts starting from the radix point. Then use the binary-octal coded table to
assign the corresponding octal digits, . The equivalent octal
number is (1505.26)8. Notice in the previous example that the leftmost group (of the
integer part) contains only one bit and the rightmost group (of the fractional part)
contains only two bits. However, each group must contain three bits in order to
achieve the octal representation. To “fill in” the groups, append leading zeros to the
integer part and trailing zeros to the fractional part. Adding leading or trailing zeros
does not change the values of the original number and serves only to facilitate the
conversion.
Binary to hexadecimal conversion are as easily obtained. Starting from the radix
point, the binary number is partitioned into groups of four bits (nibbles) each. Each
nibble is assigned its corresponding hexadecimal digit using the next table. To convert
from hexadecimal to binary, the process is reversed.