0% found this document useful (0 votes)
18 views117 pages

DLD Chapter1

The document provides an overview of Digital Logic Design, tracing its history from the invention of Boolean algebra by George Boole in 1850 to the development of modern microprocessors. It explains the differences between digital and analog systems, the significance of binary numbers, and the fundamental operations of binary arithmetic. Additionally, it covers the representation of signed numbers and the importance of digital logic in various applications, including computing and embedded systems.

Uploaded by

bekema
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views117 pages

DLD Chapter1

The document provides an overview of Digital Logic Design, tracing its history from the invention of Boolean algebra by George Boole in 1850 to the development of modern microprocessors. It explains the differences between digital and analog systems, the significance of binary numbers, and the fundamental operations of binary arithmetic. Additionally, it covers the representation of signed numbers and the importance of digital logic in various applications, including computing and embedded systems.

Uploaded by

bekema
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 117

Kibur College

Department of Computer science

Digital Logic Design


CHAPTER – I Introduction to Digital Logic Design
1
HOW DID IT ALL START?

 1850: George Boole invents Boolean algebra


HOW DID IT ALL START?

 1946: ENIAC, the first electronic


computer is developed
 18,000 vacuum tubes
 5,000 operations per second
 1,000 square feet
 It really cost a lot of power to turn on
the switch!
AND IT WENT ON…

 1947: Shockley, Brattain, and Bardeen invent the transistor


 Replaces vacuum tubes
 Enables integration of multiple devices into one package
 1956: They received the Nobel
Prize in Physics
AND IT WENT ON…

 1955: AT&T Bell Labs announced the


first fully transistorized computer,
 1958: The first 2D Integrated Circuit
(Kilby received the Nobel prize in
2000)
•Transistors, resistors and capacitors
on the same piece of semiconductor
•Interconnects between components is
not integrated
•Low connectivity between components
AND IT WENT ON…

 1971: Intel’s 4004 first microprocessor


• Maximum clock rate is 740 kHz
• Less than 100k instructions per
second
 2018: Intel’s Core i9 processor
• Maximum clock rate is 4.4 GHz
•18 cores
APPLICATIONS OF DIGITAL LOGIC DESIGN

I. Conventional computer design


 CPUs, busses, peripherals
II. Networking and communications
 Phones, modems, routers
III. Embedded products
 Cars
 Toys
 Appliances
 Entertainment devices: MP3 players, gaming consoles (PlayStation,
Xbox, etc…)
BUT WHAT IS THE MEANING OF DIGITAL LOGIC
DESIGN?
WHAT IS DIGITAL?
 Digital describes any system based on discontinuous data or events
 Computers are digital machines because at their most basic level they
can distinguish between just two values, 0s and 1s, or off and on
 There is no simple way to represent all the values in between, such as
0.25
 All data that a computer processes must be encoded digitally, as a
sequence of 0s and 1s
ANALOG VS. DIGITAL
 An analog signal is any variable signal continuous in both time and amplitude
(e.g. sound)

 Example:
A typical analog device is a clock in which the hands move continuously around
the face. Such a clock is capable of indicating every possible time of day. In
contrast, a digital watch is capable of representing only a finite number of
times (e.g. every tenth of a second)
WHY DIGITAL?
 Digital systems are easier to design and implement than
analog systems.
 Digital data can be processed and transmitted more efficiently
and reliably than analog.
 It can store huge amount of data in lesser space and with least
chance of error.
 Noise does not affect digital data as compare to analog signals
WHAT IS LOGIC DESIGN?

 Given a specification of a problem, an engineer needs to come up


with a way of solving it, choosing appropriately from a collection of
available components, while meeting, some criteria for size, cost or
power.
Digital Logic Design

 Digital logic design is a system in electrical and computer engineering that uses
simple number value to produce input and output operations.

 Digital logics are rooted in binary code. This system facilitates the design of
electronics circuits that convey information, including logic gates with functions
that include AND, OR and NOT commands.

 The value system translates input signals into specific output. These functions
facilitate computing, robotics, and other electronics applications.
Binary Digit
 Digital electronics involves circuits and system in which there are two types
possible states.

 These states are represented by two different voltage levels: HIGH and LOW.

 In digital systems such as computers; combinations of two states, called codes,


