LOOK-UP-TABLES (LUTS) V6

Similar documents
CHAPTER 11: Flip Flops

Lab 1: Introduction to Xilinx ISE Tutorial

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

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

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.

The 104 Duke_ACC Machine

EXPERIMENT 8. Flip-Flops and Sequential Circuits

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

Digital Controller for Pedestrian Crossing and Traffic Lights

The components. E3: Digital electronics. Goals:

Counters and Decoders

GLOLAB Two Wire Stepper Motor Positioner

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Let s put together a Manual Processor

CS311 Lecture: Sequential Circuits

Lecture 8: Synchronous Digital Systems

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

FPGA Implementation of an Advanced Traffic Light Controller using Verilog HDL

Modeling Latches and Flip-flops

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

EC313 - VHDL State Machine Example

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

Master/Slave Flip Flops

A New Paradigm for Synchronous State Machine Design in Verilog

Lesson 12 Sequential Circuits: Flip-Flops

Quartus II Introduction Using VHDL Design

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

RAM & ROM Based Digital Design. ECE 152A Winter 2012

isppac-powr1220at8 I 2 C Hardware Verification Utility User s Guide

SECTION LOW VOLTAGE LIGHTING CONTROLS

Audio Science Sound Card Configuration for Simian

ROCK BAND 3 WIRELESS KEYBOARD:

Active Learning in the Introduction to Digital Logic Design Laboratory Course

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

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

SEQUENTIAL CIRCUITS. Block diagram. Flip Flop. S-R Flip Flop. Block Diagram. Circuit Diagram

Programming Timers CHAPTER 4-1 GOALS AND OBJECTIVES 4-2 MECHANICAL TIMING RELAYS

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

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

Digital Logic Elements, Clock, and Memory Elements

RAPID PROTOTYPING OF DIGITAL SYSTEMS Second Edition

Physics 226 FPGA Lab #1 SP Wakely. Terasic DE0 Board. Getting Started

PUSH BUTTON START INSTALLATION MANUAL

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

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

Transformerless UPS systems and the 9900 By: John Steele, EIT Engineering Manager

BINARY CODED DECIMAL: B.C.D.

ASYNCHRONOUS COUNTERS

Photoillustration: Harold A. Perry; photos: Jupiter Images

Module 3: Floyd, Digital Fundamental

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

2. Scope of the DE0 Board and Supporting Material

Chapter 2 Logic Gates and Introduction to Computer Architecture

Ping Pong Game with Touch-screen. March 2012

The RIDZ 8x2 Audio Switcher

Chapter 9 Latches, Flip-Flops, and Timers

Ultrasound Distance Measurement

Lab 17: Building a 4-Digit 7-Segment LED Decoder

Programming A PLC. Standard Instructions

No serious hazards are involved in this laboratory experiment, but be careful to connect the components with the proper polarity to avoid damage.

Single Channel Loop Detector

(Refer Slide Time: 00:01:16 min)

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

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER

ELEC EXPERIMENT 1 Basic Digital Logic Circuits

Switch board datasheet EB

Microprocessor & Assembly Language

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

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

Programming PIC Microcontrollers in PicBasic Pro Lesson 1 Cornerstone Electronics Technology and Robotics II

GAME SYSTEM MANUAL PITTSBURGH MODULAR SYNTHESIZERS

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

cs281: Introduction to Computer Systems Lab08 Interrupt Handling and Stepper Motor Controller

Using Altera MAX Series as Microcontroller I/O Expanders

An Introduction to MPLAB Integrated Development Environment

Figure 8-1 Four Possible Results of Adding Two Bits

PLL frequency synthesizer

Making Basic Measurements. Publication Number August Training Kit for the Agilent Technologies Series Logic Analysis System

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

CHAPTER 11 LATCHES AND FLIP-FLOPS

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

Introduction to LogixPro - Lab

Basic Logic Gates Richard E. Haskell

Inwall 4 Input / 4 Output Module

Lab 1: Full Adder 0.0

9/14/ :38

SYSTEM 7000 IRIS+ USER MANUAL

ENEE 244 (01**). Spring Homework 5. Due back in class on Friday, April 28.

DEPARTMENT OF INFORMATION TECHNLOGY

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

DS1621 Digital Thermometer and Thermostat

How to read this guide

Implementation of Web-Server Using Altera DE2-70 FPGA Development Kit

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

Design and Implementation of Vending Machine using Verilog HDL

ECEN 1400, Introduction to Analog and Digital Electronics

Fuel Cell Characterization Lab

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

Transcription:

