Lab 9 - FL13 - ECE 198 JL - University of Illinois - Engineering Wiki

W hen the rst input is 1 the d flip flop s tores a 0

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: jus t want to s imulate a s pec ific s tate trans ition. W hen the rst input is 1, the D flip-flop s tores a 0 regardles s of the values of any other inputs . W hen rst is 0 and se t is 1, the D flip-flop s tores a 1 regardles s of the values of any other inputs . W hen rst and se t are 0, the loa d s ignal c ontrols whether the D flip-flop c an update its s tate in res pons e to the D and c loc k inputs . W hen loa d is 0, the flip-flop c annot c hange s tate. W hen loa d is 1, the flip-flop will s tore the value of $d$ on the nex t pos itive-edge of the c loc k . The clk input is the c loc k . The d input is the data input for the flip-flop. The q output is the s tored s tate of the flip-flop and the qb output is the c omplement of q. Add two more flip-flops to y our des ign s o that y ou c an s tore eac h of the three s tate variables (S2S1S0). Add two input ports to y our des ign. Connec t one input port to all of the rst inputs to c reate the rst s ignal, and c onnec t the other input port to all of the se t inputs to c reate the se t s ignal. Add a Vc c input and c onnec t eac h of the loa d s ignals to the Vc c input s o that the D flip-flops will alway s update whenever the se t and rst are 0. Add another input port and c onnec t it to all of the c lk inputs to c reate y our clk s ignal. Add one more input port for y our T input from the vending mac hine hardware. Add two output ports : one for A and one for P Add the nex t s tate logic y ou des igned and y our c irc uit from Lab 7 to y our s c hematic to c omplete y our des ign. Your final des ing s hould be s imilar to this : Simulating the State Machine In order to s imulate y our s tate mac hine, y ou need to better unders tand how the phy s ic al s y s tem of the vending mac hine work s , s o y ou c an abs trac t its func tionality in ModelSim. The vending mac hine ac c epts c oins by letting them roll down a ramp. Along the ramp are a s et of s ens ors . Eac h s ens or s ends a 0 when no c oin is in front of the s ens or. So as long as no c oin is ins erted, both the T s ens or and c loc k s ens or s end out 0s . W hen a dime is ins erted, it will roll under the T s ens or (without bloc k ing it) and then briefly roll in front of the c loc k s ens or c reating a c loc k puls e (the c loc k ris es from 0 to 1 and then returns from 1 bac k to 0). Cons equently , the c oin s lot will s end a c loc k puls e s ignal that will update t...
View Full Document

Ask a homework question - tutors are online