Beruflich Dokumente
Kultur Dokumente
We need those things for sequential circuit design Finite-State Machine (FSM)
A way to describe desired behavior of sequential circuit
Akin to Boolean equations for combinational behavior
Outputs
Next State
Clock
FSM Types
There are two main types of FSMs
Mealy (output is function of state and inputs) Moore (output is only function of state)
Mealy machine
Moore machine
A
out B
A D B cl ock Q Q
A
ou t
Q Q
out
Q Q
clock
Mealy or Moore ?
A D Q Q B D cl ock Q Q
ou t
ou t A
Q Q
Q Q
Q Q
Q Q
cl ock
The output changes only on the negative clock transitions, thus signal can be generated by using clocked flip flop. If D flip flop is to be used, then using the excitation table of D flip flop, determine the inputs of the D flip flops D1 and D2 whose outputs will be Q1 and Q2 respectively.
Sometimes it may happen that we are given with set of input conditions and output is to be obtained.
First of all, find the set of inputs to the flip flop under consideration using excitation table. Lets take D flip flop for this case
Now , the inputs of the D flip flop is to be determined with the help of input combination.
The K-Map for the D1 and D2 as a function of X and Y are derived as follows
Circuit diagram
For the given set of inputs and output, design the system using JK flip flop
Solution
Step 1: The system is to have one input line and one output line. Since the possible transitions can 0 to 1 and 1 to 0, so we can assume that we have only two state. Out of these two state one state will represent that current input is 1 and other state will represent current input as 0. Step 2: Draw state diagram
Step 3: No reduction needed. Step 4: State Assignments: Since we have only two states, so we need only one bit to code the two states. In our case lets assign 0 to state Zero and 1 to state One. Step 5: Designs the circuit diagram for this form state table as shown below.
Present state QD 0 0 1 1 Input (IN) 0 1 0 1 Next state QD+1 0 1 0 1 Output (OUT) 0 1 0 0 DA 0 1 0 1
0
0 1
1
0 0
QD
IN 0 1
0 1
0 1
OUT=QD.IN
DA= IN
Circuit Diagram:
Step 1: Understand problem Assuming that sensor gives two outputs which sense the coins. Lets take T signal for 10 cent coin and F signal for 5.
As per given condition the gum is delivered only when the coin inserted is minimum 15.
1. 2. 3. 4.
5.
5 > 5 > 10 (2 continuous 5 cent coin follows with one 10 cent coin)
Since once a package is delivered, the machine should be in initial state for the next customer. Also T=1 indicates 10 cent coin and F=1 indicates 5 cent coin. We cant have T=1 and F=1 at a same time. Lets start drawing state diagram.
10
11 11 11 11
1
0 0 1 1
1
0 1 0 1
XX
00 00 00 00
0
0 0 0 0
B
B
1
1
0
1
B
B
0
1
1
1
1
1
0
1
1
1
0
1
1
1
a. State Table
Simplified Presentation
Binary
Gray
X2
0 0 0 0 1 1 1 1
X1
0 0 1 1 0 0 1 1
X0
0 1 0 1 0 1 0 1
Y2
0 0 0 0 1 1 1 1
Y1
0 0 1 1 1 1 0 0
Y0
0 1 1 0 0 1 1 0
1. Whenever MSB is 0 corresponding Gary code value is 0 and when its 1 the Gray code is 1. 2. Whenever the second bit, after 0 MSB ,is 0 then the corresponding Gary code is 0 else its 1. 3. Whenever the second bit, after 1 MSB ,is 0 then the corresponding Gary code is 1 else its 0. 4. Whenever the last bit, after 00 ,is 0 then the corresponding Gary code is 0 else its 1. 5. Whenever the last bit, after 01 ,is 0 then the corresponding Gary code is 1 else its 0. 6. Whenever the last bit, after 10 ,is 0 then the corresponding Gary code is 0 else its 1. 7. Whenever the last bit, after 11 ,is 0 then the corresponding Gary code is 1 else its 0.
0 1 2 3 4 5 6 7
Draw State diagram using the state table given in the previous slide Then using the appropriate state assignment and K-Map realization , design the system.
Sequence Detector
This is special type of systems which is used whenever we need to check a particular pattern in the input sequence Suppose input to the system is serial and we have to design the system such that whenever 101 is detected in the input, output will be 1. INPUT : 10010001001010100 OUTPUT : 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0
There are two types of sequence detector. (a) overlapping sequence detector (b) non-overlapping sequence detector
In (a), we consider the input bit which may be common or overlapping while deciding a pattern or desired sequence in the input bit stream. Lets take example of sequence detector for 101. If input bit sequence is 01010101. , then output expected is 00010101 since when fourth bit is received , pattern 101 is received first time and output is available. After that if two bits received are 0 , 1 , then the 1 that is already there while forming pattern of 1 0 1 for the first time will again form patter along with the two bit 0 ,1. so output will be 1 again on 6th input bit, i.e the 1 in the 4th location in the input is common in both 101 pattern before and after this 1.
In (b) we need not to consider the input under overlapping condition ie for obtaining desired sequence, a input bits can not be considered more then once. How to draw state diagram for sequence detector The input to the system is serially. Lets input is X and output is Z. 101, sequence detector means out Z=1 whenever in the input stream X, we have 101 pattern ie for 01010101. , as input stream , then output Z expected is 00010101.
EXAMPLE: Draw state diagram for 3 bit palindrome checker i.e. a system is taking input bit serially and output will be 1 when the three bits form a palindrome sequence.