CEC 220 Digital Circuit Design Dice Game Wed, April 06 CEC 220 Digital Circuit Design Slide 1 of 15.

Slides:



Advertisements
Similar presentations
Prof. Kavita Bala and Prof. Hakim Weatherspoon CS 3410, Spring 2014 Computer Science Cornell University See P&H Appendix B.7. B.8, B.10, B.11.
Advertisements

BR 1/991 Rb?Ra? D7 or D11? Roll D2312? Sp Rb?Ra?Eq?D7? Roll Lose Win S0 S1 S2 S4 S3 S5 Fig 1: Dice Game ASM Chart.
Digital Logic Circuits (Part 2) Computer Architecture Computer Architecture.
Lecture 22: Sequential Circuits Today’s topic –Clocks and sequential circuits –Finite state machines 1.
LOGIC GATES ADDERS FLIP-FLOPS REGISTERS Digital Electronics Mark Neil - Microprocessor Course 1.
Nonlinear & Neural Networks LAB. CHAPTER 19 State Machine Design with SM charts 19.1 State Machine Charts 19.2 Derivation of SM Charts 19.3 Realization.
BR 1/991 Dice Game Chap 22 1-to-6 Cntr Adder CntbCnta Point Register Comparator dicesum Test Logic ControlControl Roll D7 D11 D2312 eq Dpathb.vhd Dpatha.vhd.
11/10/2004EE 42 fall 2004 lecture 301 Lecture #30 Finite State Machines Last lecture: –CMOS fabrication –Clocked and latched circuits This lecture: –Finite.
4/10/20081 Lab 9 RT methodology introduction Register operations Data Path Control Path ASM Example TA: Jorge Crichigno.
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
FAMU-FSU College of Engineering EEL 3705 / 3705L Digital Logic Design Fall 2006 Instructor: Dr. Michael Frank Module #8: Introduction to Sequential Logic.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
Registers and Counters
Sequential Circuits. Combinational Circuits + Storage element output depends both on previous state and input Fig. 5-1.
Chapter 10 State Machine Design. 2 State Machine Definitions State Machine: A synchronous sequential circuit consisting of a sequential logic section.
Review of Digital Logic Design Concepts OR: What I Need to Know from Digital Logic Design (EEL3705)
Computer Organization & Programming Chapter 5 Synchronous Components.
BR 1/991 Dice Game Implementation Why was dice game implemented in three 22V10 PLDs? What are the resources needed by the Dice Game? –Outputs: 6 for dice.
FINITE STATE MACHINES (FSMs)
Instructor: Alexander Stoytchev
BR 1/991 Dice Game (Chapter 22) The dice game in Chapter 22 is a good example of a Finite State Machine controlling a Datapath. –The combined FSM/Datapath.
CEC 220 Digital Circuit Design Timing Analysis of State Machines
CEC 220 Digital Circuit Design Latches and Flip-Flops Monday, March 03 CEC 220 Digital Circuit Design Slide 1 of 19.
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
CEC 220 Digital Circuit Design Sequence Detector Design Wednesday, April 01 CEC 220 Digital Circuit Design Slide 1 of 11.
CEC 220 Digital Circuit Design Mealy and Moore State Machines Friday, March 27 CEC 220 Digital Circuit Design Slide 1 of 16.
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Introduction to Sequential Logic Design Finite State-Machine Analysis.
ECE DIGITAL LOGIC LECTURE 21: FINITE STATE MACHINE Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/24/2015.
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
A latch is a temporary storage device that has two stable states (bistable). It is a basic form of memory. The S-R (Set-Reset) latch is the most basic.
CEC 220 Digital Circuit Design Latches and Flip-Flops
CEC 220 Digital Circuit Design State Machine Charts Friday, April 11 CEC 220 Digital Circuit Design Slide 1 of 13.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
Interrupt, again! Lin Zhong ELEC424, Fall 2010.
Chapter 6 Analysis of Sequential Systems Sequential Memory Feedback.
Latches-1 Feedback Circuits Two inverters, with feedback If the first input is 0, a 0 gets fed back into it If the first input is 1, a 1 gets fed back.
1 강의노트 09 Logic Design with ASM Charts: Based on Digital Systems Design Using VHDL, Chapter 5, by Charles H. Roth, Jr.
CHAPTER 11 LATCHES AND FLIP-FLOPS This chapter in the book includes: Objectives Study Guide 11.1Introduction 11.2Set-Reset Latch 11.3Gated D Latch 11.4Edge-Triggered.
Digital Design with SM Charts
1 Lecture 13: Sequential Circuits, FSM Today’s topics:  Sequential circuits  Finite state machines  Single-cycle CPU Reminder: midterm on Tue 10/20.
LATCHES AND FLIP-FLOPS
Class Exercise 1B.
Introduction to Sequential Logic Design
Clocks A clock is a free-running signal with a cycle time.
Lecture 12 Analysis of Clocked Sequential Network
Supplement on Verilog Sequential circuit examples: FSM
FIGURE 5.1 Block diagram of sequential circuit
Digital Design Lecture 9
Latches and Flip-flops
Sequential Circuits: Latches
ECE 434 Advanced Digital System L13
Elec 2607 Digital Switching Circuits
Lecture 13: Sequential Circuits, FSM
EEL 3705 / 3705L Digital Logic Design
ECE 448: Spring 2015 Lab 3 FPGA Design Flow Based on Aldec Active-HDL.
CSE 370 – Winter Sequential Logic - 1
ECE 448: Spring 2018 Lab 3 – Part 2 FPGA Design Flow Based on
EE4OI4 Engineering Design
Sequential Circuits: Latches
Instructor: Alexander Stoytchev
Supplement on Verilog Sequential circuit examples: FSM
Flip Flops Unit-4.
Instructor: Alexander Stoytchev
Finite State Machine Continued
Clocks A clock is a free-running signal with a cycle time.
Presentation transcript:

