You are on page 1of 39

Digital Logic Design

V Samuel Susan
Chapter 1
⚫ 1.1 Digital Systems
⚫ 1.2 Binary Numbers
⚫ 1.3 Number Base Conversions
⚫ 1.4 Octal and Hexadecimal Numbers
⚫ 1.5 Complements Sus
⚫ Sa m
1.6 Signed BinaryVNumbers
⚫ 1.7 Binary Codes
⚫ 1.8 Binary Storage and Registers
⚫ 1.9 Binary Logic
1.1 DIGITAL SYSTEMS
⚫ Digital systems have such a prominent role in everyday life
that we refer to the present technological period as the digital
age. These devices have graphical user interfaces (GUIs),
which enable them to execute commands that appear to the
Sus
user to be simple, but which, in fact, involve precise execution
Sam
of a sequence of complex internal instructions. These devices
V
have a special-purpose digital computer embedded within
them. It can follow a sequence of instructions, called a
program, that operates on given data. Because of this
flexibility, general-purpose digital computers can perform a
variety of information-processing tasks that range over a wide
spectrum of applications.
Sus
Sam
V
Number system
Name Base Digits
Binary 2 0,1
Decimal 10 0 -9
Octal 8 0-7
Hexadecimal 16 0-9, A-F

Sus
Sam
V
Sus
Sam
V
1.2 Binary Numbers
Each digit in binary number represents the value of powers
of 2 from LSB to MSB.
2n-1+ ..... 22 + 21 + 20+ 2-1 + 2-2 ......

Sus
Sam
V
128 + 64 + 0 + 0 + 8 + 0 + 2 + 0 = 20
2
⚫ What is the largest binary number that can be expressed
with 16 bits? What are the equivalent decimal and
hexadecimal numbers?

(1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1)2
Sus
Sam
V
Base ‘r’ Number and its Decimal Equivalent
⚫ A number expressed in a base-r system has coefficients
multiplied by powers of r:
an .rn + an-1.r n-1 + .. + a2 .r2 + a1. r + a0 + a-1 . r-1 + a-2 . r-2 + .. + a-m.r-m

Sus
Sam
V
Number Base Conversions:
⚫ Decimal to Binary:
(99)10 = ( ? )2
99/2= 49 1 (rem)
Sus
49/2=24 1
24/2=12 0 V Sam
12/2=6 0
6/2=3 0
3/2=1 1
⚫ ( 1100011)2
Different base to Decimal
⚫ Base 5 to Decimal • Hexadecimal to
(142)5 =( ?)10
Decimal
1x 5 2 + 4x 51 + 2 x50
(1AF) 16 =(? )10
25+ 20+ 2= (47)10
1x162 + 10x16 + 15
256 + 160 + 15
⚫ Base 12 to Decimal
431
(179)12 =(?)10

Sus
1X12 2 + 7X12 + 9

m
144+84 +9 =237

⚫ Base 7 to Decimal V Sa
23567 =(?)10
2x7 3 + 3x 72 + 5x7 +6
686+147+ 35+ 6= 874
Conversion from base ’x’ to ‘y’

(345)8 =( ?)11
(345)8=(....)10 =( ?)11
3x64 + 4x8 + 5= (229)10
Sus
229/11= 20 %11=V9Sam
20/11=1 %11=9
(199)11
Conversion of fractional part:

⚫ Binary to Decimal:
(10010.101)2 = ( .?.)10

Sus
1x24 + 0x23 + 0x22 + 1x21 + 0x20
16+ 0 + 0 + 2 + 0 =20
S a m
1x2-1 + 0x2-2 + 1x2-3 V
0.5 + 0 + 0.125 = 0.625
=20.625
⚫ Octal to Decimal:
(413.4)8 = (.?.)10
4x82 + 1x8 + 3 =267
4x8-1

Sus
4x0.125 = 0.5

Sam
=267.5 V
⚫ Decimal to Binary: ⚫ 0.375 x 2= 0.75
(89.375)10 = (.?.)2 0.75 x 2 = 1.5
89/2 = 44 %2= 1 0.5 x 2 = 1.0
44/2=22 %2=0
22/2=11 %2=0 0
11/2 =5 %2=1 1
5/2 = 2 %2=1 1
2/2= 1 %2=0
Sus(1011001.011)
=1011001
Sam
V
2
⚫ Decimal to Octal: ⚫ 0.375 x 8= 3.0
(89.375)10 = (.?.)8
89/8 = 11 %8= 1
11/8=1 %8=3

Sus
=131

Sam
=(131.3)8 V
Octal and Hexadecimal:
⚫ Binary Number: ⚫ Octal Number:
2n 2n-1... 22 21 20 Sus 8n 8n-1 ...82 81 80
Sam
Octal 0
V 1 2 3 4 5 6 7
Binary 000 001 010 011 100 101 110 111

⚫ Octal to Binary: ⚫ Binary to Octal:


