CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are...

54
CHAPTER 5 SEQUENTIAL LOGIC INEL 4205 LOGIC CIRCUITS SPRING 2008

Transcript of CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are...

Page 1: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

CHAPTER 5SEQUENTIAL LOGIC

INEL 4205 LOGIC CIRCUITS

SPRING 2008

Page 2: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 3: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 4: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 5: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 6: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 7: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 8: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 9: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 10: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 11: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 12: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 13: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 14: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 15: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

STATE EQUATIONS OR TRANSITION EQUATIONS

OUTPUT BOOLEAN EQUATION

Page 16: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

/0 REPRESENTS THE OUTPUTDURING THE PRESENT STATE

WITH THE GIVEN INPUT

MEALY FINITE STATE MACHINE (FSM) – OUTPUT IS A FUNCTION OF PRESENT STATE AND INPUT

Page 17: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

1. FIND THE STATE TABLE2. DRAW THE STATE DIAGRAM

EXAMPLE:

Page 18: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 19: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 20: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 21: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 22: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 23: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

MOORE FSMOUTPUT IS A FUNCTION

OF PRESENT STATE ONLY

Page 24: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 25: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

DESIGN PROCEDURE

Page 26: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

STATE REDUCTION

STATES ARE APPLICATION-DEPENDANT. THE NAMES GIVEN HERE (A,B,C,D,…)

ARE ARBITRARY.IT IS ASSUMED THAT ONLY THE OUTPUT

RESPONSE TO A GIVEN SEQUENCE OF INPUTS IS IMPORTANT.

Page 27: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 28: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 29: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 30: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 31: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 32: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

SEQUENCE DETECTOR: CIRCUIT THAT DETECTS 3 CONSECUTIVE 1’S IN A STRING OF BITS COMING THROUGH THE INPUT LINE

Page 33: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 34: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 35: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

USING JK OR T FLIP-FLOPS

Page 36: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 37: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 38: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 39: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

STATE ASSIGNMENT GUIDELINES

ASSIGN NEIGHBORING CODES IF STATES HAVE THE SAME

NEXT STATE (G1)

PREVIOUS STATE (G2)

OUTPUTS (G3)

PRIORITIZE STATE COMBINATIONS FOR WHICH G1, G2, G3 APPLY MORE THAN ONCE

Page 40: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

s0

s1

s2

s3

s4

s5

s6

0/0

1/1

1/0

1/0

1/0

1/0

1/0

1/0

0/0

0/0

0/0

0/0

0/1

0/0

SEQUENCE DETECTOR FOR 010 OR 1001

presentnext

x=0 x1output

x=0 x=1

s0 s1 s4 0 0

s1 s1 s2 0 0

s2 s3 s4 1 0

s3 s6 s2 0 0

s4 s5 s4 0 0

s5 s6 s2 0 0

s6 s1 s2 0 1S3 & S5 ARE EQUIVALENT

Page 41: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

presentnext

x=0 x1output

x=0 x=1

s0 s1 s4 0 0

s1 s1 s2 0 0

s2 s3 s4 1 0

s3 s6 s2 0 0

s4 s3 s4 0 0

s6 s1 s2 0 1

SEQUENCE DETECTOR FOR 010 OR 1001 (CONT)

(S0,S1,S6), (S2, S4), (S0,S2,S4), (S1,S3,S6) G1

(S1,S2), (S3,S4) G2 ✕ 2

(S0, S1, S3, S4) G3

OO O1 11 1O

0 s0 s1 s6 X

1 s4 s2 X s3

ONE POSSIBILITY

Page 42: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

presentNext output

x=0 x=1 x=0 x=1

s0 OOO OO1 1OO 0 0

s1 OO1 OO1 1O1 0 0

s2 1O1 11O 1OO 1 0

s3 11O O11 1O1 0 0

s4 1OO 11O 1OO 0 0

s6 O11 OO1 1O1 0 1

SEQUENCE DETECTOR FOR 010 OR 1001 (CONT)

Page 43: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 44: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 45: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 46: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 47: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 48: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 49: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

EXERCISE

DRAW THE STATE DIAGRAM FOR A CIRCUIT THAT DETECTS THE SEQUENCE “0101” (LEFT-TO-RIGHT) USING

A MOORE FINITE STATE MACHINE (FSM)

A MEALY FSM

Page 50: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

EXERCISE

FOR A CLOCKED SYNCHRONOUS STATE MACHINE WITH TWO INPUTS, X AND Y, AND ONE OUTPUT, Z, THE OUTPUT SHOULD BE 1 IF THE NUMBER OF 1 INPUTS ON X AND Y SINCE RESET IS A MULTIPLE OF 4, AND 0 OTHERWISE. DRAW THE STATE DIAGRAM FOR A

MOORE MACHINE

MEALY MACHINE

Page 51: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that

EXERCISE

DESIGN A CIRCUIT TO DETECT THE SEQUENCE D0D1D2D3D4=01101, WHERE D0 IS THE FIRST BIT TO ARRIVE AT INPUT “X”. THE OUTPUT “Y” SHOULD BE A LOGIC-1 FOR A FULL CLOCK CYCLE FOLLOWING DETECTION OF THE SEQUENCE.

DRAW A STATE DIAGRAM

ASSIGN BINARY STATES

WRITE A STATE TABLE

FIND THE COMBINATIONAL CIRCUIT’S LOGIC EXPRESSIONS IF D, JK AND T FLIP FLOPS WILL BE USED FOR THE 1ST, 2ND AND 3RD STATE BITS, RESPECTIVELY

Page 52: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 53: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that
Page 54: CHAPTER 5 SEQUENTIAL LOGIC - ece.uprm.eduece.uprm.edu/~mtoledo/4205/ch5.pdf · states are application-dependant. the names given here (a,b,c,d,…) are arbitrary. it is assumed that