Lab 5
Lab 5
1. Truth table
EN A1 A0 D0 D1 D2 D3
0 x x 0 0 0 0
1 0 0 1 0 0 0
1 0 1 0 1 0 0
1 1 0 0 0 1 0
1 1 1 0 0 0 1
We will use a Memory Initialization File (.MIF). Select File > New from the menu and then select
Memory Initialization File. Click OK.
Select 16 words and 4 bit word size to match our RAM block.
You can now fill the memory with any values from 0 to 15 (15 is the maximum because our word size is 4
bits).
Right clicking on a cell or range of cells will allow us to rapidly fill multiple memory addresses
with custom values.
Remember to save the .imf file. The file name should default to RAM32_4_test.mif
Now we must update our RAM to initialize itself to our memory initialization file. Right click the RAM
component in the schematic and select IP Parameter Editor.
Click Next until you reach the Mem Init tab (or just click the Mem Init tab). Select Yes, use this file for
the memory content data to specify a file and then select browse and find your .mif file.
Select the file and then click Finish.
Compile the design
Select Assignments -> Device -> Device and Pin Options -> Configuration -> Configuration
Mode: Single uncompressed image with Memory Initialization
Recompile the project again.