Finite State Machine Lab

Similar documents
CHAPTER 11: Flip Flops

Objectives: Part 1: Build a simple power supply. CS99S Laboratory 1

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

The components. E3: Digital electronics. Goals:

1. Learn about the 555 timer integrated circuit and applications 2. Apply the 555 timer to build an infrared (IR) transmitter and receiver

ELEC EXPERIMENT 1 Basic Digital Logic Circuits

Figure 8-1 Four Possible Results of Adding Two Bits

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Electronic Circuits Spring 2007

ECEN 1400, Introduction to Analog and Digital Electronics

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

A Digital Timer Implementation using 7 Segment Displays

EXPERIMENT 8. Flip-Flops and Sequential Circuits

Lab 11 Digital Dice. Figure Digital Dice Circuit on NI ELVIS II Workstation

3-Digit Counter and Display

Electronics I - Laboratory 1 Diode I/V Characteristics

1.1 The 7493 consists of 4 flip-flops with J-K inputs unconnected. In a TTL chip, unconnected inputs

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

Operating Manual Ver.1.1

Robot Board Sub-System Testing. Abstract. Introduction and Theory. Equipment. Procedures. EE 101 Spring 2006 Date: Lab Section # Lab #6

GLOLAB Universal Telephone Hold

Decimal Number (base 10) Binary Number (base 2)

2 : BISTABLES. In this Chapter, you will find out about bistables which are the fundamental building blocks of electronic counting circuits.

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

PURDUE UNIVERSITY NORTH CENTRAL

WHO ANSWERED FIRST? FIND OUT WITH THIS QUIZ BUZZER KIT

Digital Logic Elements, Clock, and Memory Elements

Lecture 8: Synchronous Digital Systems

LAB4: Audio Synthesizer

Digital circuits make up all computers and computer systems. The operation of digital circuits is based on

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

Martin County Amateur Radio Association. Nightfire Kits 1 LED Torch Kit Contents. Description

ARRL Morse Code Oscillator, How It Works By: Mark Spencer, WA8SME

Glolab Talking Phone Dial Monitor

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs.

Design Project: Power inverter

Counters and Decoders

Technical Aspects of Creating and Assessing a Learning Environment in Digital Electronics for High School Students

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

A Lesson on Digital Clocks, One Shots and Counters

Chapter 2 Logic Gates and Introduction to Computer Architecture

GLOLAB Two Wire Stepper Motor Positioner

DEPARTMENT OF INFORMATION TECHNLOGY

Asynchronous Counters. Asynchronous Counters

Electronic Circuit Construction:

Module 3: Floyd, Digital Fundamental

TEECES DOME LIGHTING SYSTEMS

Upon completion of unit 1.1, students will be able to

Capacitive Touch Sensor Project:

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

Table 1 Comparison of DC, Uni-Polar and Bi-polar Stepper Motors

Digital Electronics Detailed Outline

CHAPTER 11 LATCHES AND FLIP-FLOPS

A Lesson on Digital Clocks, One Shots and Counters

Chapter 9 Latches, Flip-Flops, and Timers

Build A Video Switcher. Reprinted with permission from Electronics Now Magazine September 1997 issue

Tutorial. replace them with cell-phone operated module. The advantages of a cell-phone operated bot are:-

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

PLL frequency synthesizer

RUTGERS UNIVERSITY Department of Electrical and Computer Engineering 14:332:233 DIGITAL LOGIC DESIGN LABORATORY

Joule Thief 3.0 Kit. June 2012, Rev Joule Thief 3.0

Supply voltage Supervisor TL77xx Series. Author: Eilhard Haseloff

Conversion Between Analog and Digital Signals

USER GUIDE Programming Adapter Cable for Fujitsu Flash Microcontroller- F²MC-16LX/FR Family Fujitsu Microelectronics America, Inc.

DM Segment Decoder/Driver/Latch with Constant Current Source Outputs

Your Multimeter. The Arduino Uno 10/1/2012. Using Your Arduino, Breadboard and Multimeter. EAS 199A Fall Work in teams of two!

Wiki Lab Book. This week is practice for wiki usage during the project.

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

Digital Controller for Pedestrian Crossing and Traffic Lights

Electronic WorkBench tutorial

Cornerstone Electronics Technology and Robotics I Week 15 Voltage Comparators Tutorial

Gates, Circuits, and Boolean Algebra

Electronics Technology

ASYNCHRONOUS COUNTERS

Executive Summary. Table of Contents

Lab Experiment 1: The LPC 2148 Education Board

Lab 1: Introduction to Xilinx ISE Tutorial

Lab 3: PCB design with EAGLE

TRILOGI 5.3 PLC Ladder Diagram Programmer and Simulator. A tutorial prepared for IE 575 by Dr. T.C. Chang. Use On-Line Help

Asynchronous counters, except for the first block, work independently from a system clock.

PCB Design with Altium: Schematic Entry, Libraries, and Designing Components

