Lab 8 - The square problem with pushbuttons and seven segment displays (2-week lab)

1. Get started

First download the listings from the textbook which contains the top module, the assembly code, the display module and the debounce module.

Then download the kcpsm6 design files.

Put all these files together in one directory. Rename the long file names of the listings.

In the top module, there are a few things to change:



Here is the ones I used for kcpsm6 and the rom.



In the assembly file, the orignal seg code was for Spartan 3 which was {dp, a_to_g} MSB - LSB. You need to change it to {dp, g_to_a} MSB - LSB for Basys 3.



Make some changes in the constraint file. The example code from the textbook uses 'sseg [7:0]' for Spartan 3 board. In Basys 3, the 'seg' variable only has 7 bits, the 8th bit is 'dp'. You can change the name of 'dp' to seg[7] in the constraint file.



The lower 3 bits of the switch controls the display options.



Here is the demonstration:



2. Modify the code to show the 16-bit results on the LEDs. You can use a LED bar on any of the SSD units as the 17th bit or use one of the decimal points as the 17th bit.

3. Modify the code to display the results in HEX form on an LCD display.





------------------------------------
Tasks:

Week 1: (due Wed 4/13 10 pm)
1. Repeat the work in Section 1. (30 points)
2. Complete the task in Section 2. (20 points)

Week 2: (due Wed 4/20 10 pm)
3. Complete the task in Section 3. (50 points)






-----------------
References
[1] https://www.youtube.com/watch?v=mzjUCzB9aSQ
[2] Spartan 3 board information
Schematic



[3] Pong Chu's book: FPGA Prototyping by Verilog Examples - Xilinx Spartan - 3 Version
[4] The KCPSM6 manual (PDF)
[5] disp_mux
[6] debounce