(1101101)2 = (.?.)
(345)8 = (.?.)2
001 101 101
011 100 101 1 5 5
=(155)8
Sus
Sam
V
⚫ Hexadecimal to Binary
(1 A3)16 = (.?.)2
(0001 1010 0011)2

Binary to Hexadecimal
(1010011011)2 Sus
Sam
10 1001 1011
0010 1001 1011
V
=(29B)16
Complements:

Sus
Sam
V
Sus
Sam
V
Sus
Sam
V
Subtraction using complements
A - B = A + r’s B ( Complement)
● Binary number:
A-B = A+ 2’B
● Decimal number Sus
Sam
A-B = A + 10’B
V
A - B = A + (r-1)’s B +1
● Binary number:
A-B = A+ 1’B +1
● Decimal number
A-B = A + 9’B+1
Obtain the 1’s and 2’s complements of the following
binary numbers:
(a) 00010000 (b) 00000000
(c) 11011010 (d) 10101010
(e) 10000101 (f) 11111111.
Sus
Sam
Find the 9’s and the 10’s complement of the following
V
decimal numbers:
(a) 25,478,036 (b) 63, 325, 600
(c) 25,000,000 (d) 00,000,000.
Signed Binary numbers

Sus
Sam
V
Sus
Sam
V
Binary Codes:
● Binary Coded Decimal (BCD):

Sus
Sam
V
BCD Addition:

Sus
Sam
V
Other Decimal Codes

Sus
Sam
V
Represent the unsigned decimal numbers 791 and 658 in
BCD, and then show the steps necessary to form their sum.

Formulate a weighted binary code for the decimal digits,


using the following weights:

Sus
(a) * 6, 3, 1, 1
(b) 6, 4, 2, 1
Sam
V
Represent the decimal number 6,248 in (a) BCD, (b) excess-3
code, (c) 2421 code, and (d) a 6311 code.
Gray Code
The Gray code is used in applications in which the
normal sequence of binary numbers generated by the
hardware may produce an error or ambiguity during the
transition from one number toS u
thesnext. If binary
a m
numbers are used, a change, for example, from 0111 to
1000 may produceVanSintermediate erroneous number
1001 if the value of the rightmost bit takes longer to
change than do the values of the other three bits. This
could have serious consequences for the machine using
the information.
The Gray code eliminates this problem, since only one bit
changes its value during any transition between two
numbers.
Sus
Sam
V
ASCII code

Sus
Sam
V
Error Detecting Code
To detect errors in data communication and processing, an eighth bit is sometimes added
to the ASCII character to indicate its parity. A parity bit is an extra bit included with a message to
make the total number of 1’s either even or odd. Consider the following two characters and their
even and odd parity:

With even parity With odd parity

Sus
ASCII A = 1000001 01000001 11000001

m
ASCII T = 1010100 11010100 01010100

V Sa
In each case, we insert an extra bit in the leftmost position of the code to produce an even
number of 1’s in the character for even parity or an odd number of 1’s in the character for odd
parity. In general, one or the other parity is adopted, with even parity being more common.
The parity bit is helpful in detecting errors during the transmission of information from one
location to another. This function is handled by generating an even parity bit at the sending end
for each character. The eight-bit characters that include parity bits are transmitted to their
destination. If the parity of the received character is not even, then at least one bit has changed
value during the transmission. This method detects one, three, or any odd combination of errors
in each character that is transmitted. An even combination of errors, however, goes undetected,
and additional error detection codes may be needed to take Care of that possibility.
Binary Logic
Binary logic deals with variables that take on two discrete
values and with operations that assume logical meaning. The
two values the variables assume may be called by different
names (true and false, yes and no, etc.), it is convenient to
think in terms of bits and assign S usvalues 1 and 0.
the
S ofmbinary variables and a set of logical
a
V
Binary logic consists
operations. The variables are designated by letters of the
alphabet, such as A, B, C, x, y, z, etc., with each variable having
two and only two distinct possible values: 1 and 0. There are
three basic logical operations: AND, OR, and NOT. Each
operation produces a binary result, denoted by z
1. AND: This operation is represented by a dot or by the
absence of an operator. For example, x.y = z or xy = z is read “x
AND y is equal to z.” The logical operation AND is interpreted to
mean that z = 1 if and only if x = 1 and y = 1; otherwise z = 0.

2. OR: This operation is represented by a plus sign. For


Sus
example, x + y = z is read “x OR y is equal to z,” meaning that z
Sam
V
= 1 if x = 1 or if y = 1 or if both x = 1 and y = 1. If both x = 0 and
y = 0, then z = 0.

3. NOT: This operation is represented by a prime . For example,


x’ = z (or x = z ) is read “not x is equal to z,” meaning that z is
what x is not. In other words, if x = 1, then z = 0, but if x = 0,
then z = 1.
Sus
Sam
V
Sus
Sam
V
An qu on

You might also like