CEC 220 Digital Circuit Design Dice Game Wed, April 06 CEC 220 Digital Circuit Design Slide 1 of 15

Lecture Outline Wed, April 06 CEC 220 Digital Circuit Design Dice Game  A complex Word Problem Slide 2 of5

Dice Game Wed, April 06 CEC 220 Digital Circuit Design Implement the following dice game: 1.First Roll: Two die are thrown  The player wins if the sum is 7 or 11,  The player loses if the sum is 2, 3, or 12, otherwise  The sum is stored and referred to as the “point” and he/she must throw again. o Las Vegas Rules: The point remains fixed. 2.Second or Subsequent Roll: Two die are thrown  The player wins if the sum is equal to his/her point,  The player loses if the sum is equal to 7, otherwise  He/she must roll again until a win or loss. Slide 3 of5

Dice Game Wed, April 06 CEC 220 Digital Circuit Design Top level Interpretation  Control block is a State machine Slide 4 of5

Dice Game Wed, April 06 CEC 220 Digital Circuit Design First Problem:  How to generate a “random” roll of two dice?  Assume that the Roll signal is held high for a “long” time  Many possibilities  Must preserve “randomness” 1.A modulo 36 counter 2.Two Modulo 6 counters 3.Rising and falling edge latches 4.… Roll Slide 5 of5

Dice Game Generate the Roll signal Wed, April 06 CEC 220 Digital Circuit Design Roll signal  Pushbutton Vcc Roll = BTN3 Counting (button pressed) Not Counting Not Counting Random Duration A normally-open SPST momentary switch Slide 6 of5

Dice Game Generate a “random” roll of two dice Wed, April 06 CEC 220 Digital Circuit Design S11 D1=1,D2=1 S12 D1=1,D2=2 S16 D1=1,D2= S21 D1=2,D2=1 S22 D1=2,D2=2 S26 D1=2,D2= S61 D1=6,D2=1 S62 D1=6,D2=2 S66 D1=6,D2= A 36-state FSM clocked on the rising edge and Roll = ‘1’ Slide 7 of5

Dice Game Generate a timing diagram Friday, April 03 CEC 220 Digital Circuit Design Dice Roll Timing Diagram Clock Roll D1 State ?? 0 D2 0 Slide 8 of5

Dice Game Wed, April 06 CEC 220 Digital Circuit Design Top level Interpretation  Control block is a State machine  Inputs: o D7 = 1 is sum of dice is 7 o D711 = 1 if sum of dice is 7 or 11 o D2312 = 1 if sum of dice is 2, 3, or 12 o Eq = 1 if sum of dice is eq point reg o Rb = 1 when roll button is pressed o Reset = Async reset button  Outputs: o Roll = 1 is the counter enable o Sp = 1 causes sum to be stored in store point register o Win = 1 denotes a win o Lose = 1 denotes a loss Slide 9 of5

Dice Game – State Graph Design based on textbook solution (page 672): Wed, April 06 CEC 220 Digital Circuit Design StartS Roll1 S wait Rb/0,0 S Roll2 Rb/Roll,0 S Lose Lose S Win Win /0,0 Rb/0,0 RESET A Mealy Machine Clock on Falling Edge of 50 MHz clock Clock on Falling Edge of 50 MHz clock Outputs: o Roll = 1 enables the counter o Sp RISING edge latches “point” o Win = 1 denotes a win o Lose = 1 denotes a loss Slide 10 of5

Dice Game Generate a timing diagram Friday, April 03 CEC 220 Digital Circuit Design Dice Roll Timing Diagram Clock Rb Sum State D1,D2 Roll1 … … … Slide 11 of5

Dice Game – State Graph Design based on textbook solution (page 672): Wed, April 06 CEC 220 Digital Circuit Design S Roll1 Sp S Roll2 S Lose Lose S Win Win RESET Clock on Falling Edge of delayed Roll signal Clock on Falling Edge of delayed Roll signal A Moore Machine Outputs: o Sp FALLING edge latches “point” o Win = 1 denotes a win o Lose = 1 denotes a loss Slide 12 of5

Dice Game Generate a timing diagram Friday, April 03 CEC 220 Digital Circuit Design Dice Roll Timing Diagram Clock Rb Sum State D1,D2 Roll1 … … … Slide 13 of5

Dice Game – Debouncing a Switch Wed, April 06 CEC 220 Digital Circuit Design When are the various signals stable?  On which clock edge are they changing?  Should we try to read signals when they are changing? How can we debounce a switch  What type of switch ? o SPDT, SPST, …  If a SPDT switch then we might be able to use an S-R latch o See prior notes (latches and FFs) Slide 14 of5

Next Lecture Wed, April 06 CEC 220 Digital Circuit Design State Machine Design with SM Charts Slide 15 of5