are used to represent numbers, symbols, alphabetic character and other types of
information.

 The two-state number system is called binary and its two digit are called Binary
Digit: 0 and 1.
Binary Digit

 Each of the Binary digit, 0 and 1, is called bit.


 In digital circuits, two different voltage levels are used to represent the two
bits.
 Generally; – 1 is represented by the higher voltage (HIGH) and – 0 is
represented by the lower voltage (LOW).
Logic Levels

 The voltage used to represent a 1 and 0 are logic levels.


 Ideally, one voltage level represents a HIGH and another voltage level represents a
LOW.
 In a practical digital circuit, however, a HIGH can be any voltage between a
specified minimum value and specified maximum value.
 Likewise for a LOW voltage levels.
 There can be no overlap between the accepted range of HIGH levels and the
accepted range of LOW levels.
DIGITAL LOGIC LEVELS

 Digital logic circuits are hardware components


that manipulate binary information (we call
these gates)
 A digital system is basically a black box with a
minimum of one input and one output
 Inside this box, are millions of switches called
transistors
 Transistors perform different functions
according to inputs
 In binary logic circuits there are only two levels:
0 and 1
Digital System
 A digital system is an arrangement of the individual logic functions
connected to perform a specified operation or produce a defined output.

 An example of a digital system is a computer, as shown in Figure in


basic block diagram form.

 A computer processes, transfers, and stores


data in digital form (1s and 0s).

 To make a complete system, the computer is interfaced with peripheral


devices such as a modem, a mouse, a keyboard, and a monitor
Example Of A Digital System

 Another example of a
digital system, shows
the traffic light
controller.
 All of the digital signals
that the system uses to
properly sequence the
traffic light are
internally generated,
making the controller a
type of finite state
machine.
Analog System

 An analog system is one that processes data in analog form only. One example is a
public address system, used to amplify sound so that it can be heard by a large
audience.
A Combination Digital And
Analog System
 The compact disk (CD) player is an example of a system in which both
digital and analog elements are used. The simplified block diagram in
Figure illustrates the basic system. music in digital form is stored on the
compact disk.
Review Exercise
1. Define analog.
2. Define digital.
3. Explain the difference between a digital quantity and an
analog quantity.
4. Give an example of a system that is analog and one that is a
combination of both digital and analog. Name a system that is
entirely digital.
5. List advantages of Digital over analog
Kibur College
Department of Computer science

Digital Logic Design


CHAPTER – II: Number System

26
Introduction to Numbering System
Decimal Numbers

 In the decimal number system each of the ten digits 0 through 9 represents a
certain quantity.
 The base(radix) of decimal numbers is 10.
 The position of each digit in a weight number system is assigned a weight
based on the base of the system.
 Powers of ten that increase from right to the column weights of decimal
numbers are left beginning with 10^0 , 10^1 , 10^2,10^3 ...
Decimal Numbers
 For fractional decimal numbers, the column weights are negative powers of ten
that decrease from left to right.
 Decimal numbers can be expressed as the sum of the products of each digit times
the column values for that digit.
Example
Binary Numbers

 The binary number system is another way to represent quantities.


 It have two digits: 0 and 1.
 so it is base 2 system.
Binary-to-decimal Conversion

 The decimal value of any binary number can be found by


adding the weights of all bits that are 1 and discarding the
weights of all bits that are 0
Class Exercise

1. What is the largest decimal number that can be represented


in
binary with eight bits?
2. Determine the weight of the 1 in the binary number 10000.

3. Convert the binary number 10111101.011 to decimal.


Decimal –To -Binary Conversion

1. Sum-of-Weights method
 To get the binary number for a given decimal number, find the
binary weights that add up to the decimal number.
Repeated Division-by-2 Method

 To get the binary number for a


given decimal number, divide
the decimal number by 2 until
the quotient is 0. remainders
form the binary number
Example
Exercise

 Convert decimal number 39 to binary.

41
Binary Arithmetic
 Binary arithmetic is essential in all digital computers and in many other
types of digital systems.
 To understand digital systems, you must know the basics of binary
addition, subtraction, multiplication, and division.
 This section provides an introduction that will be expanded in later
