CS223 Laboratory Assignment 5

Introduction to XILINX IDE and Digilent  BASYS 2 board

Lab date and time:

Location: LAB 103 (in the new EEE building, next to and down from the EA Building)

Groups: Each student should work with a partner in a 2-person group.


 

Before Lab:  

  1. Purchase a Digilent BASYS 2 board at the Meteksan Bookstore.  Each group will need one of these boards. Your group will use this board for all of the remaining labs this semester. (At the end of the semester, you may keep the board, or sell it back at half-price, if it is undamaged.) 
  2. Go to the LAB 103 and download from the server the necessary software files. The size of the file download is 5.6 GB, which will require a 8 GB USB “jump drive” Flash memory stick. (This will take approximately 30 minutes, so allow enough time.)  Load the files onto your laptop computer(s) and install the software. The Xilinx program will require a license to run, which you can obtain online from their license manager. The URL of the lab server is \\139.179.32.199  You will find a folder Xilinx11.1—you should copy this in its entirety.  In the two subfolders, one titled DAS (x86) and one titled ISE, are the files you need to install.
  3. Study the document ise11tut.pdf to learn about the steps in design flow starting with schematic entry. In lab this week, you will enter your schematic into Verilog as the first step, and test your design after it is loaded into the Digilent BASYTS 2 board as the last step.
  4. Design a full adder/subtractor, which has 4 inputs (X, Y, CarryIn, and Add) and 2 outputs (Sum and CarryOut). The input Add determines if the circuit adds or subtracts: 1 = Add, 0 = Subtract.  When it subtracts, then of course the carry signals are actually borrows.  BE SURE that you get the truth table correct for 1-bit subtraction—if necessary, refer to the class slides.  As usual, you should first find the truth table, then derive Boolean equations, then draw the logic diagram) and bring it with you to lab.

 

Note: the PCs in the lab contain the Xilinx and Digilent software, installed, but these computers are extremely slow. You will be much better off to bring your own laptop computer with you, and do the lab using it. [Also, you will be able to work at home in advance, and for future labs, be able to bring your fully tested, debugged and working systems to lab to be graded.]

 

 

During Lab: The lab time will begin with an explanation of the Digilent board, and of the Xilinx ISE software, showing how to use it for schematic entry.  Be sure to come on time, and take notes during this tutorial and demonstration.

 

You will create a new project in Xilinx ISE, enter the logic diagram you have made using the Schematic Editor, and then map it to the FPGA by editing the User Constraint File. Then you will download it to the Digilent Board, and test your design using the switches and LEDs on the board. When it is working correctly, you will call the TA to show your results and be graded.  The TA, after testing your design, will ask you to make modifications and reload the modified design into the Digilent board for a new test.  Your grade will be based on the results of both of these tests.

 

NOTES

--- Be sure to read and follow the Policies for CS223 labs.

--- An extensive tutorial is posted online at http://www.cs.bilkent.edu.tr/~oonder/CS223/  Besides the in-lab demo/tutorial given at the start of this lab, you will find that this written tutorial provides vital information on how to create a project and how to upload it into the Digilent BASYS 2 FPGA board.

---Note that there is one mistake in the letters printed on the board!! The pin number printed for SW0 is mistakenly written as M4, but actually it should written as  P11, because it is connected to P11.  You can make this change easy to remember by writing a small sticker and attaching it to the board by SW0