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:
Explanation to the multiplication assembly code.
a_lsb
is just a byte. a^2 needs two bytes and that is why it has two bytes
aa_lsb and aa_msb declared. aabb_lsb and aabb_msb are the a^2 + b^2
results. There is a carryout bit for the addition of the two bytes.
Give alias to the following registers.
What does the 'SRA' instruction do?
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: 1. Repeat the work in Section 1. (60 points) 2. Complete the task in Section 2. (40 points)
Week 2: 3. Complete the task in Section 3. (100 points)