Documente Academic
Documente Profesional
Documente Cultură
A Design Example
switch
after
inversion
1 ms = 100,000 clock
cycles at 100 MHz
• Single-output switch
– Since all you see is bouncing value, timing-
based solution can be employed
5ms
5ms 5ms
noisy
debounced
time
noisy debounced
Finite Timer
State clrTimer
timerDone (5ms)
Machine
clrTimer
S0
noisy’•timerDone noisy
noisy’
noisy
clrTimer
S0
noisy’•timerDone noisy
noisy’
noisy
clrTimer
S0
noisy’•timerDone noisy
noisy’
noisy
noisy•timerDone
noisy’•timerDone
debounced
noisy’•timerDone’ S1
As mentioned, Mealy
noisy/clrTimer machines often require
fewer states…
ECEn 224 20 Debounce © 2003-2008
Page 19 BYU
Reduce FSM to Logic
NT
CS 00 01 11 10
0 1
1 1 1 1
NS = noisy•timerDone + CS•timerDone’
debounced = CS
NS = noisy•timerDone + CS•timerDone’
debounced = CS
noisy
timerDone D Q debounced
CS clrTimer
noisy
noisy debounced
Finite Timer
State clrTimer
timerDone (5ms)
Machine
noisy•timerDone’
S0 Look at the transitions. Will
previous slide’s problem
noisy•timerDone cause a malfunction?
noisy’•timerDone
If you determine that a
problem may result, that is
easiest way to solve the
problem?
debounced
noisy’•timerDone’ S1
noisy/clrTimer
• A better approach:
– Register that selects between CS+1 and 0
– This is the technique of Chapter 12 (registers)
18
18
+1 0 18 18 18-input
timerDone
18 D Q AND
0 1
clrTimer clk
18
18
+1 0 18 18 18-input
timerDone
18 D Q AND
0 1
clrTimer clk
18
18
+1 18 18 18-input
timerDone
18 D Q AND
clrTimer
clk
18
18
+1 0 18 18 18-input
timerDone
18 D Q AND
0 1
clrTimer clk
18
+1 18
18 D Q
clrTimer
Cout
clk
timerDone
count[17:0]
“000000000000000001” output
A A
‘0’ S S
Cin Cin
A ‘0’
‘0’
‘0’ ‘0’ A Cout
Cout
Cin Cin
A
Cin “Half Adder” adds two
bits instead of three
A2 A1 A0
S2 S1 S0 Carry-in of ‘1’
gives us the +1