To practice combinational logic on Logisim and Xilinx ISE tools. ...

Similar documents
EE 1315 DIGITAL LOGIC LAB EE Dept, UMD

and 32 bit for 32 bit. If you don t pay attention to this, there will be unexpected behavior in the ISE software and thing may not work properly!

Circuit design with configurable devices (FPGA)

Boise State University Digital Systems Laboratory

Revision: February 27, E Main Suite D Pullman, WA (509) Voice and Fax

COS 116 The Computational Universe Laboratory 8: Digital Logic II

Introduction. About this tutorial. How to use this tutorial

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

ECE 4305 Computer Architecture Lab #1

1 Discussion. 2 Pre-Lab

Getting started with the Xilinx Project Navigator and the Digilent BASYS 2 board.

Programmable Logic Design I

Tutorial: ISE 12.2 and the Spartan3e Board v August 2010

COMP2611: Computer Organization Introduction to Logisim & simple combinational circuit

Logic Implementation on a Xilinx FPGA using VHDL WWU Linux platform assumed. rev 10/25/16

Xilinx Schematic Entry Tutorial

EE 1315: DIGITAL LOGIC LAB EE Dept, UMD

ANADOLU UNIVERSITY DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EEM Digital Systems II

TLL5000 Electronic System Design Base Module

Introduction to Computer Engineering (E114)

UNIVERSITI MALAYSIA PERLIS

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science. EECS 150 Spring 2000

The board is powered by the USB connection, so to turn it on or off you plug it in or unplug it, respectively.

Xilinx Tutorial Basic Walk-through

PRELAB! Read the entire lab, and complete the prelab questions (Q1- Q3) on the answer sheet before coming to the laboratory.

Step 1: Downloading the source files

TLL5000 Electronic System Design Base Module. Getting Started Guide, Ver 3.4

University of California, Davis Department of Electrical and Computer Engineering. Lab 1: Implementing Combinational Logic in the MAX10 FPGA

Lab 1: Introduction to Verilog HDL and the Xilinx ISE

T Safety Board CPLD Programming Guide Revision: -

Logic Implementation on a Xilinx FPGA using VHDL WWU Linux platform assumed. rev 11/01/17

Tutorial: Working with the Xilinx tools 14.4

SCHEMATIC DESIGN IN QUARTUS

University of Pennsylvania. Department of Electrical and Systems Engineering. ESE Undergraduate Laboratory. Introduction to LabView

Xilinx ISE Synthesis Tutorial

ELEC 204 Digital System Design LABORATORY MANUAL

Tutorial on Quartus II Introduction Using Verilog Code

2 nd Year Laboratory. Experiment: FPGA Design with Verilog. Department of Electrical & Electronic Engineering. Imperial College London.

A B A+B

VLSI Lab Tutorial 1. Cadence Virtuoso Schematic Composer Introduction

Xilinx ISE/WebPack: Introduction to Schematic Capture and Simulation

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

ECE 491 Laboratory 1 Introducing FPGA Design with Verilog September 6, 2004

Lab #9: Introduction to Logisim CS 0447/COE 0147: Spring 2012

Programmable Logic Design Techniques I

Tutorial on Quartus II Introduction Using Schematic Designs

Introduction to Schematic Entry using Xilinx ISE and Digital Logic Simulation using ModelSim MXE

