Professional Documents
Culture Documents
Chapter 8. Digital Electronics-Rev06052023
Chapter 8. Digital Electronics-Rev06052023
Chapter 8. Digital Electronics-Rev06052023
Van Su Luong
phenikaa-uni.edu.vn
Introductory Concepts
phenikaa-uni.edu.vn
Analog Quantities
100
95
90
85
80
75
70
Time of day
1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12
A .M . P.M .
phenikaa-uni.edu.vn
Analog and Digital Systems
phenikaa-uni.edu.vn
Eight Advantages of Digital Systems
Over Analog Systems
phenikaa-uni.edu.vn
Binary Digits and Logic Levels
Digital electronics uses circuits that have two states, which are
represented by two different voltage levels called HIGH and LOW.
The voltages represent numbers in the binary system.
phenikaa-uni.edu.vn
Digital Waveforms
HIGH HIGH
Rising or Falling or Falling or Rising or
leading edge trailing edge leading edge trailing edge
LOW LOW
t0 t1 t0 t1
phenikaa-uni.edu.vn
Serial and Parallel Data
1 0 1 1 0 0 1 0
t0 t1 t2 t3 t 4 t5 t6 t7
Computer Modem
1
Computer Printer
0
0
t0 t1
phenikaa-uni.edu.vn
Basic Logic Functions
phenikaa-uni.edu.vn
Basic System Functions
And, or, and not elements can be combined to form various logic
functions. A few examples are:
Comparator
A> B
A
Two
B
A< B
Adder
A
Basic arithmetic functions Two
binary
Σ Sum
phenikaa-uni.edu.vn
Basic System Functions
HIGH
9 Encoder
8
7
6 Binary code
5 for 9 used for
4 storage and/or
3 computation
2
The encoding function 7 8 9 1
4 5 6 0
1 2 3
0 . +/–
Calculator keypad
Binary input
7-segment display
phenikaa-uni.edu.vn
Basic System Functions
Multiplexer Demultiplexer
A D
Data from Data from Data from Data from
A to D B to E C to F A to D
∆t1 ∆t1
∆ t1 ∆ t2 ∆ t3 ∆t 1
B E
∆t2 ∆t2
∆t3 ∆t3
C F
Switching Switching
sequence sequence
control input control input
phenikaa-uni.edu.vn
Basic System Functions
Counter Parallel
output lines Binary Binary Binary Binary Binary
code code code code code
1 2 3 4 5 for 1 for 2 for 3 for 4 for 5
Input pulses Sequence of binary codes that
represent the number of input pulses
counted.
phenikaa-uni.edu.vn
Basic System Functions
phenikaa-uni.edu.vn
Integrated Circuits
Pins
phenikaa-uni.edu.vn
Number Systems,
Operations, and Codes
phenikaa-uni.edu.vn
Decimal Numbers
phenikaa-uni.edu.vn
Decimal Numbers
phenikaa-uni.edu.vn
Binary Numbers
For digital systems, the binary number system is used. Binary has a
radix of two and uses the digits 0 and 1 to represent quantities.
phenikaa-uni.edu.vn
Binary Numbers
Decimal Binary
Number Number
phenikaa-uni.edu.vn
Binary Conversions
phenikaa-uni.edu.vn
Binary Conversions
phenikaa-uni.edu.vn
Binary Conversions
phenikaa-uni.edu.vn
Binary Conversions
phenikaa-uni.edu.vn
Logic Gates
phenikaa-uni.edu.vn
The Inverter
A X
Input Output
A X
LOW (0) HIGH (1)
HIGH (1) LOW(0)
phenikaa-uni.edu.vn
The Inverter
A X
Example waveforms:
A
X
A group of inverters can be used to form the 1’s complement of a
binary number: Binary number
1 0 0 0 1 1 0 1
0 1 1 1 0 0 1 0
1’s complement
phenikaa-uni.edu.vn
The AND Gate
A A
X & X
B B
The AND gate produces a HIGH output when all inputs are HIGH;
otherwise, the output is LOW. For a 2-input gate, the truth table is
Inputs Output
A B X
0 0 0
0 1 0
1 0 0
1 1 1
phenikaa-uni.edu.vn
A
The AND Gate A
B
X
B
& X
Example waveforms:
A
B
X
The AND operation is used in computer programming as a selective
mask. If you want to retain certain bits of a binary number but reset
the other bits to 0, you could set a mask with 1’s in the position of the
retained bits.
phenikaa-uni.edu.vn
A A
The AND Gate B
X
B
& X
phenikaa-uni.edu.vn
The OR Gate A X A ≥1 X
B B
The OR gate produces a HIGH output if any input is HIGH; if all inputs
are LOW, the output is LOW. For a 2-input gate, the truth table is
Inputs Output
A B X
0 0 0
0 1 1
1 0 1
1 1 1
The OR operation is shown with a plus sign (+) between the variables.
Thus, the OR operation is written as X = A + B.
phenikaa-uni.edu.vn
The OR Gate A X A ≥1 X
B B
Example waveforms:
A
B
X
The OR operation can be used in computer programming to set certain bits of a
binary number to 1.
ASCII letters have a 1 in the bit 5 position for lower case letters and a 0
in this position for capitals. (Bit positions are numbered from right to left
starting with 0.) What will be the result if you OR an ASCII letter with the
8-bit mask 00100000?
phenikaa-uni.edu.vn
The OR Gate A X A ≥1 X
B B
phenikaa-uni.edu.vn
The NAND Gate
A X A & X
B B
The NAND gate produces a LOW output when all inputs are HIGH;
otherwise, the output is HIGH. For a 2-input gate, the truth table is
Inputs Output
A B X
0 0 1
0 1 1
1 0 1
1 1 0
phenikaa-uni.edu.vn
The NAND Gate
A X A & X
B B
Example waveforms:
A
B
X
phenikaa-uni.edu.vn
The NAND Gate
A X A & X
B B
A Multisim circuit is shown. XWG1 is a word generator set in the count up
mode. A four-channel oscilloscope monitors the inputs and output. What
output signal do you expect to see?
Inputs
phenikaa-uni.edu.vn
The NOR Gate
A X A ≥1 X
B B
The NOR gate produces a LOW output if any input is HIGH; if all
inputs are HIGH, the output is LOW. For a 2-input gate, the truth
table is
Inputs Output
A B X
0 0 1
0 1 0
1 0 0
1 1 0
The NOR operation is shown with a plus sign (+) between the
variables and an overbar covering them. Thus, the NOR operation
is written as X = A + B.
phenikaa-uni.edu.vn
The NOR Gate
A X A ≥1 X
B B
Example waveforms:
A
B
X
+5.0 V
phenikaa-uni.edu.vn
The XOR Gate
A X A =1 X
B B
The XOR gate produces a HIGH output only when both inputs are at
opposite logic levels. The truth table is
Inputs Output
A B X
0 0 0
0 1 1
1 0 1
1 1 0
phenikaa-uni.edu.vn
The XOR Gate
A X A =1 X
B B
Example waveforms:
A
B
X
Notice that the XOR gate will produce a HIGH only when exactly one input is
HIGH.
If the A and B waveforms are both inverted for the above
waveforms, how is the output affected?
phenikaa-uni.edu.vn
The XNOR Gate
A X A =1 X
B B
The XNOR gate produces a HIGH output only when both inputs
are at the same logic level. The truth table is
Inputs Output
A B X
0 0 1
0 1 0
1 0 0
1 1 1
The XNOR operation shown as X = AB + AB. Alternatively, the
XNOR operation can be shown with a circled dot between the
variables. Thus, it can be shown as X = A . B.
phenikaa-uni.edu.vn
The XNOR Gate
A X A =1 X
B B
Example waveforms:
A
B
X
Notice that the XNOR gate will produce a HIGH when both inputs are the same. This makes
it useful for comparison functions.
If the A waveform is inverted but B remains the same, how is the output
affected?
phenikaa-uni.edu.vn
Boolean Algebra and
Logic Simplification
phenikaa-uni.edu.vn
Boolean Addition
phenikaa-uni.edu.vn
Boolean Multiplication
phenikaa-uni.edu.vn
Commutative Laws
A+B=B+A
AB = BA
phenikaa-uni.edu.vn
Associative Laws
A + (B +C) = (A + B) + C
A(BC) = (AB)C
phenikaa-uni.edu.vn
Distributive Law
AB + AC = A(B+ C)
The distributive law can be illustrated with equivalent circuits:
A
AB
B B
B+ C
C X
X A
A AC
C
A(B+ C) AB + AC
phenikaa-uni.edu.vn
Rules of Boolean Algebra
1. A + 0 = A 7. A . A = A
2. A + 1 = 1 8. A . A = 0
=
3. A . 0 = 0 9. A = A
4. A . 1 = A 10. A + AB = A
5. A + A = A 11. A + AB = A + B
6. A + A = 1 12. (A + B)(A + C) = A + BC
phenikaa-uni.edu.vn
Rules of Boolean Algebra
(A + B)(A + C) = AA + AC + AB + BC
= A + AC + AB + BC
= A(1 + C + B) + BC
= A . 1 + BC
= A + BC
phenikaa-uni.edu.vn
DeMorgan’s Theorem
A A Inputs Output
AB A+B
B B A B AB A + B
NAND Negative-OR 0 0 1 1
0 1 1 1
1 0 1 1
1 1 0 0
phenikaa-uni.edu.vn
DeMorgan’s Theorem
A A Inputs Output
A+B AB
B B A B A + B AB
0 0 1 1
NOR Negative-AND 0 1 0 0
1 0 0 0
1 1 0 0
phenikaa-uni.edu.vn
DeMorgan’s Theorem
phenikaa-uni.edu.vn
Boolean Analysis of Logic Circuits
phenikaa-uni.edu.vn
SOP and POS forms
phenikaa-uni.edu.vn
SOP Standard form
phenikaa-uni.edu.vn
POS Standard form
phenikaa-uni.edu.vn
Karnaugh maps
ABC ABC
phenikaa-uni.edu.vn
Karnaugh maps
Cells are usually labeled using 0’s and 1’s to represent the variable
and its complement.
C The numbers are entered in gray
code, to force adjacent cells to be
AB 0 1
phenikaa-uni.edu.vn
Karnaugh maps
yellow cells. AB
AB ABC ABC
AB
AB ABC
ABC ABC
AB
AB ABC ABC
ABC
phenikaa-uni.edu.vn
Karnaugh maps
C 0 1
AB
1 1. Group the 1’s into two overlapping groups as
B changes 00
indicated.
across this
boundary
01 1 1 2. Read each group by eliminating any variable
that changes across a boundary.
11
phenikaa-uni.edu.vn
Karnaugh maps
AB
The following slide shows an example
AB of reading a four variable map using
binary numbers for the variables…
phenikaa-uni.edu.vn
Karnaugh maps
Group the 1’s on the map and read the minimum logic.
C changes across
outer boundary
CD
AB
00 01 11 10 1. Group the 1’s into two separate groups as
00 1 1 indicated.
B changes 2. Read each group by eliminating any
01 1 1 variable that changes across a boundary.
11 1 1
3. The upper (yellow) group is read as
B changes
10 1 1 AD.
4. The lower (green) group is read as AD.
C changes
X
X = AD +AD
phenikaa-uni.edu.vn
Combinational
Logic Analysis
phenikaa-uni.edu.vn
Combinational Logic Circuits
Product terms
A
AB
B
C CD
D AB + CD + . . . + JK
Sum-of-products
J
JK
K
Product term
phenikaa-uni.edu.vn
Combinational Logic Circuits
A
B ABC
C X = ABC + DE SOP
D
DE
E
phenikaa-uni.edu.vn
Combinational Logic Circuits
D X = (ABC)(DE) DeMorgan
E DE X = (A + B + C)(D + E) POS
phenikaa-uni.edu.vn
Exclusive-OR Logic
phenikaa-uni.edu.vn
Exclusive-NOR Logic
Inputs Output
The truth table for an exclusive-NOR gate is A B X
Notice that the output is HIGH whenever 0
0
0
1
1
0
A and B agree. 1 0 0
The Boolean expression is X = AB + AB
1 1 1
Symbols:
A
X =1
B
phenikaa-uni.edu.vn
Summary
phenikaa-uni.edu.vn
Implementing Combinational Logic
phenikaa-uni.edu.vn
Karnaugh Map Implementation
For basic combinational logic circuits, the Karnaugh map can be
read and the circuit drawn as a minimum SOP.
A Karnaugh map is drawn from a truth table. Read the minimum
SOP expression and draw the circuit.
C C
1
1. Group the 1’s into two overlapping groups as
AB
B changes indicated.
across this AB 1 1 2. Read each group by eliminating any variable
boundary that changes across a boundary.
AB 3. The vertical group is read A C.
C changes 4. The horizontal group is read AB.
AB
across this
boundary The circuit is on the next slide:
phenikaa-uni.edu.vn
continued
continued…
Circuit: A
C X = AC + AB
A
B
phenikaa-uni.edu.vn
Latches, Flip-Flops,
and Timers
https://www.youtube.com/watch?v=Hi7rK0hZnfc
phenikaa-uni.edu.vn
Latches
Q Q
S R
phenikaa-uni.edu.vn
Latches
The active-HIGH S-R latch is in a stable (latched) condition when both inputs
are LOW.
0 R 1
0
Assume the latch is initially RESET (Q Q
= 0) and the inputs are at their Latch
inactive level (0). To SET the latch initially
(Q = 1), a momentary HIGH signal RESET
0
1
is applied to the S input while the R Q
0 S
remains LOW.
0 R 1
0
To RESET the latch (Q = 0), a Q
momentary HIGH signal is Latch
applied to the R input while the S initially
remains LOW. SET
1
0
Q
0 S
phenikaa-uni.edu.vn
Latches
phenikaa-uni.edu.vn
Latches
phenikaa-uni.edu.vn
Latches
A gated latch is a variation on the basic latch.
The gated latch has an additional S
input, called enable (EN) that Q
must be HIGH in order for the latch
to respond to the S and R inputs. EN
EN
Q
https://www.youtube.com/watch?v=HxAhOETcvr4
phenikaa-uni.edu.vn
Latches
The D latch is a variation of the S-R latch but combines the S and
R inputs into a single D input as shown:
D D Q
Q
EN EN
Q
Q
phenikaa-uni.edu.vn
Latches
Inputs Outputs
D EN Q Q Comments
0 1 0 1 RESET
1 1 1 0 SET
X 0 Q0 Q0 No change
phenikaa-uni.edu.vn
Latches
D Q
EN
Determine the Q output for the D
latch, given the inputs shown. Q
EN
Notice that the Enable is not active during these times, so the
output is latched.
https://www.youtube.com/watch?v=y7Zf7Bv_J74
phenikaa-uni.edu.vn
Flip-flops
D Q D Q
C C
Dynamic Q Q
input
indicator (a) Positive edge-triggered (b) Negative edge-triggered
phenikaa-uni.edu.vn
Flip-flops
phenikaa-uni.edu.vn
Flip-flops
The J-K flip-flop is more versatile than the D flip flop. In addition to
the clock input, it has two inputs, labeled J and K. When both J
and K = 1, the output changes states (toggles) on the active clock
edge (in this case, the rising edge).
Inputs Outputs
J K CLK Q Q Comments
0 0 Q0 Q0 No change
0 1 0 1 RESET
1 0 1 0 SET
1 1 Q0 Q0 Toggle
phenikaa-uni.edu.vn
Flip-flops
J Q
CLK
Determine the Q output for the J-K flip-flop,
given the inputs shown. K Q
Notice that the outputs change on the leading edge of the clock.
CLK
https://www.youtube.com/watch?v=iVoPMGGRlJM
phenikaa-uni.edu.vn
Flip-flops
A D-flip-flop does not have a toggle mode like the J-K flip-flop, but you can
hardwire a toggle mode by connecting Q back to D as shown.
D Q
phenikaa-uni.edu.vn
Flip-flops
PRE
Two such inputs are normally
labeled preset (PRE) and clear Q
J
(CLR). These inputs are usually
active LOW. A J-K flip flop with CLK
active LOW preset and CLR is
shown. K Q
CLR
phenikaa-uni.edu.vn
Flip-flops
PRE
J Q
Determine the Q output for the J-K flip-flop,
given the inputs shown. CLK
K Q
K Set
PRE Reset
CLR
phenikaa-uni.edu.vn
Flip-flop Applications
Output
lines
Principal flip-flop applications are for temporary data D Q0
storage, as frequency dividers, and in counters (not C
D Q1
C
R
Clear
https://www.youtube.com/watch?v=BjUvVbSt5i4
phenikaa-uni.edu.vn
Flip-flop Applications
HIGH HIGH
Waveforms:
fout
phenikaa-uni.edu.vn