SlideServe
Menu
Préférences
© SlideServe · v2026

Finite State Machine

johana avatar
16 diapositives · 476 Views · Aug 07, 2012

Finite State Machine. Switching and Logic Lab Standard Laboratory Exercises. Suggestions and Warnings. Read for detail and comprehension Should be able to complete within normal laboratory period.

Finite State Machine - slide 1
01 / 16Finite State Machine
1 / 17

Télécharger la présentation

Finite State Machine
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Finite State Machine Switching and Logic Lab Standard Laboratory Exercises

  2. Suggestions and Warnings • Read for detail and comprehension • Should be able to complete within normal laboratory period. • Make sure you program unused pins as tri-state inputs or you may burnout EPM7128S device on PLDT-2.

  3. Vending Machines • Project 1 -- Basic Vending Machine • Combinational Logic • State • Moore Outputs • Sequential Devices -- D Flip-Flops • Project 2 -- Modified Vending Machine • Provides change • Add state and modify transitions

  4. State Diagram 2 State Bits

  5. Vending Entity ENTITY Vending IS PORT ( Nickel, Dime, Reset, Clk : IN BIT; Dispense : OUT BIT ); END Vending;

  6. Vending Architecture ARCHITECTURE Moore OF Vending IS TYPE State_Type is (ZeroCents,FiveCents,TenCents, FifteenCents); SIGNAL State : State_Type; BEGIN --FSM Logic --Moore Output logic goes here END Moore;

  7. Finite State Machine Logic --FSM Logic Goes Here FSM: PROCESS BEGIN IF Reset = '1' THEN State <= ZeroCents; ELSIF (CLK'event AND Clk = '1') THEN • • • • • END PROCESS FSM; Sequential Process Statement

  8. Moore Output Logic --Moore Output logic goes here Output: PROCESS(State) BEGIN CASE State IS WHEN FifteenCents => Dispense <= '1'; WHEN Others => Dispense <= '0'; END CASE; END PROCESS Output; Dispense = State_Bit_0 & State_Bit_1;1 1Technology Map Netlist Viewer

  9. State Logic CASE State IS WHEN ZeroCents => IF Dime = '1' THEN State <= TenCents; ELSIF Nickel = '1' THEN State <= FiveCents; ELSE State <= ZeroCents; END IF; WHEN FiveCents => IF Dime = '1' THEN State <= FifteenCents; ELSIF Nickel = '1' THEN State <= TenCents; ELSE State <= FiveCents; END IF;

  10. State Logic (Continued) WHEN TenCents => IF Dime = '1' THEN State <= FifteenCents; ELSIF Nickel = '1' THEN State <= FifteenCents; ELSE State <= TenCents; END IF; WHEN FifteenCents => IF Reset = '1' THEN State <= ZeroCents; ELSE State <= FifteenCents; END IF; END CASE;

  11. State Equations1 State_Bit_1.T = Dime & !State_Bit_1 + !State_Bit_1 & State_Bit_0 &Nickel State_Bit_1.Clk = Clk State_Bit_1.Rst = Reset State_Bit_0.D = !(Dime & !State_Bit_0 & State_Bit_1 + Nickel & Dime & !State_Bit_0 & State_Bit_1 + !Nickel & !Dime & ! State_Bit_0 State_Bit_0.Clk = Clk State_Bit_0.Rst = Reset 1Technology Map Netlist Viewer

  12. Simulation & Verification Scenarios • Nickel, Nickel, Nickel  Dispense • Nickel, Dime  Dispense • Dime, Dime  Dispense • Nickel, Nickel, Dime  Dispense • Do not violate setup and hold time in simulation

  13. 8 Steps to Success • Create Project (tri-state as input all unused pins) • Capture Logic • Analysis and Synthesis • Pin Assignments • Full Compile • Timing Simulation • Programming • Exercise circuit

  14. Revised Vending Machine • Gives nickel change from 20¢ • Does not require reset after 15¢ and 20 ¢ states. 20¢ Change, Dis 0¢ 5¢ 10¢ 15¢ Dis Reset

  15. 8 Steps to Success • Create Project (tri-state as input all unused pins) • Capture Logic • Analysis and Synthesis • Pin Assignments • Full Compile • Timing Simulation • Programming • Exercise circuit

  16. Unused Pins as Tri-State Inputs • Select “Assignments” • Select “Device” • Select “Device & Pin Options” • Select “Unused Pins” Tab • Select “As inputs, tri-stated” • OK