Sequence Detector Application Examples
Sequence Detector Application Examples
• Design of FSMs
• Delays
• Ring Counter
Lecture 13: Applications • Serial Data
• Serial Adder
Professor Peter Cheung • Schmitt Trigger
Department of EEE, Imperial College London
E1.2 Digital Electronics I 13.1 Dec 2007 E1.2 Digital Electronics I 13.2 Dec 2007
input D output Z
D
state "bubble"
Serial data input Detector output 1/0
Z 1/0
CLK 0/0
CLK 1/0
0/0 1/0
IDLE 01 11 10
• D input changes on falling edge of CLK, detector changes state 00
on rising edge of CLK.
0/0
CLK assigned state value
0/1
D state transition S1 S0
E1.2 Digital Electronics I 13.3 Dec 2007 E1.2 Digital Electronics I 13.4 Dec 2007
A Sequence Detector (Con’t)
input D output Z
A Sequence Detector (Con’t)
state "bubble"
1/0
• Draw State Transition Table 1/0
0/0 1/0 • Design hardware
0/0 1/0
IDLE 01 11 10
00
0 0 1 0 1 0
0 1 0 1 1 0
0 1 1 0 1 0
1 1 0 0 0 0
1 1 1 1 0 0
1 0 0 0 0 1
1 0 1 0 1 0
E1.2 Digital Electronics I 13.5 Dec 2007 E1.2 Digital Electronics I 13.6 Dec 2007
E1.2 Digital Electronics I 13.7 Dec 2007 E1.2 Digital Electronics I 13.8 Dec 2007
Delays
Q2
E1.2 Digital Electronics I 13.9 Dec 2007 E1.2 Digital Electronics I 13.10 Dec 2007
CLOCK CLOCK
• A ring counter is made from a shift register with the
DIN DIN
output of the last bit fed to the input of the first bit
Q0 Q0
Q1 Q1
Q2 Q2
SRG4
CLOCK C1
Asynchronous Input Synchronous Input
DIN Q0
1D
Q1
Q2
Note: These timing diagrams do not show
the CLOCK-to-Q delays of the flip-flops. Q3
E1.2 Digital Electronics I 13.11 Dec 2007 E1.2 Digital Electronics I 13.12 Dec 2007
Serial Adder
• Transition Table
– The above can be summarised in the following table • Bit-serial data
– Normally when we think of binary numbers represented in digital
Q3 DIN Q0:3 (Q0:3)+ electronic hardware, we think of parallel data
0 0 n 2n • one connection per bit
0 1 n 2n+1 • all bits processed together
1 0 n 2n-16 – In bit-serial data, the bits making up a binary number are
1 1 n 2n-15 processed one bit at a time
• takes longer but
• simplifies the hardware
– Now reconnect the feedback from Q3 to DIN
– the operation of the ring counter follows the top and bottom Eg.
lines of the table only
– to add two 8-bit numbers in parallel requires 8 full adders
– to add two 8-bit numbers bit-serially requires only 1 full adder
and some registers
E1.2 Digital Electronics I 13.13 Dec 2007 E1.2 Digital Electronics I 13.14 Dec 2007
Clock
00/00
• Assumptions:
– One coin at a time • FSM remains in S0 until there is a p20 or p10 input
– Generate pulse p10 or p20 lasting for one clock cycle when coin inserted • S1 represents 10p credit
– vend = 1 for one clock period to deliver a coke • S2 represent 20p credit
– change = 1 for one clock period to return a 10p coin • S3 represent 40p credit
E1.2 Digital Electronics I 13.17 Dec 2007 E1.2 Digital Electronics I 13.18 Dec 2007
00/00
• Therefore S3≡S2
E1.2 Digital Electronics I 13.19 Dec 2007 E1.2 Digital Electronics I 13.20 Dec 2007
Step 5: Draw State Transition Table Step 6: Assign binary value to states
S0p = 00
S10p = 01
Outputs S20p = 11 Outputs
Next State
vend: change Sbad = 10 vend: change
Next State n1: n0
00 01 11 10 00 01 11 10
S0p S0p,00 S10p,00 xx,xx S20p,00 S0p 00,00 01,00 xx,xx 11,00
Current State
Current State
S10p S10p,00 S20p,00 xx,xx S0p,10 S10p 01,00 11,00 xx,xx 00,10
S20p S20p,00 S0p,10 xx,xx S0p,11 S20p 11,00 00,10 xx,xx 00,11
Sbad S0p,00 S0p,00 xx,xx S0p,00 Sbad 00,00 00,00 xx,xx 00,00
E1.2 Digital Electronics I 13.21 Dec 2007 E1.2 Digital Electronics I 13.22 Dec 2007
Step 7: Hardware design Step 8: Draw Karnaugh Map for each output variable
clock
C1
p20 Inputs p20: p10 Inputs p20: p10
1D vend
E1.2 Digital Electronics I 13.23 Dec 2007 E1.2 Digital Electronics I 13.24 Dec 2007
Inputs p20: p10 Inputs p20: p10
vend 00 01 11 10 change 00 01 11 10
00 0 0 x 0 00 0 0 x 0
01 0 0 x 1 01 0 0 x 0
11 0 1 x 1 11 0 0 x 1
10 0 0 x 0 10 0 0 x 0