1. Objectives. 2. Create new project. 3. XOR gate



Similar documents
Xilinx ISE. <Release Version: 10.1i> Tutorial. Department of Electrical and Computer Engineering State University of New York New Paltz

Lab 1: Full Adder 0.0

EXPERIMENT 4. Parallel Adders, Subtractors, and Complementors

Two's Complement Adder/Subtractor Lab L03

After opening the Programs> Xilinx ISE 8.1i > Project Navigator, you will come to this screen as start-up.

Simulating Power Supply Sequences for Power Manager Devices Using PAC-Designer LogiBuilder

Jianjian Song LogicWorks 4 Tutorials (5/15/03) Page 1 of 14

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

Mentor Tools tutorial Bold Browser Design Manager Design Architect Library Components Quicksim Creating and Compiling the VHDL Model.

Multisim 7 Tutorial Creating Macros for Sub-circuits

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

The 104 Duke_ACC Machine

Lab 3: Introduction to Data Acquisition Cards

VHDL Test Bench Tutorial

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

Finite State Machine Design A Vending Machine

Quartus II Introduction Using VHDL Design

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

Using the JNIOR with the GDC Digital Cinema Server. Last Updated November 30, 2012

UNIVERSITY OF CALIFORNIA College of Engineering Department of Electrical Engineering and Computer Sciences

Start Active-HDL by double clicking on the Active-HDL Icon (windows).

CHAPTER 11: Flip Flops

Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

Lab 1: Introduction to Xilinx ISE Tutorial

How to test and debug an ASP.NET application

Getting Started Using Mentor Graphic s ModelSim

Application Unit, MDRC AB/S 1.1, GH Q R0111

Mentor Graphics Tutorial

Laboratory 2. Exercise 2. Exercise 2. PCB Design

Memory Management Simulation Interactive Lab

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8

Multiplexers Two Types + Verilog

Figure 8-1 Four Possible Results of Adding Two Bits

TestManager Administration Guide

DRV8312-C2-KIT How to Run Guide

Introduction. - Please be sure to read and understand Precautions and Introductions in CX-Simulator Operation Manual and

Counters and Decoders

EET 310 Programming Tools

1 Intel Smart Connect Technology Installation Guide:

Using Microsoft Project 2000

Building an Embedded Processor System on a Xilinx Zync FPGA (Profiling): A Tutorial

Quick Start Using DASYLab with your Measurement Computing USB device

ugrid Testbed. Rein in microgrid complexity. With ease.

Lab 1: The Digital Oscilloscope

Merging Labels, Letters, and Envelopes Word 2013

RTL Technology and Schematic Viewers

Binary Adders: Half Adders and Full Adders


BIGPOND ONLINE STORAGE USER GUIDE Issue August 2005

Macros in Word & Excel

Using SPSS, Chapter 2: Descriptive Statistics

Mobius 3 Circuit Board Programming Instructions

Twido Simulator - Online Help Scope What's in this Part? Twido Simulator Overview What's in this Chapter? How to Use Twido Simulator

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Excel & Visual Basic for Applications (VBA)

Excel 2007 A Beginners Guide

LabVIEW Day 1 Basics. Vern Lindberg. 1 The Look of LabVIEW

MS WORD 2007 (PC) Macros and Track Changes Please note the latest Macintosh version of MS Word does not have Macros.

4. Do you have a VGA splitter ( Y Cable)? a document camera?

Introduction to Microsoft Excel 2010

PROMIS Tutorial ASCII Data Collection System

5. Tutorial. Starting FlashCut CNC

User Manual. DG LINK Application Program This document applies to firmware version 2.00 and above.

Company Setup 401k Tab

Lesson 1 - Creating a Project

Working with SQL Server Integration Services

WinTask x64 Scheduler for Windows 7 64 bit, Windows 8/ bit and Windows 2008 R2 64 bit. Scheduler Quick Start Guide

Excel 2003 A Beginners Guide

How to install and use the File Sharing Outlook Plugin

Scientific Graphing in Excel 2010

An Introduction to MPLAB Integrated Development Environment

Excel Spreadsheets: Getting Started

Lab 1: Introduction to PSpice

Introduction to LogixPro - Lab

Gates, Circuits, and Boolean Algebra

Capacitive Touch Lab. Renesas Capacitive Touch Lab R8C/36T-A Family

