Lab #10: Design of Finite State Machines

Similar documents
Synchronous Sequential Logic

Synchronous Sequential Circuit Design. Digital Computer Design

Finite State Machine (FSM)

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Clocked Synchronous State-machine Analysis

ENGR4300 Fall 2005 Test 3A. Name. Section. Question 1 (25 points) Question 2 (25 points) Question 3 (25 points) Question 4 (25 points)

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Topic 8: Sequential Circuits

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

11.1 As mentioned in Experiment 10, sequential logic circuits are a type of logic circuit where the output of

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

Mealy & Moore Machines

Digital Fundamentals

Different encodings generate different circuits

Digital Electronics Final Examination. Part A

Digital Circuits. 1. Inputs & Outputs are quantized at two levels. 2. Binary arithmetic, only digits are 0 & 1. Position indicates power of 2.

Total time is: 1 setup, 2 AND, 3 XOR, 1 delay = (1*1) + (2*2) + (3*3) + (1*1) = 15ns

CE1911 LECTURE FSM DESIGN PRACTICE DAY 1

Where, τ is in seconds, R is in ohms and C in Farads. Objective of The Experiment

Problem Set 9 Solutions

Lecture 10: Synchronous Sequential Circuits Design

EXPERIMENT Traffic Light Controller

Topic 8: Sequential Circuits. Bistable Devices. S-R Latches. Consider the following element. Readings : Patterson & Hennesy, Appendix B.4 - B.

Sequential Synchronous Circuit Analysis

or 0101 Machine

BER KELEY D AV IS IR VINE LOS AN GELES RIVERS IDE SAN D IEGO S AN FRANCISCO

Models for representing sequential circuits

Digital Logic and Design (Course Code: EE222) Lecture 19: Sequential Circuits Contd..

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

Experiment 7: Magnitude comparators

Synchronous Sequential Logic Part I. BME208 Logic Circuits Yalçın İŞLER

Fundamentals of Digital Design

PSEUDORANDOM BINARY SEQUENCES GENERATOR

CHW 261: Logic Design

COE 328 Final Exam 2008

EGR224 F 18 Assignment #4

Digital Fundamentals

Chapter 5 Synchronous Sequential Logic

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Digital Control of Electric Drives

Synchronous Sequential Circuit Design. Dr. Ehab A. H. AL-Hialy Page 1

Laboratory Exercise #8 Introduction to Sequential Logic

Homework #4. CSE 140 Summer Session Instructor: Mohsen Imani. Only a subset of questions will be graded

Laboratory Exercise #11 A Simple Digital Combination Lock

Parity Checker Example. EECS150 - Digital Design Lecture 9 - Finite State Machines 1. Formal Design Process. Formal Design Process

PGT104 Digital Electronics. PGT104 Digital Electronics

Finite State Machine. By : Ali Mustafa

Sequential Logic Circuits

Ch 9. Sequential Logic Technologies. IX - Sequential Logic Technology Contemporary Logic Design 1

WORKBOOK. Try Yourself Questions. Electrical Engineering Digital Electronics. Detailed Explanations of

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Shift Register Counters

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Sequential vs. Combinational

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

FSM Examples. Young Won Lim 11/6/15

Synchronous Sequential Logic Part I

EE 209 Logic Cumulative Exam Name:

MOSIS REPORT. Spring MOSIS Report 1. MOSIS Report 2. MOSIS Report 3

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

EET 310 Flip-Flops 11/17/2011 1

Lecture (08) Synchronous Sequential Logic

State Machines ELCTEC-131

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

CS61C : Machine Structures

Design of Datapath Controllers

Chapter 4. Sequential Logic Circuits

CSE140L: Components and Design Techniques for Digital Systems Lab. FSMs. Instructor: Mohsen Imani. Slides from Tajana Simunic Rosing

FYSE420 DIGITAL ELECTRONICS

ELCT201: DIGITAL LOGIC DESIGN

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Review for Final Exam

NOTE: The Flatpak version has the same pinouts (Connection Diagram) as the Dual In-Line Package. *MR for LS160A and LS161A *SR for LS162A and LS163A