sections.

 After completing this section, you should be able to

 Add binary numbers


 Subtract binary numbers
 Multiply binary numbers
 Divide binary numbers
Binary Addition
 The four basic rules for adding binary digits (bits) are as
follows:
 0 + 0 = 0 Sum of 0 with a carry of 0
 0 + 1 = 1 Sum of 1 with a carry of 0
 1 + 0 = 1 Sum of 1 with a carry of 0
 1 + 1 = 10 Sum of 0 with a carry of 1

 In Binary 1 +1=10, Not The Decimal Digit 2.


Example
Binary Subtraction

 The four basic rules for subtracting bits are as follows


 0-0=0
 1-1=0
 1-0=1
 10 - 1 = 1 0 - 1 with a borrow of 1

45
Example

46
Example 2

47
Solution

48
Binary Multiplication

 The four basic rules for multiplying bits are as follows:


 0*0=0
 0*1=0
 1*0=0
 1*1=1

49
Example

50
Binary Division Example

 Division in binary follows the same


procedure as division in decimal.

51
Checkup
 1. Perform the following binary additions:
(a) 1101 + 1010
(b) 10111 + 01101
 2. Perform the following binary subtractions:
(a) 1101 - 0100
(b) 1001 - 0111
 Perform the indicated binary operations:
(a) 110 * 111
(b) 1100 , 011
52
1’S And 2’S Complements Of
Binary Numbers
 The 1’s complement and the 2’s complement of a binary number are important because
they permit the representation of negative numbers.
 The method of 2’s complement arithmetic is commonly used in computers to handle
negative numbers.
 After completing this section, you should be able to
 Convert a binary number to its 1’s complement
 Convert a binary number to its 2’s complement using either of two method

53
Finding the 1’s Complement

 The 1’s complement of a binary number is found


by changing all 1s to 0s and all 0s to 1s, as
illustrated below:

54
Finding the 2’s Complement

 The 2’s complement of a binary number is found by adding 1 to the LSB of the 1’s
complement.

55
Example

56
Signed Numbers
 Digital systems, such as the computer, must be able to handle both
positive and negative numbers.
 A signed binary number consists of both sign and magnitude
information.
 The sign indicates whether A number is positive or negative, and the
magnitude is the value of the number.
 There are three forms in which signed integer (whole) numbers can be
represented in binary:
 Sign-magnitude,
 1’s complement, and
 2’s complement.
 Of these, the 2’s complement is the most important and the57sign-
magnitude is the least used.
The Sign Bit
 The left-most bit in a signed binary number is the sign bit, which
tells you whether the number is positive or negative.
A 0 sign bit indicates A positive number, and A 1 sign
bit indicates A negative number.

58
Sign-magnitude Form
 When a signed binary number is represented in sign-magnitude, the left-
most bit is the sign bit and the remaining bits are the magnitude bits.
 The magnitude bits are in true (uncomplemented) binary for both positive
and negative numbers.
 For example, the decimal number +25 is expressed as an 8-bit signed
binary number using the sign-magnitude form as

59
Cont’d

 The decimal number -25 is expressed as


10011001
 Notice that the only difference between +25 and -25 is the sign bit because the magnitude
bits are in true binary for both positive and negative numbers.
 In the sign-magnitude form, a negative number has the same magnitude bits as
the corresponding positive number but the sign bit is a 1 rather than a zero

60
1’s Complement Form

 Positive numbers in 1’s complement form are represented the same way as the positive
sign-magnitude numbers.
 Negative numbers, however, are the 1’s complements of the corresponding positive numbers.
 For example, using eight bits, the decimal number -25 is
expressed as the 1’s complement of +25 (00011001) as 11100110
 The 1’s complement form, a negative number is the 1’s complement of the
corresponding positive number.

61
2’s Complement Form
 Positive numbers in 2’s complement form are represented the same way as in the sign
magnitude and 1’s complement forms.
 Negative numbers are the 2’s complements of the corresponding positive numbers.
 Again, using eight bits, let’s take decimal number -25 and express it as the 2’s complement of
+25 (00011001).
 Inverting each bit and adding 1, you get
-25 = 11100111
 in the 2’s complement form, a negative number is the 2’s complement of the corresponding
positive number