Small rectangles (and sometimes squares like this

Workshop 5-1: Dynamic Link

CSC258H: Logisim-Evolution Reference

CS2630: Computer Organization Homework 3 Combinational logic and Logisim Due October 14, 2016, 11:59pm

Implementing a Verilog design into the UWEE CPLD Development Board Using Xilinx s ISE 7.1i Software: A Tutorial

Banks, Jasmine Elizabeth (2011) The Spartan 3E Tutorial 1 : Introduction to FPGA Programming, Version 1.0. [Tutorial Programme]

Altera Quartus II Tutorial ECE 552

475 Electronics for physicists Introduction to FPGA programming

CPLD Experiment 4. XOR and XNOR Gates with Applications

Chip Design with FPGA Design Tools

XILINX WebPack -- testing with Nexys2 boards at USC (EE201L)

Start Active-HDL. Create a new workspace TUTORIAL #1 CREATING AND SIMULATING SIMPLE SCHEMATICS

University of Hawaii EE 361L. Getting Started with Spartan 3E Digilent Basys2 Board. Lab 4.1

1. Introduction EE108A. Lab 1: Combinational Logic: Extension of the Tic Tac Toe Game

COMPUTER ENGINEERING PROGRAM

NOTE: This tutorial contains many large illustrations. Page breaks have been added to keep images on the same page as the step that they represent.

EE 367 Logic Design Lab #1 Introduction to Xilinx ISE and the ML40X Eval Board Date: 1/21/09 Due: 1/28/09

XILINX ISE AND SPARTAN 3AN TUTORIAL

Laboratory of Digital Circuits Design: Design, Implementation and Simulation of Digital Circuits Using Programmable Devices

EECS150: Lab 1, FPGA Editor

CSE 591: Advanced Hardware Design and Verification (2012 Spring) LAB #0

Lab 1: FPGA Physical Layout

University of Florida EEL 3701 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering Revision 0 12-Jun-16

ME 365 EXPERIMENT 3 INTRODUCTION TO LABVIEW

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University. Laboratory Exercise #1 Using the Vivado

EE 231 Fall Lab 1: Introduction to Verilog HDL and Altera IDE

eproduct Designer A Simple Design and Simulation Tutorial

University of Florida EEL 3701 Dr. Eric M. Schwartz Madison Emas, TA Department of Electrical & Computer Engineering Revision 1 5-Jun-17

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 1

COMPUTER ENGINEERING PROGRAM

Board-Data Processing. VHDL Exercises. Exercise 1: Basics of VHDL Programming. Stages of the Development process using FPGA s in Xilinx ISE.

The Alarm System: The alarm system to be designed has the following inputs.

Getting Started with LabVIEW Virtual Instruments

ECSE-323 Digital System Design. Lab #1 Using the Altera Quartus II Software Fall 2008

CS2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2011

LAB EXERCISE 2 EM Basics (Momentum)

EECS150: Lab 1, FPGA Editor

Introduction to Nexys 2 board - Detour Signal Lab

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University

Tutorial: Working with Verilog and the Xilinx FPGA in ISE 9.2i

Tutorial for Altera DE1 and Quartus II

ECE 3610 Microprocessing Systems Lab #1 Verilog Design of the TOC Using Quartus II

Lab 1 Modular Design and Testbench Simulation ENGIN 341 Advanced Digital Design University of Massachusetts Boston

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University

Design a three-input, two-output sequential digital circuit which functions as a digital locking mechanism. LOCK ALARM

RTL and Technology Schematic Viewers Tutorial. UG685 (v13.1) March 1, 2011

SWITS User Manual. Accessing SWITS. This document focuses on the elements required to Access SWITS. Total Pages: 5

TUTORIAL #2 HIERARCHICAL DESIGNS AND TEST FIXTURES

Programmable Logic Design I

for ArcSketch Version 1.1 ArcSketch is a sample extension to ArcGIS. It works with ArcGIS 9.1

Quartus II Introduction Using Verilog Design

EE 210 Lab Assignment #2: Intro to PSPICE

FPGA Introductory Tutorial: Part 1

Transcription:

ENGG1203: Introduction to Electrical and Electronic Engineering Second Semester, 2017 18 Lab 1 Objective: To practice combinational logic on Logisim and Xilinx ISE tools. 1 Find your lab partner You will be working with a randomly assigned partner for this lab. To find your assigned lab partner and the assigned table, 1. Log in to Moodle. 2. Select the assignment Lab 1 Partner Please proceed to your assigned table. 2 Get the files Download the files for this lab from http://www.eee.hku.hk/~engg1203/sp18/labs/lab1.zip Save your file on the Desktop. If you save it at any other locations, make sure the folder name contains only simple english characters and numbers. Do not include space or any other symbols in the path. To unzip the file: Right click the downloaded file. Select Extract All... 3 Logisim In this part of the lab, you will get familiar with the software Logisim, which we will be using to simulate the behavior of digital logic circuits. If you would like to run Logisim on your own computer, you may download it from http://www.cburch.com/logisim/. 3.1 Implement the following circuit in Logisim. A B P Q Figure 1: Y

To insert a logic gate, expand the folder Gates and click on the desired logic gate. Once the gate is selected, the mouse will turn into the shape of the selected gate. Place the gate in the circuit area on the right. To connect the gates, select the arrow icon on top ( ). Then drag from the output of one gate to the input of another gate. You can connect to any of the small blue dots on the gate symbol. To create an input to the circuit, select the Add Pin icon with an outline of a square ( add an output to the circuit by using the Add Pin icon with an outline of a circle ( ). To assign a name to the input/output pin, click on the pin while the arrow icon ( may then add the label for the pins, in this case, a, b and y for output. ). Similarly, ) is selected. You Once you have connected the circuit, you will notice the color of the wire changes. A dark green color means that the current value on the wire is a logical 0, while a light green color signifies a 1. Other wire colors: blue = unknown value, gray = unconnected, red = conflict. For more information, consult the Logisim online help file. In particular, the section on Beginner s Tutorial can be very helpful. 3.2 Select the poke tool ( ) so you can test the circuit. You can toggle the value of an input pin by clicking on it using the poke tool. Note the values of all subsequent wires change instantly. Using this tool, complete the following truth table of the given circuit. Note that we have put 3 columns on the right hand side. It is a simple short hand so we can see the internal node values (p, q) together with the final output y. a b p q y 0 0 0 1 1 0 1 1 3.3 Write down the boolean expression for p, q in terms of a, b. p = q = 3.4 Write down the boolean expression for y in terms of p and q, then substitute your answer from above to express y in terms of a and b. Page 2 of 7

y = 3.5 Checkoff 1 The given circuit performs the function of a simple gate. What is that function? Show your truth table and your boolean expression of the circuit to your TA. Before you ask for a TA to checkoff you work, log in to the Moodle account of any one of the group partners. Click on Lab 1 Checkoff 1. 4 Testing on real hardware While Logisim allows easy simulation of digital logic circuit, we will use a different software that helps us implement the digital circuit in real hardware. In this course, we will be using the Basys2 board for hardware implementation, which contains a programmable hardware integrated circuit called Field Programmable Gate Array (FPGA). An FPGA is a special hardware that is reprogrammable by a user. Once configured, the FPGA operates in the same way as if the desired hardware functions were physically implemented in hardware. Note that although it is programmable, an FPGA is not a microprocessor. This is the reason we need to configure it using a specially designed software. We will be using the Xilinx ISE tools for this purpose. Warning: As an industrial-standard software, the Xilinx ISE tools can be very cumbersome and complicated at time. But once you have gotten used to the steps, they will become much simpler. 4.1 Start ISE by double-clicking on the icon ISE Design Suite 14.2. Open the project file lab1/lab1a/lab1a.xise that you have downloaded. This will start an empty project with settings configured for the Basys2 board. 4.2 Add a Schematic We will implement the same circuit in Figure 1 using the Basys2 as an exercise. To add a schematic design into the project, do the following: 1. Select Project New Source from the menu. 2. Choose Schematic 3. Type the name lab1a in the File name field. 4. Click Next 5. Click Finish Once you have added the new source lab1a.sch, it will automatically be opened on the top right. Page 3 of 7

4.3 Adding symbols To add the necessary logic components, click on the Add Symbol button near the center of the screen. Select Logic under Categories. This is where you can find simple logic gates that we have covered in class are listed. 4.4 Finding those gates For a 2-input AND gate, select and2. For a 2-input NOR gate, select nor2. Select the gates and place them in the circuit on the right. To connect the gates with wires, select the Add Wire tool of a gate to the input of another gate. and drag a connection from the output 4.5 Input/Output To connect your schematic with the rest of the world, you need to specify the I/O ports. For that, select the button Add I/O marker. The default setting will automatically detect the I/O direction of the marker. Click on the input to a gate and you will see that an input marker is automatically created, and vise versa. Finally, name your I/O ports. Follow the name as shown in the above circuit figure: Name the input a and b respectively; Name the output y. NOTE: You must name them exactly as a, b, and y in preparation for next step. To rename an I/O marker, right click on the marker and select Rename Port. 4.6 Implement the design The FPGA is configured by a special bit file with a.bit extension. To generate the necessary bit file for your design, do the following: 1. Select the Design tab in Project Navigator; 2. Double click Generate Programming File. If everything go smoothly, you should have your first FPGA programming bit file in about 5 minutes. Page 4 of 7

4.7 Connecting the Basys2 Connect the Basys2 to the computer using the provided USB cable. The Basys2 board is powered by the USB cable and no external power supply is needed. Once connected, turn on the Basys2 power switch. You should see the 7-segment display starts running. 4.8 Download to the real circuit The final step is to download the circuit to the Basys2 board. Double click on the Configure Target Device step in project navigator. A new software, called impact will launch. A warning will display saying no configuration for impact is found. We will create a configuration in the following steps. In impact, double click Boundary Scan on the left. Select Initialize JTAG chain or type Ctrl-I. It will detect the attached board and initialize the system. If correct, you should see two chips detected. When asked if you want to load the configuration, click Cancel. We will manually set the configuration in next step. Right click on the first chip labeled xc3s100e and select Assign New Configure File.... Select lab1a.bit as the configuration. Click NO when asked if you want to program the attached SPI. Finally, right click on the xc3s100e and select Program, and OK. If things are correct, you should see that the 7-segment display is now off. Optional: If you want to skip the configuration step in future, you can save the impact configuration and use that configuration in the Configure Target Device step above. See the ISE manual for more details. 4.9 Testing your circuit The two inputs, a and b are connected to the first two switches, labeled sw0 and sw1 on the board. The output y is connected to the first LED led0. To test your circuit, try switching sw0 and sw1 between HIGH and LOW and see if led0 lights up as expected. 4.10 Checkoff 2 Demonstrate to your TA your working circuit on the Basys2. Show your schematic to your TA and explain the process to generate the FPGA configuration from the top-level schematics. Before you ask for a TA to checkoff you work, log in to the Moodle account of any one of the group partners. Click on Lab 1 Checkoff 2. 5 3-input XOR In this part of the lab, you will practice the skills you have learned so far to build a slightly more complex circuit a 3-input XOR gate. A 3-input XOR gate has three inputs a, b and c and outputs a 1 when there is an odd number of 1 among the inputs. Page 5 of 7

5.1 A 3-input XOR gate has the following Boolean expression: y = a b c. Draw in the following area the schematic of such 3-input XOR gate using two 2-input XOR gates. 5.2 Based on the above schematic, implement a 3-input XOR gate in the Xilinx ISE schematic editor. To implement the design, 1. Open the project lab1b.xise 2. Select Project New Source 3. Select Schematic and name your file lab1b 5.3 Once you have a blank schematic, complete the design of 3-input XOR gate using two 2-input XOR gates (xor2 under the Logic categories) to reproduce the schematic you have designed above. Name your inputs a, b, and c, and name your output y. 5.4 Mapping to the correct I/O You may notice that there are many switches and buttons on the Basys2 board. How did the ISE tools know that the I/O port of signal a should map to sw0 and b should map to sw1? The answer is in a user constraints file (.ucf file). In the blank project you ve downloaded, you should see a file called lab1b.ucf has already been added for you. Double click the file to open it. The content of this file determines where each I/O port in the circuit should be connected to physically in the board. Go to line 68 and 69, you will see the NET a is mapped to location (LOC) P11. It tells the software that the wire representing a should be connected physically to I/O pin P11 of the FPGA, which in turn is connected to switch 0 on the Basys2 board. Now uncomment the line that started with NET c. Compare to the line above, you see that we are now connecting the input signal c to the push button 0 on the Basys2 board. 5.5 Implement To implement your design, 1. Click on the top design module, lab1b.sch in Project Navigator 2. Implement your design by double-clicking the Process Implement Design 5.6 Download and Test Download your design to the Basys2 board following the same procedure above, except you want to download lab1b.bit this time. Test your circuit with the switches sw0, sw1 and push button btn0. Page 6 of 7

5.7 Checkoff 3 Demonstrate your working 3-input XOR gate on the Basys2 board and the schematics. While keeping a and b unchanged, explain what happen to the output by pushing btn0. What logical function does input c provide with respect to a and b? Before you ask for a TA to checkoff you work, log in to the Moodle account of any one of the group partners. Click on Lab 1 Checkoff 3. 5.8 Optional: 3-input XOR in Logisim Implement a 3-input XOR gate in Logisim without using the built-in XOR gate. You should first make the circuit in Figure 1 as a subcircuit in Logisim and reuse it in your implementation of 3-input XOR gate. To learn how to use subcircuit, select from Logisim Help User s Guide. Then select the section on Subcircuits. Verify the function of your circuit by experimenting with different input values using the Poke tool. Page 7 of 7