Digital Logic & Design Dr. Waseem Ikram Lecture 38
Recap
Equation definition for the Traffic Light Controller Equations TRSTATE.CLK = clk; TMRST := (TRSTATE = = NSY2) # (TRSTATE = = EWY2);
The circuit diagram of the Traffic Light Controller
Pin declarations for the turning on/off traffic lamps FLASHCLK, MANUAL pin 1, 2; !Q0, !Q1, !Q2 pin 4, 5, 6; NSRED, NSYEL, NSGRN pin 19, 18, 17; EWRED, EWYEL, EWGRN pin 14, 13, 12;
Switching of traffic lamps at different states NSGRN NSYEL NSRED EWGRN EWYEL EWRED NSG on off NSY NSY2 NSR EWG EWY EWY2 EWR
Equation definition for the turning on/off traffic lamps Equations NSRED = !MANUAL & (TRSTATE !=NSG) & (TRSTATE != NSY) & (TRSTATE != NSY2); NSYEL = !MANUAL & ((TRSTATE = = NSY) # (TRSTATE = = NSY2)) # MANUAL & FLASHCLK; NSGRN = !MANUAL & (TRSTATE = = NSG); EWRED = !MANUAL & (TRSTATE !=EWG) & (TRSTATE != EWY) & (TRSTATE != EWY2); EWYEL = !MANUAL & ((TRSTATE = = EWY) # (TRSTATE = = EWY2)) EWGRN = !MANUAL & (TRSTATE = = EWG);
S-R flip-flop Transition table Flip-flop Inputs Output Transitions S R Qt Qt+1 x 1
Characteristic Equation for S-R Latch SR/Qt 1 00 01 11 x 10
Characteristic equations of Latches and Flip-flops Device Type Characteristic Equation S-R Latch D Latch Edge-triggered D flip-flop J-K flip-flop
Clocked Synchronous State Machine based on D flip-flops
Excitation Equations for D flip-flop inputs D0 and D1 Excitation Inputs D0 D1
Transition Equations for D flip-flops
Transition Table for D flip-flop based State Machine Present State Next State ENABLE=0 ENABLE=1 Q1 Q0 1
State table of a Mealy Machine Present State Next State ENABLE=0 ENABLE=1 Output MAX A B C D 1
State Diagram of a Mealy Machine
State table of a Moore Machine Present State Next State ENABLE=0 ENABLE=1 Output MAX A B C D 1
State Diagram of a Moore Machine
Clocked Synchronous State Machine based on J-K flip-flops
Traffic Light Controller
Excitation Equations for J-K flip-flop inputs J0 K0 and J1 K1 Excitation Inputs J0 K0 J1 K1
Transition Equations for J-K flip-flops
Transition Table for D flip-flop based State Machine Present State Next State XY=00 XY=01 XY=10 XY=11 Q1 Q0 1
State Table of a Mealy Machine Present State Next State Output Z XY 00 01 10 11 A C B 1 D
Traffic Light Controller PLD Programming
Analysis of Synchronous State Machines
Digital Logic Design Lecture 38