CSE 171 Lab 3



EGR 240 Lab 7. March 7 – 10, 2006.

EXPERIMENT: 7-Segment Displays – Binary-to-BCD Converter

Part A

1. Create a directory C:\EGR240\. Using Aldec HDL create a project called Lab7 and write a Verilog program called binbcd4.v for a 4-bit binary-to-BCD converter. Use the logic equations that you derived in Class Homework #19.

2. Simulate the 4-bit binary-to-BCD converter, binbcd4, by using a hex counter stimulator for B that counts from 0 to F. Make a printout of your waveform and have your lab instructor sign it.

3. Download the file, hex7seg.v, from the class website and add it to your project. Write a top-level Verilog program, called Lab7.v, that implements the top-level design shown in Figure 1.

Figure 1

Part B

1. Using Xilinx ISE create a project called Lab7x (in your Lab7 folder) and add your files binbcd4.v, hex7seg.v, and Lab7.v to this project. Add the file Lab7.ucf (available on the class website) to this project.

2. Select Lab7 and double-click the Generate Programming File process. Connect the PC printer port cable to the PLDT-3 board, then connect the 9V DC power module. Double-click Configure Device (iMPACT) under the Generate Programming File process and download your program to the Xilinx chip.

3. Test your design by setting the switches on S7 to various hex values and observe and verify the values displayed on the 7-segment displays. Demonstrate the operation to your lab instructor.

4. Delete the directory C:\EGR240\ that you created at the beginning of this lab.

Group Product Exercise:

Write down what you think you need to be able to do to get the amount of squeezing of the hand grip to be displayed as a number between 0 and 15 on the 7-segment displays.

Answer questions 25 – 28 on the class website for next week:

25. Make a truth table with a single input, S1, and fourteen outputs, a, b, c, d, e, f, g, aa, bb, cc, dd, ee, ff, gg. The outputs, a – g, are the segments of the right-most 7-segment display and the outputs, aa – gg, are the segments of the left-most 7-segment display. Fill in the truth table such that the word LO is displayed when s1 = 0, and the word HI is displayed when s1 = 1.

26. Using the truth table derived in Question 25, write logic equations for a – g, and aa – gg.

27. Write a Verilog program that will display LO on the 7-segment displays when pushbutton S1 is not being pressed, and will display HI on the 7-segment displays when pushbutton S1 is being pressed.

28. Write or generate a .ucf file that will define the pin numbers to use for the Verilog program in Queston 27.

-----------------------

[pic]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download