Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

Digital Logical Design

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.

1. Positional number System


A positional number system is characterized by a base or radix r, which is an integer
greater than 1, and a set of r digits. For example, if r = 10 or base 10, the decimal
number system composed of ten digits 0, 1,2,3,4,5,6,7,8,9. On the other hand, the
binary system is base 2 and is composed of two digits, 0 and 1. It should be noted that
the abbreviation of a binary digit is bit. The octal system is of base 8 and has eight
digits from 0 to 7. The hexadecimal system has a base 16 and is composed of 16
characters represented by symbols 0 through 9, A, B, C, D, E and F. In the
hexadecimal system, A stands for decimal 10, B for 11, C for 12, D for 13, E for 14,
and F for 15.
An integer, (N), can be represented by a finite sequence of digits concatenated to form
a digit string:
(N)r = (bn-1b n-2 ….b1b0)r
where each bi is an integer such that 0 ≤ bi ≤ r-1. The bi’s are the digits of the number
N, and n is referred to as the length of the string. For example the digit string (8B0E) 16
represents a hexadecimal number of length n = 4 and the value of each symbol cannot
exceed r-1 = 15 or be less than zero.
Each digit in the positional notation of an integer N has a special meaning depending
on its position. This is valid specially the leftmost digit b n-1 is referred to as the most
significant digit, and the rightmost digit b0 is called the least significant digit. In the
binary system, these are termed the most significant bit (msb) and least significant bit
(lsb), respectively. Generally, a bit string is referred as a word. However, some bit
strings have special names: a string of four bits is called nibble, a string with eight bits
is referred to as a byte. The numerical value of the integer represented by digit string
is given by the weighted sum
The weights are successive powers of r, and each digit is weighted corresponding to
its position in the digit string. The most significant digit weighs most and the least
significant digit weighs least.

1.1 Fractions and mixed integer-fraction numbers

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.

The numerical value of such number N

1.2 Base 10 (decimal) to base t conversion


There are various ways to convert numbers from one base system to another. The
most simple and straightforward method is that of repeated divisions for integers and
repeated multiplications for fractional. To convert a mixed integer-fraction number,
we split the process. Consider the conversion from base r integer (N)r to its equivalent
(M)t in base t. the conversion is accomplished by repeated divisions by t such that the
remainder after each step is one digit of the required base t number, while the quotient
is again divided by t. The remainder after the first division by t is the least significant
digit of (M)t. while the last remainder is the most significant digit of (M)t. Consider
the decimal number (15247)10 is to be converted into hexadecimal number

remainder = (15)10 = (F)16

remainder = (8)10=(8)16

remainder = (11)10=(B)16

remainder = (3)10=(3)16
Hence (15247)10 = (3B8F)16

To convert a base r fractional (.F)r to its equivalent (.E)t in base t, we repeatedly


multiply by t (instead of dividing by t). The integer part after each step is one digit of
the required base t fraction, which the remaining fraction is again multiplied by t. The
integer resulting from the first multiplication step is the most significant bit of (.E)t,
while the last integer is the most significant bit. For example, consider converting the
decimal number (0.761)10 to binary number

integer part = 1
integer part = 1
integer part = 0
integer part = 0
integer part = 0
integer part = 0
integer part = 1
integer part = 0

Hence, (0.761)10 = (0.11000010)2

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.

Convert (12A7C)16 to an octal number


Tip: this conversion is simplified by finding the decimal equivalent of the
hexadecimal number. Doing this, we get (12A7C) 16 = (76412)10. Now, converting the
decimal number into octal results in (12A7C)16 = (225174)8

1.3 Binary, Octal, and Hexadecimal Conversions

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.

Decimal Binary Hexadecimal


0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F

Convert (12A7F)16 to binary.

You might also like