Gates and Flip-Flops

ENGR-4300 Fall 2008 Test 3. Name SOLUTION. Section 1(MR 8:00) 2(TF 2:00) (circle one) Question I (20 points) Question II (15 points)

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Written exam with solutions IE1204/5 Digital Design Monday 23/

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

CSE 140 Midterm 2 Tajana Simunic Rosing. Spring 2008

ECE380 Digital Logic. Synchronous sequential circuits

Written reexam with solutions for IE1204/5 Digital Design Monday 14/

Example: vending machine

Digital Electronics Circuits 2017

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

CprE 281: Digital Logic

04. What is the Mod number of the counter circuit shown below? Assume initially reset.

State & Finite State Machines

UNIVERSITY OF WISCONSIN MADISON

EECS 270 Midterm 2 Exam Answer Key Winter 2017

State and Finite State Machines

Lecture 17: Designing Sequential Systems Using Flip Flops

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Digital Design. Sequential Logic

Simulation of Logic Primitives and Dynamic D-latch with Verilog-XL

Experiment 9 Sequential Circuits

Transcription:

Lab #10: Design of Finite State Machines ECE/COE 0501 Date of Experiment: 3/1/2017 Report Written: 3/4/2017 Submission Date: 3/15/2017 Nicholas Haver nicholas.haver@pitt.edu 1 H a v e r

PURPOSE The purpose of this lab was to design, simulate, build, and test a synchronous finite state machine. The overall purpose of the circuit was to output one of four possible bit strings, depending on a two-bit input. The circuit was a simple pulse width modulation motor controller. The circuit was designed as a Mealy Machine, with the state of the circuit stored in 74LS74A D flip-flops. While a Mealy Machine requires fewer states and inputs than a Moore Machine, the corresponding logic is usually more complex. After completing initial design on paper, the circuit was designed and simulated in Altera Quartus II. The circuit was then constructed on a breadboard, and its function was compared to that predicted by the simulation. In constructing the circuit in the real world, time delays more accurate than those generated by Altera Quartus II are able to be observed. PROCEDURE 1) The circuit was designed given the following input/output specifications: A B Z 0 0 0000000100000001 0 1 0000011100000111 1 0 0001111100011111 1 1 0111111101111111 Table 1: Given inputs and outputs for finite state machine design 2) Given the specifications in Table 1, a state transition diagram was created, showing the next state for each combination of inputs and present states, and a state table, shown in Table 2, was determined. 3) Based on the state table, K-maps, shown in Tables 3-6, were used to determine the input logic (Equations 1-3) for each of the three D input bits (D2, D1, D0), as well as the output bit Z (Equation 4). 4) Based on the input and output logic, the required number of gates and integrated circuits was calculated, shown in Table 7. 5) A schematic was designed in the graphic editor of Altera Quartus II using 7474 D flip-flops, as shown in Figure 1. As shown, the presets and clears were set to high. 6) A clock square wave with a period of 40ns and each combination of the two input bits were constructed in a vector waveform file and the circuit was compiled and simulated in Altera Quartus II, shown in Figure 2. 7) After the schematic was tested and correct functionality was confirmed, the circuit was constructed on the breadboard. Two non-inverted logic sources were used for the inputs. The following integrated circuits were used: 555 (timer), 7474 (dual D flip-flop), 7408 (AND gate), 7432 (OR gate), and 7486 (XOR gate). 8) After constructing the circuit, the clock and output signals were observed in the oscilloscope to verify circuit functionality, and the circuit was checked by a TA. 9) The circuit was optimized to minimize the length of wire used. 10) The clock signal, inputs X1 and X0, and output Z were connected to a logic analyzer, and a waveform display was generated to verify that the circuit was functioning properly. 2 H a v e r