LOOK-UP-TABLES (LUTS) V6 Safety: In this lab, voltages are less than 5 volts and this is not normally dangerous to humans. On the other hand, static electrical charge from humans can harm FET-based logic circuits. Discharge static electricity accumulated on your body by first touching a grounded metal surface before touching the logic circuits. Be CAREFUL of sharp connector pins that can puncture skin. Objective: To introduce students to the look look-up table (LUT), the basic building block of Field Programmable Gate Arrays (FPGAs). To design and implement a state machine for a foxduck-corn game using look-up tables. Introduction: A FPGA is an integrated circuit containing logic blocks such as look-up tables (LUT) and flip-flops. As opposed to application specific integrated circuit (ASIC), the FPGA can be programmed by the user to realize custom-designed logic. Programming is accomplished using a hardware descriptive language (HDL), such as VHDL or Verilog. In the labs you have previously done, the FPGA has been pre pre-programmed to provide logic components such as AND gates and flip-flops and the student connected these components together. This experiment is designed to provide students with more insight into the structure of a field programmable gate array (FPGA). A look up table (LUT) is a memory with a one-bit output that essentially implements a truth table where each input combination generates a certain logic output. The input combination is referred to as an address. The HDL synthesizer implements an AND gate or other simple logic function by programming the stored elements in a LUT. In this experiment, you will program three pre-built LUTs and develop a state machine to implement the fox-duck-corn game described below. When finished, you will be able to play the game. A man went on a trip with a fox, a duck and an open can of corn. He came upon a river and a tiny boat to cross the river but he could only take himself and one other - the fox, the duck, or the corn - at a time. He could not leave the fox alone with the duck or the duck alone with the corn. How does he get all safely over the river? Implementation: You are to use the DE2 board (containing the Altera Cyclone II FPGA) as the controller, where you will develop the state machine of the game. The more complicated parts of the state machine are pre-programmed for you. Connect the controller to a pre-built external breadboard containing four pushbuttons and eight LEDs. Four LEDs indicate the man, fox, duck and corn on the near side of the river (logic zero) and four LEDs indicate their arrival on the far side of the river (logic one). Three pushbuttons initiate a crossing for the man plus the fox or the duck or the corn, and one causes the man to cross the river on his own. In the first part of the lab, you will design and implement the combinational logic that drives the next state of the man, fox, duck and corn. Revised Mar 23, 2010

UProcedure: University of Saskatchewan 1. Fox Logic - Complete the following next state table according to the game description Definitions: curm (current state of the man), curf (current state of the fox), inf (the control input of bringing the fox over the river), nextf (next state of the fox). Remember that the fox cannot move unless the man is on the same side of the river as the fox. 2. Power up the DE2 board and use SW17-14 to set configuration to 10. Program look-up table #1 (LUT-1) with the above truth table using the following method: Set SW1 SW0 (and its decimal value shown in HEX5) to 1. Press KEY1 to advance the LUT 1 address which is displayed in HEX4. For each address, press KEY0 to toggle the LUT output which is displayed in LEDG0. All contents of the LUT can be reset to 0 by pressing KEY2 Verify the functionality of your LUT entry using SW3 SW5 and LEDG1 3. Duck & Corn Logic - Upon further examination of the game, it turns out that the next state table of the duck and the corn are very similar. Design and write out the next state table of the duck and the corn. As in Part 2, program LUT-2 and LUT-3 with the truth table for the duck and corn respectively. Connect LUT outputs and inputs to D-FFs to form a state machine. Note the pre-determined order of the D-FFs shown in Figure 3. 4. Man & Boat Logic - The design of the next state table of the man has 5 inputs and is too complex for the purpose of this lab, so it is already implemented for you. The output is nextman on pin 35 of daughter board B. 2

5. Game Logic This has been pre-programmed for you. The FPGA in the DE2 board is programmed such that the fault states (when the fox eats the duck and when the duck eats the corn) and the winning state are detected internally and displayed. Furthermore, HEX1 HEX0 are programmed to count the number of tries the player does. A 1 khz system clock is generated internally and is connected to the clock inputs of the D flip-flops. There are also 4 inputs dedicated for the inputs of the pushbuttons. These inputs are debounced internally and the one-shot outputs (inmanout,.., incornout) are available for connection to the state machine LUTs. The one-shot outputs pulse high for only one clock period. KEY3 is programmed as the game reset which resets all the states to 0. 6. Display Board Obtain from the technicians a white breadboard circuit and connect to the DE2 board. The controller has 8 Flip Flop outputs to drive the LEDs and 4 inputs (inman,., incorn) which connect to switches. The LEDs have four coulours: Green (man), Red (fox), Duck (orange) and Corn (yellow) 7. Play the Game Verify the function of the game and try to fool the logic you have created. 8. State Diagram Complete the following state diagram for the game. There are 16 states: one is the starting state, one is the desired finish state, and there are 6 fault states where something gets eaten. Include the state transition links showing the push button inputs. Assume that only one button can be pushed at a time thus there are four ways to try to leave each state. Figure 1. State Diagram of Fox-Duck-Corn Game 9. Questions Are there any unreachable states in this state machine? How many possible winning sequences are there in the game? What are they? 3

UAppendix: University of Saskatchewan Fox logic notes: - If the man and the fox are on the different sides of the river, the state of the fox is unchanged unchanged, regardless of any other inputs. If the man and the fox are on the same side of the river and the control to bring the fox over is pressed, the fox and the man will move to the opposite side of the river. If the man and the fox are on the same side of the river and the control to bring the fox over is not pressed, then the fox will not change sides. State machine notes: - a conceptually simple approach to the state machine would be to use a 8- bit by 4-bit memory (256 locations, each with 4 bit content). The memory address would be composed of 4 bits of input information plus 4 bits of current state. This laboratory partitions the contol logic into 4 look up tables and thereby uses much less memory in the FPGA. DE2 Board setup: - Connect the DE-2 board to 120 Vac supply and switch on using the red button. Slide the switches SW0, SW1, SW17 to the off position (toward the lower edge of the board) then Slide SW17 and SW15 to the on position and the display should change from 00 to 10. If not already in place, insert the I/O daughter-boards A (on left) and B (on right). Figure 2. DE2 Board Layout Breadboard Circuit: - The push buttons on the white breadboard output a logic 0 when pressed and this starts the one-shot pulse. The LEDs light in response to a logic 1 from the DE2 board. Power and ground must be supplied from the DE2 board to the breadboard. 4

Figure 3. Daughter Board Inputs and Outputs Revised Mar 23, 2010