BMP2MIF Converter

The BMP2MIF converter is a simple program that can help you in your ECE241 project. In essence it takes an image saved in a BMP file and converts it to a Memory Initialization File used within Quartus II. The Memory Initialization File, or MIF, can be used to initialize a memory block on the Cyclone II FPGA you have on the DE2 board.

The converter takes only one parameter - the name of the BMP file you wish to convert. It produces two files:

Once you create an MIF file, you will need to create a memory block in your design to facilitate the data in the MIF file. When you create such memory and specify either of the above files as the initialization file for the memory, Quartus II will be able to copy the contents of the MIF file to the Cyclone II chip on the DE 2 board when you are programming the device. Please note that any time you change the MIF file you need to recompile your project entirely. Only then will the MIF file be read by Quartus II and its data included in a programming file for the FPGA.

Once you create a memory in your design to store your image, the image will be loaded into it during the time you use the programmer to configure your FPGA. The image itself will be stored as a set of values in the memory. For example, if your image is m pixels wide and n pixels high, then the first m data elements in memory will represent the first row of the image, from left to right. The next m data elements will represent the second row and so on.

BMP2MIF converter comes as a package. The package contains a compiled bmp2mif.exe executable file you can run on a Windows based system, as well as a Visual Studio Project and the source code for the converter. You can modify it as you wish to suit your needs.

You can find the converter in the download section of this website.