Main Design Project. The Counter. Introduction. Macros. Procedure

Similar documents
Main Design Project. The Counter. Introduction. Macros. Procedure

Programmable Logic Design I

Design of a Binary Number Lock (using schematic entry method) 1. Synopsis: 2. Description of the Circuit:

1. Synopsis: 2. Description of the Circuit:

ENGG2410: Digital Design Lab 5: Modular Designs and Hierarchy Using VHDL

Figure 1 Block diagram of a 4-bit binary counter

COMPUTER ENGINEERING PROGRAM

Tutorial 11 ChipscopePro, ISE 10.1 and Xilinx Simulator on the Digilent Spartan-3E board

PHYS 3322 Modern Laboratory Methods I Digital Devices

Laboratory Exercise 7

Laboratory Exercise 7

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

University of Pennsylvania Department of Electrical and Systems Engineering. Digital Design Laboratory. Lab8 Calculator

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED 2200

ELEC 204 Digital System Design LABORATORY MANUAL

ECT 224: Digital Computer Fundamentals Digital Circuit Simulation & Timing Analysis

NORTHWESTERN UNIVERSITY TECHNOLOGICAL INSTITUTE

CSCB58 - Lab 4. Prelab /3 Part I (in-lab) /1 Part II (in-lab) /1 Part III (in-lab) /2 TOTAL /8

FPGA Laboratory Assignment 4. Due Date: 06/11/2012

Lab 5 FPGA Design Flow Based on Aldec Active-HDL. Fast Reflex Game.

Programmable Logic Design Techniques II

Digital Systems Laboratory 1 IE5 / WS 2001

Table of Contents Introduction

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

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 7

Lab 13: FPGA Circuit Realization Ian Callahan

Faculty of Electrical & Electronics Engineering BEE3233 Electronics System Design. Laboratory 3: Finite State Machine (FSM)

LAB #6 State Machine, Decoder, Buffer/Driver and Seven Segment Display

ET398 LAB 4. Concurrent Statements, Selection and Process

Design Problem 4 Solutions

Lab 4: Hex Calculator

Serial FIR Filter. A Brief Study in DSP. ECE448 Spring 2011 Tuesday Section 15 points 3/8/2011 GEORGE MASON UNIVERSITY.

Ryerson University Department of Electrical and Computer Engineering COE/BME 328 Digital Systems

TSIU03: Lab 3 - VGA. Petter Källström, Mario Garrido. September 10, 2018

Laboratory 4. Figure 1: Serdes Transceiver

Lab #10 Hexadecimal-to-Seven-Segment Decoder, 4-bit Adder-Subtractor and Shift Register. Fall 2017

LAB 3 Verilog for Combinatorial Circuits

Inside Digital Design Accompany Lab Manual

Design and implementation (in VHDL) of a VGA Display and Light Sensor to run on the Nexys4DDR board Report and Signoff due Week 6 (October 4)

TSIU03, SYSTEM DESIGN. How to Describe a HW Circuit

Sequential Digital Design. Laboratory Manual. Experiment #7. Counters

Laboratory 9 Digital Circuits: Flip Flops, One-Shot, Shift Register, Ripple Counter

LAB 3 Verilog for Combinational Circuits

CSE 275 Digital Design Lab Lab 8 Serial Adder/Subtractor Penn State Erie, The Behrend College Fall Semester 2007 Number of Lab Periods: 2

HDL & High Level Synthesize (EEET 2035) Laboratory II Sequential Circuits with VHDL: DFF, Counter, TFF and Timer

University of Victoria Electrical and Computer Engineering CENG 241 Digital Design I Laboratory Manual

FPGA-BASED EDUCATIONAL LAB PLATFORM

DE2-115/FGPA README. 1. Running the DE2-115 for basic operation. 2. The code/project files. Project Files

Spartan-II Development System

Name: Date: Suggested Reading Chapter 7, Digital Systems, Principals and Applications; Tocci

LFSRs as Functional Blocks in Wireless Applications Author: Stephen Lim and Andy Miller

Digital Fundamentals: A Systems Approach

Digital. Digital. Revision: v0.19 Date: : / 76

hochschule fu r angewandte wissenschaften hamburg Prof. Dr. B. Schwarz FB Elektrotechnik/Informatik

AN ADVERTICING MODUL, DEVELOPED ON THE BASE OF A CPLD PROGRAMABLE DEVICE

VHDL Design and Implementation of FPGA Based Logic Analyzer: Work in Progress

Synchronous Sequential Logic

Lab #6: Combinational Circuits Design

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

Lab #11: Register Files

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

