week 06-07_241009_075053
week 06-07_241009_075053
University of Technology
Digital
CONTENTS
Content
Logic Gates
Boolean Rules
Counter
2
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
3
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Digital Signals
4
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Digital Signals
A single positive-going pulse is generated when the voltage goes from its normally
LOW level to its HIGH level then back to its LOW level.
A single negative-going pulse is generated when the voltage goes from its normally
HIGH level to its LOW level then back to its HIGH level
5
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Digital Signals
6
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Boolean Algebra
Boolean algebra (Đại số Boole)
In Boolean algebra, a variable is a symbol used to
represent an action, a condition, or data. A single
variable only have a value of 1 or 0
Logic 0 Logic 1
False True
Off On
George Boole
Low High (1815–1864)
No Yes
Open switch Closed switch
A B x
Truth table (Bảng chân trị)
0 0 ?
0 1 ?
A Gate x
B 1 0 ?
1 1 ?
7
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Logic Gates
8
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Logic Gate
The power supply connections to gates are often omitted in schematic diagrams for the
sake of simplicity
9
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
NOT Gate
An inverter, or NOT, gate is one that outputs the opposite state as what is
input. That is, a “low” input (0) gives a "high" output (1), and vice versa.
NOT
A x=A
0 1
1 0
x=A
A
NOT gate
10
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
NOT Gate
11
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
OR Gate
The output of an OR gate will be “high“ (1) if any of the inputs are “high” (1).
The output of an OR gate goes "low" (0) if and only if all inputs are "low" (0).
OR
A B x=A+B
0 0 0
0 1 1
1 0 1
1 1 1
12
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
OR Gate
Boolean addition corresponds to the logical function of an “OR” gate, as well
as to parallel switch contacts:
Input A
Input B
Output
13
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
OR Gate
Application
14
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
AND Gate
The output of an AND gate will be “high“ (1) if and only if all inputs are “high” (1).
The output of an AND gate goes "low" (0) if any of the inputs are "low" (0).
AND
A B x = A.B
0 0 0
0 1 0
1 0 0
1 1 1
15
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
AND Gate
Input A
Input B
Output
16
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
NOR Gate and NAND Gate
NOR (NOT-OR) gate
A x=A+B
B A B A+B A+B
0 0 0 1
NOR gate
0 1 1 0
A x=A+B 1 0 1 0
B 1 1 1 0
A B A.B A.B
0 0 0 1
0 1 0 1
1 0 0 1
1 1 1 0
17
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Negative-AND Gate and Negative-OR Gate
Negative-AND gate Negative-OR gate
18
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
XOR Gate and XNOR Gate
XOR gate XNOR gate
19
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Utility of NOR Gate and NAND Gate
INVERTER
A A A A
1 1
AND
A AB x = AB A A
1 2 1
B x = AB
3
B B
2
OR
A A
1
x=A+B A A+B x=A+B
3 1 2
B
B B
2
20
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
A x = (A + B)·C A
A+B A·B x = A·B + C
B B
C C
A B C A+B (A + B)C A B C AB AB + C
0 0 0 0 0 0 0 0 0 0
0 1 0 1 0 0 1 0 0 0
1 0 0 1 0 1 0 0 0 0
1 1 0 1 0 1 1 0 1 1
0 0 1 0 0 0 0 1 0 1
0 1 1 1 1 0 1 1 0 1
1 0 1 1 1 1 0 1 0 1
1 1 1 1 1 1 1 1 1 1
21
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
x = ABC(A + D)
22
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
x = AB+BC
A AB x = AB + BC
B
B
BC
C
23
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Boolean Rules
24
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Boolean Algebraic Identities
25
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Boolean Algebraic Properties
26
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Boolean Algebraic Properties
27
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
DeMorgan’s Theorems
A B A B
A B A B
28
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Circuit simplification examples
29
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Circuit simplification examples
A flame detection circuit for a toxic waste incinerator.
The intense heat of the fire is intended to neutralize the toxicity of the waste introduced into
the incinerator.
Due to the high degree of hazard involved with potentially passing un-neutralized waste out
the exhaust of this incinerator, it is decided that the flame detection system be made
redundant (multiple sensors)
Using "two out of three" sensor logic, whereby the waste valve is opened if at least two
out of the three sensors show good flame.
30
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Circuit simplification examples
31
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Circuit simplification examples
A flame detection circuit for a toxic waste incinerator.
Using Boolean algebra techniques, the expression may be significantly
simplified:
32
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Circuit simplification examples
A flame detection circuit for a toxic waste incinerator.
33
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
34
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Minterm and Maxterm
A flame detection circuit for a toxic waste incinerator.
Minterm
F ( A, B, C ) ABC ABC ABC ABC
m3 m5 m6 m7
Maxterm
F ( A, B, C ) ( A B C )( A B C )( A B C )( A B C )
M 0 M 1M 2 M 4
35
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
IC 74LS00 IC 74LS08
36
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
IC 74LS32
4 3
1 2
1
2 1
IC 74LS08
3
4 3
1 2
37
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Examples
Car safety alarm
Design a car safety alarm using Logic gates considering four input.
Alarm (A) should sound if:
Etheir (a) The key is in, and door is not closed
or (b) The door is closed, the key is in, and the driver is on seat, but the seat
belt is not strapped
Examples
Car safety alarm
Design a car safety alarm using Logic gates considering four input.
Alarm (A) should sound if:
Statement (a) (K = 1) AND (D = NOT 1)
Statement (b) (D = 1) AND (K = 1) AND (S = 1) AND (B = NOT 1)
Binary
Input Status D
value
1 Door closed K
Door (D) Logic A
0 Door open
S Circuits
1 Key is plugged into the car
Key (K)
0 Key is not plugged into the car B
1 Driver is on seat
Seat (S)
0 Driver is not on seat
1 Seat belt is strapped
Belt (B)
0 Seat belt is not strapped
39
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Examples
Car safety alarm
Design a car safety alarm using Logic gates considering four input.
Alarm (A) should sound if:
Statement (a) (K = 1) AND (D = NOT 1)
Statement (b) (D = 1) AND (K = 1) AND (S = 1) AND (B = NOT 1)
40
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Examples
41
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
42
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Latch and Flip-flop
In the same way that gates are the building blocks of combinatorial circuits,
latches and flip-flops are the building blocks of sequential circuits.
While gates had to be built directly from transistors, latches can be built from
gates, and flip-flops can be built from latches.
Both latches and flip-flops are circuit elements whose output depends not only
on the current inputs, but also on previous inputs and outputs.
The difference between a latch and a flip-flop is that a latch does not have a
clock signal, whereas a flip-flop always does.
43
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Latch
S-R Latch: Activation of the S input sets the circuit, while activation of the R
input resets the circuit. If both S and R inputs are activated simultaneously, the
circuit will be in an invalid condition.
Invalid!
44
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Latch
Gated S-R Latch
D Latch
45
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Flip-flop
Flip-flop: A flip-flop is a latch circuit with a “pulse detector” circuit connected
to the enable (E) input, so that it is enabled only for a brief moment on either
the rising or falling edge of a clock pulse.
Pulse detector circuits may be made from time-delay relays for ladder logic applications, or
from semiconductor gates (exploiting the phenomenon of propagation delay)
46
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Flip-flop
S-R Flip-flop
47
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Flip-flop
J-K flip-flop: A J-K flip-flop is an S-R flip-flop with an added layer of feedback.
This feedback selectively enables one of the two set/reset inputs so that they
cannot both carry an active signal to the multivibrator circuit, thus eliminating
the invalid condition.
When both J and K inputs are activated, and the clock input is pulsed, the
outputs (Q and not-Q) will swap states. That is, the circuit will toggle from a set
state to a reset state, or vice versa.
48
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Flip-flop
J-K flip-flop
49
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Counter
50
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Binary count sequence
A four-bit binary count sequence from 0000 to 1111
Four J-K flip-flops connected in such a way to always be in the "toggle" mode
Count up
52
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Asynchronous counters
An "up" counter may be made by connecting the
clock inputs of positive-edge triggered J-K flip-
flops to the Q’ outputs of the preceding flip-flops.
53
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Asynchronous counters
Ripple effect
Counter circuits made from cascaded J-K flip-flops where each clock input receives its
pulses from the output of the previous flip-flop invariably exhibit a ripple effect,
where false output counts are generated between some steps of the count sequence.
These types of counter circuits are called asynchronous counters, or ripple counters.
54
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Asynchronous counters
In many applications, the ripple effect is tolerable, since the ripple happens very, very
quickly
Ex: Drive a set of light-emitting diodes (LEDs) with the counter’s outputs
If we use this counter to drive the “select” inputs of a multiplexer, index a memory
pointer in a microprocessor (computer) circuit, it would not be acceptable.
There is a way to use this type of counter circuit in applications sensitive to false, ripple-
generated outputs, and it involves a principle known as strobing.
Synchronous counters
56
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Synchronous counters
A B C D
A B C D
57
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Synchronous counters
58
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Applications
Up/down counter circuits are very useful devices.
A common application is in machine motion control, where devices called rotary shaft
encoders convert mechanical rotation into a series of electrical pulses, these pulses
“clocking” a counter circuit to track total motion:
As the machine moves, it turns the encoder shaft, making and breaking the
light beam between LED and phototransistor, thereby generating clock
pulses to increment the counter circuit.
59
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Applications
If we re-design the encoder to have two sets of LED/phototransistor pairs, those pairs
aligned such that their square-wave output signals are 900 out of phase with each other,
we have what is known as a quadrature output encoder (the word “quadrature” simply
refers to a 900 angular separation).
60
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Counter IC
Asynchronous counter IC
• 74LS293: 4 bit counter
• 74HC4024: 7 bit counter (CMOS)
Synchronous counter IC
• 74LS163: synchronous 4-bit counter
• 74LS192:synchronous UP/DOWN
• 74LS193:synchronous UP/DOWN
IC 74LS293
• Four J-K Flip-flop (Q3Q2Q1Q0)
• Each flip-flop has a CP input, similar
to the CLK input.
• CP inputs of Q1 and Q0 are connected
with pin 11 and pin 10, respectively.
• Clear inputs of flip-flops are conneted
with output of a NAND gate which
has two inputs MR1 and MR2
• Q3Q2Q1 are a 3-bit counter
• Q0 is not connected with orther flip-
flop
61
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Homeworks
C
62
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Johnson counter
assuming that all Q outputs begin in the low state
63
Ho Chi Minh City Electrical & Electronic Equipment for Industrial Machinery
University of Technology
Ứng dụng cho mạch tạo xung điều khiển động cơ step
64