62
Arithmetic Operations With Signed
Numbers
 Addition
 The two numbers in an addition are the addend and the augend. The result is the sum.
There are four cases that can occur when two signed binary numbers are added.
1. Both numbers positive
2. Positive number with magnitude larger than negative number
3. Negative number with magnitude larger than positive number
4. Both numbers negative
 Let’s take one case at a time using 8-bit signed numbers as examples. The equivalent
decimal numbers are shown for reference.

63
64
65
Hexadecimal Numbers

 The hexadecimal number system has a base of sixteen; that is, it is composed of 16
numeric and alphabetic characters.
 Most digital systems process binary data in groups that are multiples of four bits,
making the hexadecimal number very convenient because each hexadecimal digit
represents a 4-bit binary number.

66
Hexadecimal
Numbers

67
Binary-to-Hexadecimal
Conversion
 Converting a binary number to hexadecimal is a
straightforward procedure.
 Simply break the binary number into 4-bit groups,
starting at the right-most bit and replace each 4-bit
group with the equivalent hexadecimal symbol.

68
Example

69
Hexadecimal-to-binary
Conversion
 To convert from a hexadecimal number to a binary
number, reverse the process and replace each
hexadecimal symbol with the appropriate four bits.

70
Example

71
Hexadecimal-to-decimal
Conversion
 One way to find the decimal equivalent of a hexadecimal number is
to first convert the
hexadecimal number to binary and then convert from binary to
decimal.

72
Hexadecimal-to-decimal
Conversion
 Another way to convert a hexadecimal number to its decimal
equivalent is to multiply the decimal value of each hexadecimal
digit by its weight and then take the sum of these products.
 The weights of a hexadecimal number are increasing powers of
16 (from right to left).
 For a 4-digit hexadecimal number, the weights are

73
Example

74
Decimal-to-Hexadecimal
Conversion
 Repeated division of a decimal number by 16 will produce the
equivalent hexadecimal number, formed by the remainders of
the divisions.
 The first remainder produced is the least significant digit
(LSD).
 Each successive division by 16 yields a remainder that
becomes a digit in the equivalent hexadecimal number.

75
Example

76
Hexadecimal addition
 Addition can be done directly with hexadecimal numbers by remembering
that the hexadecimal digits 0 through 9 are equivalent to decimal digits 0
through 9 and that hexadecimal digits A through F are equivalent to decimal
numbers 10 through 15.
 When adding two hexadecimal numbers, use the following rules. (Decimal
numbers are indicated by a subscript 10.)
 1. In any given column of an addition problem, think of the two
hexadecimal digits in
terms of their decimal values. For instance, 516 = 510 and C16 =
1210.
 2. If the sum of these two digits is 1510 or less, bring down the
corresponding hexadecimal digit.
 3. If the sum of these two digits is greater than 1510, bring down the
amount of the sum 77

that exceeds 1610 and carry a 1 to the next column.


Example

78
Exercise
 Add 4C16 and 3A16

79
Binary Coded Decimal (BCD)

 Binary coded decimal (BCD) is a way to express each of


the decimal digits with a binary code.
 There are only ten code groups in the BCD system, so it is
very easy to convert between decimal and BCD.
 Because we like to read and write in decimal, the BCD
code provides an excellent interface to binary systems.
 Examples of such interfaces are keypad inputs and digital
readouts.

80
The 8421 BCD Code

 The 8421 code is a common type of BCD (binary coded decimal)


code.
 Binary coded decimal means that each decimal digit, 0 through
9, is represented by a binary code of four bits.
 The designation 8421 indicates the binary weights of the four
bits (23, 22, 21, 20).

81
Invalid Codes
 Invalid Codes you should realize that, with four bits, sixteen
numbers (0000
through 1111) can be represented but that, in the 8421 code,
only ten of these are used.
 The six code combinations that are not used—1010, 1011,
1100, 1101, 1110, and 1111—are invalid in the 8421 BCD
code.

82
Example

83
Applications of BCD

 Digital clocks, digital thermometers, digital meters, and other


devices with seven-segment displays typically use BCD code to
simplify the displaying of decimal numbers.
 BCD is not as efficient as straight binary for calculations, but it