MiraCosta College now offers two ways to access your student virtual desktop.

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Creating a New Search

IBM SPSS Statistics 20 Part 1: Descriptive Statistics

Server Manual. For Administrators of Cameleon Version 4

Lecture 2 Mathcad Basics

Appendix A How to create a data-sharing lab

Digital Electronics Detailed Outline

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

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

EE 209 Lab 1 Sound the Alarm

User Manual. AS-Interface Programmer

2 SQL in iseries Navigator

Intermediate PowerPoint

Training Document for Comprehensive Automation Solutions Totally Integrated Automation (T I A) MODULE A5 Programming the CPU 314C-2DP

Quick Start Guide. Highly customizable automated trading Automate your trades according to rules and models you create.

3. On the top menu bar, click on File > New > Project as shown in Fig. 2 below: Figure 2 Window for Orcad Capture CIS

Running a Load Flow Analysis

Gray Code Generator and Decoder by Carsten Kristiansen Napier University. November 2004

Directions for Frequency Tables, Histograms, and Frequency Bar Charts

Maple Quick Start. Introduction. Talking to Maple. Using [ENTER] 3 (2.1)

Transcription:

EE 121 October 1, 2002 Digital Design Laboratory Handout #3 Laboratory Assignment #1 Introduction to Xilinx Foundation Design Software Due date: Thursday, October 10, at the beginning of class To be completed individually 1. Objectives Become familiar with the Xilinx Foundation software package: o Project Manager: creates/manages projects o Schematic Editor o Logic Simulator: graphical schematic ulator Create schematics and macros for a new project Simulate your schematics 2. Create new project Install Xilinx Foundation software on your home PC or locate the computer cluster in Packard 128. You will need a class computer account and an SUID with access permission to use the computers in Packard 128. Launch Xilinx Foundation Project Manager. Select Create a New Project and hit OK. Name the new project Lab1, select flow to be schematic, choose Spartan2 from the left pop-up menu, and choose 2S100TQ144 from the middle pop-up menu. The Xilinx Spartan 2S100TQ144 programmable logic device will be used throughout EE121, and so all projects should be of this type. Finally, choose a directory on drive Z: in which to store the project files. Once the new project has been created and loaded, you will see a list of the project files on the left and a set of buttons on the right. Launch the schematic editor by pressing the schematic editor button in the design entry group on the right. The schematic editor contains a drawing region in the center and buttons on the top and left. The buttons on the left are for selecting and drawing. 3. XOR gate Create an XOR gate using Figure 1 as a guide. 3. Creating an XOR Gate First add the components that will be needed (two INV gates, two AND2 gates, and one OR2 gate). To add a component, first press the Symbols toolbox button on the left. This brings up a new window containing a list of available components. Next choose the desired component from the list, place the component in the drawing area by clicking in the drawing area, and then right click and choose Select/Drag Mode when done. Do this for all five needed gates. After adding all the components, the next step is to add the inputs and outputs. The XOR gate has inputs, X and Y, and one output, Z. To add an input/output, press the Hierarchy

Page 2 of 9 EE 121, Autumn 2002-2003 connector button, name the terminal, and choose a terminal type, i.e., input or output. Do this for both inputs and the output. Once the components and inputs/outputs are in place, the next step is to add wires. To add a wire, press the Draw Wires button, then in the drawing area click on one of the two terminals you want to connect with a wire and then click on the other. You can use the Select and Dra tool (the arrow button on the left) to move and stretch wire segments. Using Figure 1, wire the components of the XOR gate. Finally, label the internal nodes of the XOR gate. To label an internal node, double click on the wire and then give the node a name. Do this for the four internal nodes; name them X_L, Y_L, XNY, and XYN as in Figure 1. Always label the internal nodes of a schematic. Figure 1. XOR Gate Schematic. Save the schematic by choosing Save As from the File menu and naming the file XORgate.sch. Note that if you just choose Save or press Ctl-S the first time you save your file, Foundation will assign the file a name automatically, and the automatic name probably won t be very revealing. Print the schematic. You can adjust the page size of your schematic by choosing File:Page Setup and then selecting a sheet format. Choose a sheet size that is just large enough for your schematic so that the printout will be readable and not a printout of a very large, mostly unused sheet. 3.1. Simulating the XOR gate To verify that the XOR gate functions properly, you must ulate it. To launch the ulator, press the Simulator button in the top menu bar of the schematic editor. The Logic Simulator has two rows of buttons at the top, a list of signals down the left side, and the signal waveforms directly to the right of the signal list. Simulating the Old-Fashioned Way To ulate the XOR gate, first choose a step size of 1 ns (popup menu on top) and choose 1 ns/div (directly above the signal list, the two buttons on the left and right increase or decrease the time per division). Also, set the ulation type to functional using the popup menu in the first row of buttons at the top.

