Mechatronics
Mechatronics
002
Mechatronics
Lecture 13
Digital Gates and Combinational Logics
The course material was adapted from Prof. Heui Jae Pahk’s lecture notes
→ Two lecture videos will be uploaded next week (Lec 14, 15)
2
M2794.013400.002 Mechatronics, Lec 13, SNU
1) Analog Comparator
Summary of Lecture 11
● Operational Amplifier (Op Amp)
2) Voltage Follower
● Rules:
○ Zin=∞ (or i- ≒ i+ ≒ 0) and Zout ≒ 0
○ In open loop (or no feedback)
■ If V+ > V- then Vout = +Vcc
3) Current Source
■ If V+ < V- then Vout = -Vcc
○ In closed loop (or negative feedback or feedback
4) Inverting Amplifier
to V-)
■ V- ≒ V+
○ |Vout| ≤ +Vcc
● 8 Applications
3
M2794.013400.002 Mechatronics, Lec 13, SNU
Summary of Lecture 12
9) Integrator
Additional 4 Applications:
1 Example: Large R2 to
prevent OP Amp
saturation
10) Differentiator
Roll-off
function
circuit
4
M2794.013400.002 Mechatronics, Lec 13, SNU
Digital Gates and Combinational Logics
We will be dealing with digital signals in today’s lecture.
Combinational logic circuits are made up from basic logic digital gates.
Let’s first learn what digital is:
Analog Digital
5
M2794.013400.002 Mechatronics, Lec 13, SNU
Three logic states
L = 0 = False = 0V
6
M2794.013400.002 Mechatronics, Lec 13, SNU
Data Width: Number of Bits for data representation
7
M2794.013400.002 Mechatronics, Lec 13, SNU
Number Representation
Binary [0,1]: 1101B =11012 = 1∙23 + 1∙22 + 1 = 1310
8
M2794.013400.002 Mechatronics, Lec 13, SNU
Relay (계전기,繼電器)
: Electro-Magnet connected to multiple switches for various functions
KA or KB
● Multiple points connected to
magnet
● 1, 2 : a(NO) Type, 3 : b(NC) Type
○ NO=Normally Open
○ NC=Normally Closed
● A1 , A2 : Terminals for Electro-Magnet
Source:
https://theveterinarymedicine.com/General-Purpose-Relays-
Power-PCB-Relay/Other- Transformers-zbtfe-582626.action
https://www.youtube.com/watch?v=1lbdwPfFegY&ab_c 9
M2794.013400.002 Mechatronics, Lec 13, SNU hannel=RealPars
Functions of Relay:
2. Voltage change
ex) 5V Switch to 12V Switch
10
M2794.013400.002 Mechatronics, Lec 13, SNU
Gate and Truth Table
1. OR gate
: Q = A OR B = A∨B = A+B
A B Q
0 0 0
0 1 1
1 0 1
1 1 1
11
M2794.013400.002 Mechatronics, Lec 13, SNU
Gate and Truth Table
2. AND gate
: Q = A AND B = A∧B = A∙B
A B Q
0 0 0
0 1 0
1 0 0
1 1 1
12
M2794.013400.002 Mechatronics, Lec 13, SNU
Gate and Truth Table
_ _ _ _
3. NAND gate A∨B = A+B
A B Q
0 0 1
0 1 1
1 0 1
1 1 0
13
M2794.013400.002 Mechatronics, Lec 13, SNU
Gate and Truth Table
_ _ _ _
4. NOR gate A∧B = A∙B
A B Q
0 0 1
0 1 0
1 0 0
1 1 0
14
M2794.013400.002 Mechatronics, Lec 13, SNU
Gate and Truth Table
5. Inverter gate
: Q = Not A = A
__
A
Symbol Implementation Relay Circuit Truth Table
A Q
0 1
1 0
15
M2794.013400.002 Mechatronics, Lec 13, SNU
Gate and Truth Table
0 0 0
0 1 1
1 0 1
1 1 0
16
M2794.013400.002 Mechatronics, Lec 13, SNU
How are logic gates made?
Logic gates are implemented using diodes or transistors.
http://hyperphysics.phy-astr.gsu.edu/
hbase/Electronic/or.html 17
M2794.013400.002 Mechatronics, Lec 13, SNU
Logic Statement/Logic Function - Case 1
: Logic statement can be converted to Logic function. Then, the logic circuit can be drawn
accordingly.
: To hold the Switch function (‘ON’) even when the Switch is released. It is widely applied to
M/C operation.
Relay Circuit
Logic Gate
A + K A = KA
Logic: A + Q = Q KA = Q
∴A+Q=Q
18
M2794.013400.002 Mechatronics, Lec 13, SNU
Logic Statement/Logic Function - Case 1 (Cont’d)
For OFF function, we need a OFF S/W (B signal) pressed.
Two modes of circuit configuration: Dominant ON mode and Dominant OFF mode.
(1) Dominant ON
: Insert OFF S/W, B, in front of OR gate. This gives ON even when both A and B switches
are pressed. Then, the logic function is, A + B∙Q=Q
Relay Circuit
Logic Gate
A + KA⋅B = KA
KA = Q
19
M2794.013400.002 Mechatronics, Lec 13, SNU
Logic Statement/Logic Function - Case 1 (Cont’d)
(2) Dominant OFF
: Insert OFF S/W, B, in front of AND gate. This gives OFF when both A and B are pressed. The
logic function is, (A + Q)∙B = Q
Relay Circuit
Logic Gate
(A + KA)⋅B = KA
KA = Q
20
M2794.013400.002 Mechatronics, Lec 13, SNU
Logic Statement/Logic Function - Case 2
Case2) Interlock Circuit (or Quiz Circuit)
: To interlock each other. This gives the fastest signal to pass while others are locked. Also
called ’Quiz Circuit’.
Logic Gate
A ⋅ KB = KA
B ⋅ KA = KB
KA = P
KB = Q
21
M2794.013400.002 Mechatronics, Lec 13, SNU
Homework 10
22
M2794.013400.002 Mechatronics, Lec 13, SNU
Karnaugh Map
: To derive logic function from the logic statement or truth table
Step 2: Make a Karnaugh Map by changing only one bit to the next location in the
sequence
Step 3: Identify the location of 1’s on the map and get the Logic function
23
M2794.013400.002 Mechatronics, Lec 13, SNU
Ex) Design an Electronic Voting System of 3 inputs (A, B, C) such
that when at least two inputs are 1, then output(Q) is 1.
A B C Q
C AB
0 0 0 0 00 01 11 10
0 0 1 0 0 0 0 1 0
0 1 0 0 1 0 1 1 1
0 1 1 1
1 0 0 0 ∴ Logic Function :
1 0 1 1 The location 1’s gives
Q = AB + AC + BC
1 1 0 1 Therefore, the logic gates are widely used for logic
1 1 1 1 calculations.
Similarly, the arithmetic gates such as Adder,
Subtractor, Multiplier, Divider gates can be used for
arithmetic calculation as follows (next page);
24
M2794.013400.002 Mechatronics, Lec 13, SNU
Arithmetic Gates
Adder Gate, X+Y=A Subtractor Gate, X-Y=A
Multiplier Gate, X*Y=A; SHL(SHift Left) and Add Divider Gate, X/Y=A; SHR(SHift Right) and Subtract,
where quotient (lower 4bits), Remainder (higher 4bits)
25
M2794.013400.002 Mechatronics, Lec 13, SNU
Summary of Lecture 13 Relay
26
M2794.013400.002 Mechatronics, Lec 13, SNU