Lab 2: Hardware/Software Co-design with the Wimp51

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

ECE337 Lab 4 Introduction to State Machines in VHDL

Altera s Max+plus II Tutorial

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

General: Catalog Description: Grading Policy: Course Code: COE 203 Title: Digital Logic Laboratory Co-requisite(s): COE 202 (Digital Logic Design)

Spartan-II Development System

COMP2611: Computer Organization Building Sequential Logics with Logisim

Experiment # 4 Counters and Logic Analyzer

Other Flip-Flops. Lecture 27 1

SignalTap: An In-System Logic Analyzer

2. Counter Stages or Bits output bits least significant bit (LSB) most significant bit (MSB) 3. Frequency Division 4. Asynchronous Counters

Microprocessor Design

EE 101 Lab 7 Crosswalk

The University of Texas at Dallas Department of Computer Science CS 4141: Digital Systems Lab

The Waveform Generator. Today. PAR Timing Reports (1) EECS150 Fall Lab Lecture #10. Chris Fletcher

CS 254 DIGITAL LOGIC DESIGN. Universal Asynchronous Receiver/Transmitter

EECS 140 Laboratory Exercise 7 PLD Programming

MUHAMMAD NAEEM LATIF MCS 3 RD SEMESTER KHANEWAL

ECE 270 Lab Verification / Evaluation Form. Experiment 9

Chapter 5 Flip-Flops and Related Devices

Laboratory 11. Required Components: Objectives. Introduction. Digital Displays and Logic (modified from lab text by Alciatore)

Decade Counters Mod-5 counter: Decade Counter:

EEM Digital Systems II

CPE 200L LABORATORY 3: SEQUENTIAL LOGIC CIRCUITS UNIVERSITY OF NEVADA, LAS VEGAS GOALS: BACKGROUND: SR FLIP-FLOP/LATCH

Light Emitting Diodes and Digital Circuits I

Review : 2 Release Date : 2019 Last Amendment : 2013 Course Code : SKEE 2742 Procedure Number : PK-UTM-FKE-(0)-10

Physics 323. Experiment # 10 - Digital Circuits

Chapter 9 MSI Logic Circuits

PHYSICS 5620 LAB 9 Basic Digital Circuits and Flip-Flops

B2 Spice A/D Tutorial Author: B. Mealy revised: July 27, 2006

Physics 217A LAB 4 Spring 2016 Shift Registers Tri-State Bus. Part I

Laboratory 8. Digital Circuits - Counter and LED Display

Light Emitting Diodes and Digital Circuits I

Solutions to Embedded System Design Challenges Part II

Sequential Logic Design CS 64: Computer Organization and Design Logic Lecture #14

COE758 Xilinx ISE 9.2 Tutorial 2. Integrating ChipScope Pro into a project

CHAPTER 6 DESIGN OF HIGH SPEED COUNTER USING PIPELINING

Using SignalTap II in the Quartus II Software

Transcription:

Main Design Project Introduction In order to gain some experience with using macros we will exploit some of the features of our boards to construct a counter that will count from 0 to 59 with the counts displayed in two of our four 7-segment displays. In addition we will instrument one of the sliding switches to enable counting with a light emitting diode (LED) indicating its state and a push button to reset the counters momentarily to zero. The DI01 board is constructed in such a fashion that individual segments of the four displays are connected in parallel and are turned on when the particular connection is grounded. The choice of which of the four displays to activate is made by bringing the chosen display s anode to a positive logic value. Read over the description of the DI01 module, in particular the description of the seven segment displays and how the individual segments combine to form numbers. Macros In your design you will need to use several macros one of which will be the 0 to 5 counter you constructed in last week s lab and another will be a routine to translate the four bit output from the decimal counters into the pattern of 0 s and 1 s corresponding to the activated segments on a 7 segment display. This will be the file hex2led.vhd which will be provided for you. A third macro, also provided for you, will divide the 50 MHz clock down to something that we can easily display and verify. On the basis of this macro you will write another (in vhdl) to generate a toggling frequency clock which will be an input to the macro multiplexing the two 4-bit output streams from your counter onto the 7-segment display. The last macro, designed by you, will be a multiplexer to carry the two bit streams representing the two decimal digits to our seven-segment displays. Procedure Open Project Navigator and start a new project choosing schematic as the highest level module. Verify that the Device Family is Spartan2, the Device xc2s30 and the Package tq144. The Counter Find and add the source files for the counter you made in last weeks lab by doubleclicking on Add Existing Sources. To make this into a symbol, go to the schematic and check for errors by clicking Check Schematic under the tools menu; now create the symbol (see p 12). From Symbols select the counter macro CD4CE, connect signals from the clock and clear lines to both counters in parallel. Also run a wire connecting the CEO output from the CD4CE counter to the CE input of the CB4RE. Make all the appropriate connections to the input and output lines and vectors. After you are through your design should look something like that in Figure 1. Test this design by creating a Testbench Waveform and running the simulation program to see the response of the counter. Be sure to make the clock stream long enough so that more than 60 output counts are observed. This will ensure that the full functionality of the counter is tested. If your design is successful create a schematic symbol for your counter and verify that it is available as a symbol on the schematic entry page.