Laboratory Assignment #1 Page 3 of 9 Next, add the desired signals by choosing Signal:Add Signals and double click on the signals that you want to see ulated (X, Y, Z, X_L, Y_L, XNY, XYN). Then click on close. In order to ulate the XOR gate, you apply different combinations of inputs and observe the output. To set the state of an input, select the signal by clicking on it in the signal list, then click on the Logical States button in the second row of buttons at the top. Then choose the state of the input (high or low), and then click on close. Once all the inputs have been assigned a state, you can ulate one step by clicking the Simulation Step button in the first row of buttons at the top. Observe the output to make sure it is correct. Verify the truth table and print the ulation results. Your ulation results should be the signal traces in the graphical Waveform Viewer; the ulator does not generate truth tables. X Y Z 0 0 0 0 1 1 1 0 1 1 1 0 Next, use the ulator to observe the result of changing the inputs from X=0, Y=0 to X=1,Y=1. Do this first with the ulation type set to functional, and then with the ulation type set to unit. The unit ulation type adds a unit delay to the output of each gate. You should see a glitch (a short fluctuation in the output) when the XOR gate is ulated with unit delays. Explain why the glitch occurs and print the ulation results. Try the built-in counter as a means of generating continuously changing test inputs. Press the Select Stimulators button on the bottom row of buttons at the top. This brings up a window showing the different stimulators built into the ulator. The row of LEDs next to the label Bc represents the 16 bits of the built-in 16-bit counter. You can assign these bits to the signals you are ulating as a means of generating test inputs. Select X from the signal list and then press on the rightmost LED of the Bc row. This assigns B0 to X. Now assign B1 to Y, and press close. Next, go to Options:Preferences and under the ulation tab make sure that the B0 frequency is 500 MHz and the B0 period is 2ns. Click on OK, then use the Simulation Step button to step through the different test inputs generated by the counter. This is a useful technique for debugging, especially when there are a lot of inputs. Simulating with Scripts Writing a ulation script is usually more efficient than ulating by hand. Scripts allow you to automate repetitive testing tasks and spare you the work of adding and stimulating your signals each time you test a circuit. You can write your script in any text editor, or use the builtin script editor by choosing Tools->Script Editor from the Foundation Logic Simulator and clicking Create Empty Script. For a full list of ulation commands, choose Help->Simulation Macros Help from the Script Editor. Here is an example script that performs the same tests we did by hand. Lines beginning with a vertical bar are comments.

Page 4 of 9 EE 121, Autumn 2002-2003 EE121 Script to test the XOR gate in Lab 1 Issue some initialization commands delete_signals restart greset Simulate in functional mode set_mode functional Set the stepsize; i.e., the default ulation time interval stepsize 1 ns Set the ulation precision...increasing precision time decreases timing accuracy but speeds up the ulation. Defaults to 100 ps. _precision 125 ps Add signals to the watch window. Watch X Y Z X_L Y_L XNY XYN Test the truth table assign X 0 assign Y 0 The command runs the ulation for one step size. assign X 0 assign Y 1 assign X 1 assign Y 0 assign X 1 assign Y 1 Test the transition from all 0's to all 1's in functional mode. assign X 0 assign Y 0 assign X 1 assign Y 1 Test the transition from all 0's to all 1's in functional mode. set_mode unit assign X 0 assign Y 0 assign X 1 assign Y 1 Use counters At 8 ns, assign 0 to X, then increment X (modulo 2) every 2ns 8 times wfm X @8ns = 0 (2ns = inc by 1) * 8