RESULTS A B Q 2 Q 1 Q 0 Q(t+1) 2 Q(t+1) 1 Q(t+1) 0 Z D 2 D 1 D 0 0 0 0 0 0 0 0 1 0 0 0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0 = 0 X 0 = 1 Q 2Q 1/Q 0X 1 00 01 11 10 Q 2Q 1/Q 0X 1 00 01 11 10 00 0 0 0 0 00 0 0 1 0 01 0 0 1 0 01 0 1 1 0 11 0 1 1 1 11 1 1 1 1 10 0 1 1 0 10 0 1 1 0 Table 6: Z Output Logic K-Map Z = Q 2 X 1 + Q 2 Q 1 Q 0 + Q 1 Q 0 X 1 + Q 2 Q 1 X 0 + Q 0 X 1 X 0 + Q 1 X 1 X 0 + Q 2 Q 0 X 0 Z = (Q 2 X 1 )(Q 1 Q 0 + Q 0 X 0 + Q 1 X 0 ) Q 2 X 1 (4) Logic Gates Packs XOR 4 1 AND 6 2 OR 2 1 D Flip-Flop 4 2 Table 7: Required Gates/Packs for Input / Output Logic Figure 1: Schematic that was built and simulated in Altera Quartus II prior to real circuit construction Figure 2: Altera Quartus II simulation of Figure 1 schematic 4 H a v e r

After observing output Z on the oscilloscope, the clock (CLK 1), X0 (D2), X1 (D1), and Z(D0) were wired up to the Intronix LogicPort logic analyzer. The outputs for each of the 4 combinations of inputs are shown in Figures 3 6. Figure 3: Logic output for inputs X 0 = 0 and X 1 = 0 Figure 4: Logic output for inputs X 0 = 1 and X 1 = 0 Figure 5: Logic output for X 0 = 0 and X 1 = 1 Figure 6: Logic output for X 0 = 1 and X 1 = 1 Figure 7: 74LS74A dual D flip-flop pin configuration Figure 8: 74LS74A dual D flip-flop logic diagram 5 H a v e r

For circuit construction on the breadboard, 74LS74A integrated circuits were used. The circuits each contain 2 rising edge-triggered D flip-flops, so 2 integrated circuits were used. The pin configuration and logic diagram for the 74LS74A are shown in Figure 7 and Figure 8. Figure 9: 555 Timer chip pin configuration and characteristic equations To generate the clock signal, a 555 timer chip was used. The period and duty cycle can be configured based on the resistor and capacitor values shown in the schematic. Equation 5 relates the clock period to the resistor and capacitor values used as shown in Figure 9. T = 0.693 (R fa + 2R fb ) C f (5) To implement the input logic for D2, D1, and D0, as well as the output logic for Z, AND, OR, and XOR integrated circuits were used. Circuit diagram for integrated circuits 7408 (AND), 7432 (OR), and 7486 (XOR) are shown in Figure 10, Figure 11, and Figure 12. 6 H a v e r

Figure 10: Logic diagram and pin configuration for 7408 AND integrated circuit Figure 11: Logic diagram and pin configuration for 7432 OR integrated circuit 7 H a v e r

Figure 12: Logic diagram and pin configuration for 7486 XOR integrated circuit CONCLUSION This experiment required the design, simulation, construction and testing of a synchronous finite state machine. After designing and simulating the circuit using Altera Quartus II, the circuit was constructed on a breadboard using two 74LS74A dual D flip-flop integrated circuits. A state transition diagram and state table were created to determine the input logic for the D inputs, and the output logic for the Z output. Using K-maps, the logic was optimized, and a circuit was constructed using AND, OR, and XOR gates, and a 555 timer chip for the clock signal. Using the Intronix LogicPort logic analyzer, the outputs Q2, Q1, Q0, and Z were observed for each combination of the two input bits X1 and X0. The overall purpose of the circuit was to output one of four possible bit strings, depending on a two-bit input. The circuit was a simple pulse width modulation motor controller and could be used in applications such as controlling a variable speed motor. REFERENCES Dr. Alex Jones s laboratory instructions ECE/COE 0501 Lab Manual Data sheets for 555, 7474, 7408, 7432, and 7486 integrated circuits Lab Partner: Jenn Gingerich 8 H a v e r