Figure 1: Counter Schematic Layout. The Hex to LED Converter We will use VHDL to generate this macro. 1. In Project Navigator, select Projectà New Source. The New Source dialog box opens. 2. Select the source type VHDL Module. 3. In the File Name field, type hex2led 4. Click Next. The hex2led component has a 4-bit input port named HEX and a 7-bit output port named LED. First enter the port named HEX as follows: 5. Click in the Port Name field and type HEX. 6. In the Direction field, set the direction to in. 7. Check Bus. 8. In the MSB field enter 3, and in the LSB field, enter 0. 9. Repeat the previous steps for the LED(6:0) output bus. Be sure that the direction is set to out. 14

10. Select Next to complete the Wizard session. 11. Select Finish. The skeleton HDL file opens in the ISE Text Editor. In the HDL file, the ports are already declared and some of the basic file structure is already in place. Key words are displayed in blue, data types in red, comments in green and values in black. Next we will use some synthesis templates to finish this design. 1. In Project Navigator under the Sources tab, select Edità Language Templates. 2. Locate the template called 7-segment display Hex conversion for VHDL located under the Synthesis Constructs heading in Coding Examples/Misc. 3. To preview the Converter template, click the template in the hierarchy. The contents display in the right-hand pane. 4. Copy the contents of this template and add it to your hex2led.vhd file under the architecture begin statement. 5. Save the file by Fileà Save. 6. In Project Navigator, select hex2led.vhd in the Project window. Double-click Check Syntax in the Processes for Current Source window. This launches the ISE Text Editor. If no errors are found, create a schematic symbol of this file and make sure it is available in the Symbols are on the schematic entry page. The Frequency Dividers Your TA will tell you where you can pick up the HDL file for dividing the 50 MHz clock frequency by 2 23. Do not save changes in the original file. Instead, save the file to your project folder or copy the contents of the file into a file you created. Does the resulting frequency seem reasonable for your display (i.e. is there sufficient time between states for your eyes to distinguish between two adjacent states)? If not, examine the syntax and make an appropriate adjustment to the HDL file (you should need to change two instances of the number 23). Only one of your two 4-bit outputs can be applied to the seven segment display at any instant. You will need a second frequency divider to toggle between these two outputs. The frequency should be high enough so that your eyes perceive the displays as continuous. How high a frequency is reasonable for this function? Examine the syntax of the file and then create another one to provide the frequency to toggle the displays. Do this by adding a new source (VHDL module) to your project and replace the all of the hdl source code with a copy of the code from your 2 23 divider. Make the appropriate edits to this code (in addition to the two instances of the power of 2, there should be three instances of the new file s name to change). The Multiplexer Design a macro to take as inputs two four-bit streams of numbers and a toggle level and output one of the four-bit streams depending on the level of the toggle signal. A convenient way to accomplish this is to use the M2_1 function, which is in your list of available symbols. Fig. 2 shows such a multiplexer. If you have time, create waveforms and run a simulation to test your circuit and assure yourself of its proper operation. 15

Figure 2: Multiplexer constructed from M2_1 units. The Design You now have all the pieces for the design, the counter, the multiplexer, the Hex to LED converter and the frequency reducers. If all is working well you can start tying up the output pins via the user constraint file. Referring to the pin numbering given in the DIO1/D2XL pinout page, tie the clock to the 50MHz system clock (pin 91), the CE line to a switch and the CLR line to a button. The seven data lines should control the seven segment counter LEDs. The DI01 Manual explains how the 7-segment display works. You will need two lines to go to the anodes of the seven segment counters to select them. Generate these from the toggle clock, one from the clock itself and the other from its inverse. To indicate that the CE line is on, route its output to the LED opposite the switch. You will find the DI01 Pinout helpful. Your final design should look something like that in Figure 3. Be sure you understand the operation of each of the functions named in the diagram. Exercise all the functions of your counter and show your TA that the design works as advertised. 16

Figure 3: Schematic of final counter design. 17