Laboratory Assignment #1 Page 5 of 9 At 8 ns, assign 0 to Y, then increment Y (modulo 2) every 4ns 4 times wfm Y @8ns = 0 (4ns = inc by 1) * 4 16ns The script might not seem useful with such a small design, but as your designs become larger you will find them essential. 3.3. Creating a XOR gate macro In order to use a schematic easily within another schematic, it is best to create a symbol macro. To create a macro out of the XOR gate schematic, select Hierarchy->Create Macro Symbol from Current Sheet from the schematic editor. The symbol name should be XORgate, the inputs should be X and Y, and the output should be Z. Verify this, then click OK. You can now use the XOR gate in other schematics by selecting it from the components list. 4. Full adder Create a new schematic called FullAdder using Figure 2 as a guide. The input signals are A, B, and CIN (carry in) and the outputs are S and COUT (carry out). This schematic uses the XORgate macro that you created earlier. Make sure you label the internal nodes AXORB, AB, ACIN, and BCIN. After you have created the schematic, create a macro from the schematic and name it FullAdder. Figure 2. Full adder schematic. Simulate the schematic and verify the truth table below (functional-mode ulation) with a script. Make sure you always include internal nodes in your ulation. Also, make sure that FullAdder.sch is the only schematic listed in the main Project Manger window, that is, the only schematic in your project). Including more than one schematic in a project can confuse the

Page 6 of 9 EE 121, Autumn 2002-2003 ulator and cause errors; thus it is a good idea to always include only one schematic (the main top-level schematic) in your projects. All other (lower-level) schematics should be converted to and included as macros. To remove a schematic, right click on it in the list of project files and select Remove. To add a schematic, right click on the project name in the list of project files and select Add. Alternatively, you can ulate a macro by choosing File->Simulate Single Component from the Simulator. A B CIN S COUT 1 1 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 0 0 1 1 0 1 0 1 0 1 0 0 0 1 1 0 0 0 0 0 0 After verifying the truth table above, print the ulation results. 5. 4-bit adder Create a new schematic called Adder4 using Figure 3 as a guide. You will use buses in this schematic. A bus is an array of signals, and is displayed as a thicker line than a regular wire. When using a bus, the naming convention is to give the bus a name in the form of bus_name[x:y], where bus_name is the variable name and X is the most significant bit and Y is the least significant bit. Individual signals in the bus are named bus_namen where N is between X and Y. Individual signals can be accessed by wiring a regular wire from a bus to a terminal and giving the internal node the name corresponding to the desired signal, or by using the Draw Bus Taps tool. After creating the Adder4 schematic, ulate the 4-bit adder with a script for additions using both hexadecimal and decimal notation (functional-mode ulation). Again, only one schematic should be listed in the main project window. At this point, Adder4.sch is the top-level schematic and thus should be the only schematic file listed. You might find the following ulation commands useful: Add the busses A[3:0] and B[3:0] to the watch window vector A A3 A2 A1 A0 vector B B3 B2 B1 B0 watch A B Change A and B to decimal radix dec A B Change A and B to hexadecimal radix hex A B

Laboratory Assignment #1 Page 7 of 9 Assign hexadecimal values to A and B assign A 2\h assign B C\h Stimulate A, B and CIN with a pattern pattern A 0\h D\h 7\h 5\h F\h pattern B 6\h F\h 8\h 3\h 0\h pattern CIN 0 0 1 1 1 () * 5 Print the ulation results. Make a macro out of Adder4. 6. 16-bit adder Figure 3. Adder4 schematic. Create a new schematic called Adder16 using Figure 4 as a guide. In this schematic you will learn how to pull a piece of a bus out of a bus (e.g., A[7:4] out of A[15:0]). Write a script to

Page 8 of 9 EE 121, Autumn 2002-2003 ulate the 16-bit adder using decimal numbers and check the results for correctness (functional mode). Print the ulation results. Next, ulate the 16-bit adder in unit-delay mode. In particular, ulate the case where all inputs are 0 transitioning to all 1s. Print and explain the results. 7. What to turn in Figure 4. Adder16 schematic. 1. XOR gate schematic 2. XOR gate ulation results a. truth table verification b. inputs transitioned from 0s to 1s (both functional and unit-mode ulations) c. explanation of glitch in unit-mode ulation. 3. 1-bit adder ulation results (verification of truth table) and script 4. 4-bit adder ulation results (using both decimal and hexadecimal numbers) and script 5. 16-bit adder ulation results and script a. addition using decimal numbers in functional-mode

Laboratory Assignment #1 Page 9 of 9 b. addition resulting when inputs are transitioned from 0s to 1s in unit-mode c. explanation of the ulation results in unit-mode