is particularly useful if only limited processing is required, such
as in a digital thermometer.

84
BCD addition
 BCD is a numerical code and can be used in arithmetic operations.

 Addition is the most important operation because the other three operations (subtraction,
multiplication, and division) can be accomplished by the use of addition.

 Here is how to add two BCD numbers:


Step 1: Add the two BCD numbers, using the rules for binary addition.
Step 2: If a 4-bit sum is equal to or less than 9, it is a valid BCD number.
Step 3: If a 4-bit sum is greater than 9, or if a carry out of the 4-bit group is generated,
it is an invalid result. Add 6 (0110) to the 4-bit sum in order to skip the six invalid states and
return the code to 8421. If a carry results when 6 is added, simply add the carry to the next 4-bit
group. 85
Example

86
Cont’d

87
Exercise
1. Convert hexadecimal number 4100 to binary:
2. Convert binary number 1111110000 to hexadecimal:
3. Convert hexadecimal number F3 to decimal:
4. Convert decimal number 6500 to hexadecimal:
5. Perform the additions hexadecimal number: A0 + 6B
6. Add the following BCD numbers:
A. 01010001 + 01011000
B. 10011000 + 10010111
88
End Of The Chapter

89
Chapter Three:
Logic Gates

90
Logic Gates
Are the building blocks of digital electronics.
The term gate is used to describe a circuit that performs a basic logic operations.
The fundamental logic gates include the NOT, AND, OR, NAND, NOR, X-OR, X-
NOR gates.
Each of these gates performs a different logical operations

91
The INVERTER

The inverter (NOT) performs the operation called inversion or


complementation.

The inverter changes one logic level to the opposite level.


In terms of bits, it changes a 1 to a 0 or a 0 to a 1.
=

92
Inverter Operation

 When the input is low, the output is high; when the


input is high, the output is low, thereby producing
an inverted output pulse.

93
The AND Gate

 An AND gate can have two or more inputs and performs what is know as logical
multiplication.
 The AND gate is composed of two or more inputs and a single output, as indicated by the
standard logic symbols shown in Figure

94
Operation Of An And Gate

 An AND gate produces a high output only when all of the inputs are high. When any
of the inputs is LOW, the output is LOW.

 Therefore, the basic purpose of an AND gate is to determine when certain conditions
are simultaneously true, as indicated by high levels on all of its inputs, and to produce
a high on its output to indicate that all these conditions are true.

 For a 2-input and gate, output X is high only when inputs A and B are
high; X is low when either A or B is low, or when both A and B are low.

95
Truth Table For A 2-input AND Gate.

 The total number of possible


combinations of binary inputs to a gate is
determined by the following formula:

96
Logic expressions for AND gates

 The operation of a 2-input AND gate can be expressed in equation form as


follows:
 If one input variable is A, the other input variable is B, and the output
variable is X, then the Boolean expression is

X = AB
.

97
Check-up

1. Develop the truth table for a 3-input AND gate.


2. Determine the total number of possible input combinations for a
4-input
AND gate.

98
THE OR GATE

 An OR gate has two or more inputs and one output, as indicated by the
standard logic symbols in Figure , where OR gates with two inputs are
illustrated.

 An OR gate can have any number of inputs greater than one

99
OPERATION OF AN OR GATE

 An OR gate produces a high on the output when any


of the inputs is high.
 The output is LOW only when all of the inputs are
LOW.
 Therefore, an OR gate determines when one or
more of its inputs are high and produces a high on its
output to indicate this condition.
 for a 2-input or gate, output X is high when either
input A or input B is high, or when both A and B are
high; X is low only when both A and B
are low.

100
Logic expressions for or gates

 The operation of a 2-input OR gate can be expressed as follows:


 If one input variable is A, if the other input variable is B, and if the
output variable is X, then the Boolean expression is
X=A+B

101
THE NAND GATE

 The NAND gate is a popular logic element because it can be used as a


universal gate; that is, NAND gates can be used in combination to
perform the AND, OR, and INVERTER operations.
 The term NAND is a contraction of NOT-AND and implies an AND function
with a
complemented (inverted) output.
 The standard logic symbol for a 2-input NAND gate and its equivalency to
an AND gate followed by an inverter are shown in Figure

