Forum Discussion

efe373's avatar
efe373
Icon for New Contributor rankNew Contributor
4 years ago
Solved

MIF file

Hello, I want to initialize my RAM using .mif file. I want to store 2 different width of data in the memory, one is 16-bit and the other is 18-bit. Therefore, I have decided to use 18-bit wide RAM...
  • SyafieqS's avatar
    4 years ago

    Hi Yitim,


    In a Memory Initialization File, you must specify the memory depth and width values. In addition, you can specify data radixes as binary (BIN), hexadecimal (HEX), octal (OCT), signed decimal (DEC), or unsigned decimal (UNS) to display and interpret addresses and data values. Data values must match the specified data radix.


    The format is like this:


    DEPTH = 32; -- The size of memory in words

    WIDTH = 8; -- The size of data in bits

    ADDRESS_RADIX = HEX; -- The radix for address values

    DATA_RADIX = BIN; -- The radix for data values

    CONTENT -- start of (address : data pairs)

    BEGIN


    00 : 00000000; -- memory address : data

    01 : 00000001;

    02 : 00000010;

    03 : 00000011;

    04 : 00000100;

    05 : 00000101;


    END;


    You can easily use memory editor to create a mif file in file--> new --> memory file --> select your option.