AXE114S BINARY CLOCK. revolution Revolution Education Ltd. Web: Version /09/08 AXE114.PMD.

!Operation:!1. Connect an external power source to J1 (+ and - IN terminals). The

Ultrasound Distance Measurement

Assembly and User Guide

CHAPTER 3 Boolean Algebra and Digital Logic

Design Analysis of a Security Lock System using Pass-Code and Smart-Card

Copyright Peter R. Rony All rights reserved.

CS311 Lecture: Sequential Circuits

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

NOTE: The Flatpak version has the same pinouts (Connection Diagram) as the Dual In-Line Package.

RC2200DK Demonstration Kit User Manual

OPERATIONAL AMPLIFIERS

Pulse Width Modulation (PWM) LED Dimmer Circuit. Using a 555 Timer Chip

Ocean Controls RC Servo Motor Controller

Transcription:

Finite State Machine Module: Lab Procedures Goal: The goal of this experiment is to reinforce state machine concepts by having students design and implement a state machine using simple chips and a protoboard. This experiment also introduces students to basic physical components. Contents: Background Page 1 Prelab Page 6 Experiment Page 8 Appendix Page 11 Background: The general steps to be followed for performing state machine design include: 1) Convert a description of the problem into a state transition diagram 2) Transfer the information from the state transition diagram to a state transition logic table that has inputs consisting of system inputs and current values of the state, S i, and outputs consisting of system outputs and next state values, NS i. 3) Design a combination circuit to implement the logic in the table. 4) Select the chips to implement the combinational circuit and to implement the memory portion of the state machine, for example, D flip flops can be used to implement registers. 5) Draw a pin diagram to illustrate how to wire the chips together to implement the state machine logic. 6) Insert the chips into a protoboard and wire the ground, high voltage, enables, and clock pins. 7) Complete the circuit by making the connections indicated from Step 5). 8) Test the circuit. Notation and Definitions: States: A = 00, B = 01, C = 10, D =11 where the states are defined by the values stored in the registers; for example, State B corresponds to S 1 S 0 = 01 where S 1 is the value of Register 1 and S 0 is the value of Register 0. The next state for values of the registers is defined by NS i for Register i. For example, if the current state is B and the next state is C, then S 1 S 0 = 01 and NS 1 = 1 and NS 0 = 0. External input: The external input in this circuit is denoted as X. Debounce Circuit: A circuit to filter a chip input so that it smoothes unintended bounces in the signal. 3 to 8 Decoder: Signals A 0 A 2 represent the inputs and Y 0 -Y 7 represent the outputs. The convention is that A 2 represents the most significant bit of a binary number and A 0 represents the least significant bit; for example, and input of 011 is designated as A 2 A 1 A 0 = 011. A 0 A 1 A 2 3 to 8 decoder Y 0 Y 1 Y 2 Y 3 Y 4 Y 5 Y 6 Y 7 1

Protoboards: Protoboards (also known as breadboards) make many connections under the board in order to reduce the number of wires that you have to connect. Typically, groups of 5 holes are connected. There are also lines of groups of 5 that are all connected. See the example in Figure 1. Terminals Every hole in this vertical line is connected. This is true of every vertical line. Each horizontal group of 5 holes is connected. Figure 1: Protoboard. Integrated Chip: An integrated chip (IC) can have several gates (circuits) on it. For example, the 74HC32 IC has 4 2-input OR gates. It has 14 wire pins coming out the sides with the connections from the pins to the logic gates shown in Figure 2. pin 1 near notch Figure 2a: Pin Diagram to the 74HC32 Quad 2-input OR gate. Figure 2b: Logic gates for the 74HC32 IC. 2

Pin Connection Diagram: A pin connection diagram shows the physical layout of the connections between components. Each component is shown along with the corresponding pin numbers for that component. The pin diagram for the logic expression F = (A OR B) OR (C OR D) is shown below. The pin numbers correspond to the pins as labeled above for the 74HC32 2-input OR chip. A B C D 1 2 4 5 OR Gate 74HC32 OR Gate 74HC32 3 6 9 10 OR Gate 74HC32 8 F Figure 3: Pin diagram for F=(A+B)+(C+D) To build this circuit, you would need to connect a wire from pin 3 of the IC to pin 9, another wire from pin 6 to pin 10. Pins 1, 2, 4, and 5 are inputs and connect to outputs from other components while pin 8 is connected to an LED or an input to another component. Example: Consider a state machine defined by the state transition diagram in Figure 4. A (00) C (10) B (01) Figure 4: State Transition Diagram. 3

This state machine has the following truth table: The corresponding circuit diagram is given as: State S 1 S 0 X New State NS 1 NS 0 A 0 0 0 B 0 1 A 0 0 1 A 0 0 B 0 1 0 C 1 0 B 0 1 1 A 0 0 C 1 0 0 C 1 0 C 1 0 1 A 0 0 -- 1 1 0 -- -- -- -- 1 1 1 -- -- -- X NS 0 Decoder NS 1 S 1 S 0 CLOCK CLOCK Figure 5: State machine schematic. 4