102
Operation Of A NAND Gate
 A NAND gate produces a LOW output only when all the inputs are HIGH. When any of the inputs
is LOW, the output will be HIGH.
 For the specific case of a 2-input NAND gate,
as shown below with the inputs labeled A and B and the output labeled X, the operation can be
stated as follows:
 For a 2-input NAND gate, output X is LOW only when inputs A and B are
HIGH; X is HIGH when either A or B is LOW, or when both A and B are LOW.

103
System Example:Storage Tank High-level Detection

104
Logic Expressions For NAND
Gates
 The Boolean expression for the output of a 2-input
NAND gate is

105
Check-Up

1. Describe the functional differences between a NAND


gate and a negative-OR gate. Do they both have the
same truth table?

106
THE NOR GATE
 The NOR gate, like the NAND gate, is a useful logic element because it can also be used as a
universal gate; that is, NOR gates can be used in combination to perform the AND, OR, and
INVERTER operations.
 The term NOR is a contraction of NOT-OR and implies an OR function with an
inverted (complemented) output.
 The standard logic symbol for a 2-input NOR gate and its equivalent OR gate followed by
an inverter are shown in Figure

107
Operation Of A NOR Gate
• A nor gate produces a LOW output when any of its
inputs is HIGH.
• Only when all of its inputs are LOW is the output HIGH.
• For the specific case of a 2-input NOR gate, as shown
in Figure with the inputs labeled A and B and the
output labeled X, the operation can be
stated as follows:
• For a 2-input nor gate, output X is LOW when
either input A or input B is HIGH, or when both
A and B are HIGH; X is HIGH only when both A
and B are LOW 108
Logic Expressions For NOR
Gates
 The Boolean expression for the output of a 2-input NOR gate can be
written as

109
THE EXCLUSIVE-OR AND
EXCLUSIVE-NOR GATES
 Exclusive-or and exclusive-nor gates are formed by a
combination of and gates, or gates, and inverters.

 However, because of their fundamental importance in many


applications, these gates are often treated as basic logic
elements with their own unique symbols.

110
THE EXCLUSIVE-OR GATE
 Standard symbols for an exclusive-OR (XOR for short) gate are shown in Figure .
 The XOR gate has only two inputs. The exclusive-or gate performs modulo-2
addition.
 The output of an exclusive-OR gate is HIGH only when the two inputs are at
opposite logic levels.
 This operation can be stated as follows with reference to inputs A and B and
output X:
 For an exclusive-or gate, output X is HIGH when input A is LOW and input
B is HIGH, or when input A is HIGH and input B is LOW; X is LOW when A
and B are both HIGH or both LOW.

111
TRUTH TABLE FOR AN
EXCLUSIVEOR GATE.

112
THE EXCLUSIVE-NOR GATE
 Standard symbols for an EXCLUSIVE-NOR (XNOR) gate are shown in Figure.
 Like the XOR gate, an XNOR has only two inputs.
 The bubble on the output of the XNOR symbol indicates that its output is opposite that of the XOR
gate.
 When the two input logic levels are opposite, the output of the exclusive-NOR gate is LOW. The
operation can be stated as follows (A and B are inputs, X is the output):
 For an exclusive-nor gate, output X is LOW when input A is LOW and input B is HIGH, or
when A is HIGH and B is LOW; X is HIGH when A and B are both HIGH or both LOW.

113
TRUTH TABLE FOR AN EXCLUSIVE NOR
GATE.

114
LOGIC EXPRESSIONS FOR THE XOR
AND XNOR GATES

115
Check-Up

1. Sensors are used to monitor the pressure and the temperature of a


chemical solution stored in a vat. The circuitry for each sensor produces a
HIGH voltage when a specified maximum value is exceeded. An alarm
requiring a LOW voltage input must be activated when either the pressure
or the temperature is excessive. Develop a circuit for this application.

116
Check-up

2.In a certain automated manufacturing process, electrical components are automatically inserted in a
PC board. Before the insertion tool is activated, the PC board must be properly positioned, and the
component to be inserted must be in the chamber. Each of these prerequisite conditions is indicated by
a HIGH voltage. The insertion tool requires a LOW voltage to activate it. Develop a circuit to
implement this process

117

You might also like