Digital design

profiledenver
dsd_fall_2014_lab_4_rom.docx

DSD F14

Lab 4

31 x 8 ROM

In this lab you will design a Verilog Module for a ROM. The rom needs to be able to hold 32 unsigned Integers each 8 Bits. Thus it must have 5 address lines 25 = 32 This is fairly straight forward to do, just requires setting up an Array of 32, 8 bit values. This can be done using the following statement:

reg [7:0] Store [0:31];

Functionally, the ROM should have a parallel Load function using slide switches 7:0 labeled as D 7:0 and pressing button Left as well as a Clear that should occur when pressing the Right button. When each of the 32 locations is addressed using the high 5 slide switches on the board switch 15:11 which are called A 4:0 in the port list and in the constraint file, as the address lines and displaying the address in the high 5 LED 15:11, called Ao 4:0 in the port list and the constraint file.

I have provided the shell only so that everyone can use the same signal names to make following code and debug easier for TA’s and me, but still have to write their original solution. So use the shell and finish the code. The shell uses a bunch of statements in the initial block to clear the array variables to zeros. This can be done more simply by using a for loop, just don’t forget to initialize the for index variable as an integer variable as shown below:

for (i=0; i< 32; i=i+1) //remember there is no i++ syntax allowed

A test bench is optional for this project. Fill out the questions and past in your code for turn in as well as have TA sign off on your demo of the solution on the NEYS4 board.

DSD Oct 13-17 Due 17th

Lab 4 ROM

Name__________________________ abc123 ___________ Date____________________

1. How do you calculate the required size of a rom from the requirements of number of words and size of words?

2. What is minimum number of bits required to hold signed, 2’s complement intergers that can vary from -60 to plus 60

3. Look at the RTL schematic. Did you have any problems with errors referring to dual port memory limitations? What do you think these meant if you did?

4. Give 4 uses you know of that use ROMs in an embedded way.