Using the pin layouts defined in the Appendix, a pin diagram for the state machine with schematic shown in Figure 5 is To LED 0 Input from dip switch 1 2 3 A0 A1 A2 74HC238 Decoder Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 15 14 13 12 11 10 9 7 B 1 2 OR Gate 74HC32 3 2 12 D 74HC74A D flip flop D 74HC74A Q Q 5 9 To LED 1 D flip flop Figure 6: Pin diagram for state machine in Figures 1 and 2. For simplicity, some of the connections, such as ground, V cc, clock and reset are not shown. 5

Prelab: Prior to class, do the following: View the Tutorial on Fundamental Concepts Read and thoroughly understand the Example on the previous pages. View the video introducing the experiment Complete the prelab procedure given below A (00) B (01) D (11) C (10) 1) For the state transition diagram shown, complete the truth table below. STATE S 1 S 0 X NEW STATE NS 1 NS 0 A 0 0 0 A 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 6

2) Draw the circuit diagram for the state machine. Your circuit should include a decoder, two registers, and 2- or 3-input OR gates. 3) Draw the pin connection diagram for the state machine. Start with the basics of the pin diagram shown below, and complete it using Figure 5 as a guideline. Use the IC descriptions in the appendix to determine the proper pins to use. To LED 0 Input from dip switch 1 A0 A1 A2 74HC238 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 15 14 13 12 11 10 9 7 2 12 D 74HC74A D flip flop D 74HC74A Q Q 5 9 To LED 1 D flip flop 7

Experiment: Part A: Build the Finite State Machine defined in the Example section of this lab with the pin connection diagram shown in Figure 6. Two registers, two pushbuttons (RESET and CLOCK), DIP Switches, a decoder, registers, and OR gates are already placed on the breadboard. The IC diagrams and pin layouts are given in the appendix. Figure 7: Layout of the protoboard. The circuit is partially wired as shown in Figure 7: The battery pack supplies high voltage (Vcc) from the red lead and the ground (GND) from the black lead. The power routed through the uppermost dip switch, which must be turned on to power the circuits. The input to the state machine should come from a wire connected to the right side of the bottom dip switch. Vcc and GND are connected to all of the ICs. 8

The ICs are all oriented so that the upper left pin is PIN 1 (when the board is oriented as shown above). The light emitting diodes (LEDs) are connected to S 0 and to S 1. The LEDs light when the signal is 1. The reset button resets the state to State A. It is already connected to the registers. The clock button advances the clock. The register stores the values of its input and passes the value to its output after each time that the clock button is pushed. It is already connected to the registers. The resistors (small cylindrical components with stripes) are used to limit the current in some of the lines. Otherwise, the components many burn out too quickly. A debounce circuit, consisting of an additional IC and a capacitor, is connected to the clock button. A bounce is when a switch does not produce a clean signal. There may be some ripple in the signal (or perhaps a small spike) that might be interpreted by the digital logic as a second input signal, in this case, an extra clock pulse. The debounce circuit filters the signal to remove the ripple or spike. The decoder has the enable pins already wired. Steps: 1) Make sure that the power is turned off of the board prior to constructing the circuit, that is, turn off the uppermost dip switch. 2) Complete the circuit according to the PIN Connection Diagram shown in Figure 6. Use the loose lead wires that are supplied with the kit. The color of wire is insignificant. Refer to the protoboard description to see which holes are connected within the protoboard, and refer to the appendix to see the pin numbers of the ICs. 3) Turn on the power to the circuit. 4) Now, test the State Machine to make sure it is working properly. First reset the state machine to put it in state A. Set the DIP switch to 0 and then press the clock button. Determine the state from the LEDs and mark it in the table below. Change the input to 1 and press the clock button to see the next state value. Move the DIP switch to either the on or off position according to the table, and then press the clock button to change the state. Complete the table below to show the states corresponding to the given input sequence. Verify that this sequence follows the transitions as dictated by the state transition table in Figure 4. State Input State Input State Input State Input State Input State Input State Input State A 0 1 1 0 0 0 1 Instructor or TA Initials: 9

Part B: Build the Finite State Machine designed for the Prelab. 1) Turn off the power to the circuit before making any changes. 2) Remove only the wires that you added to the protoboard for Part A (do not remove the wires that were already there). 3) Build the circuit using the pin connection diagram that was completed for the Prelab. 4) When the state machine is complete, turn on the power. Reset the state machine to put it in state A, and input the following sequence into the circuit. Write down the state after each step: State Input State Input State Input State Input State Input State Input State Input State A 0 1 1 1 0 1 1 Instructor or TA Initials: When finished, pull out only the wires that you added to the circuit, and turn off the power switch. 10

Appendix Decoder IC (74HC238): Register (D-FlipFlop) IC (74HC74): 11

12

2 Input OR Gate IC (74HC32): 3 Input OR Gate IC (74HC4075B1R) 13