The most amazing MIF file generation solution in the world

Source: Internet
Author: User
ArticleDirectory
    • The most amazing MIF file generation solution in the world
The most amazing MIF file generation solution in the world

Every time you want a function, you always need to find the software, such as the host computer and the model extraction software.

But have you heard of the MIF file generation software ??

In those years, we were going to display things on the LCD. The font size was very large and we looked back at it. For a 64*64 monochrome image, you need to manually input the image in Quartus II memory initialation file. You need to enter 4096 values. If the image is successful, it will be NC ......

I went through NC. I got half of NC, and I went on strike ......

All the words extracted by the word model extraction software are in hexadecimal format and are 8-bit. Why don't I use the C language to convert them directly to the MIF file?

It's easy to handle a file.

It was a year ago. Now I have to use it again. Finally, I am so sorry to sum it up and contribute to all mankind.

The steps are as follows:

Purpose: To obtain the 16*8 characters of the "crazy bingo" MIF file?

A total of 16x8*11 = 1408 data records, which are retrieved by column. Two bytes are regarded as one data. A total of 8x11 = 88 data records.

(1) Use pctolcd2002 to extract the Hex file of crazy bingo, as follows:

After the model is generated, save it.

(2) open it with notepad ++ and perform column operations directly to delete some parameters to obtain valid data.

(3) set CProgramThe define parameter. The procedure is as follows:

# Include <stdio. h>

# Define data_width 16 // The data width of the MIF Storage

# Define data_depth 88 // The total amount of data stored by MIF 8*11

Void main ()

{

Int I, S = 0;

Int hex_data [data_depth]; // input 8-bit Hex data (0x ...)

// Create an MIF file on the desktop

File * FP;

Fp = fopen ("C: \ legal ents and Settings \ All Users \ Desktop \ MIF. MIF", "W ");

// Write the initial data of the MIF File

Fprintf (FP, "width = % d; \ n", data_width); // write the width of the data in the MIF storage.

Fprintf (FP, "depth = % d; \ n", data_depth); // total amount of data written to the MIF Storage

Fprintf (FP, "\ n ");

Fprintf (FP, "address_radix = Dec; \ n"); // decimal indicates the address

Fprintf (FP, "data_radix = hex; \ n"); // hexadecimal representation of data

Fprintf (FP, "content begin; \ n"); // start content

Fprintf (FP, "\ n ");

For (I = 0; I <data_depth; I ++)

{

Scanf ("% x", & hex_data [I]);

Fprintf (FP, "\ t % d \ t: \ t % x; \ n", I, hex_data [I]);

}

Fprintf (FP, "\ n ");

Fprintf (FP, "end;"); // indicates that the content of the MIF file is complete.

Fclose (FP); // close the file

// Cmd interface display

Printf ("\ n ");

Printf ("congratulate to you, crazy bingo! ");

Printf ("built MIF file successfully! \ N ");

Printf ("have a fun and never give up! \ N ");

Getchar ();

Getchar ();

Getchar ();

}

(4) Compile and copy the data obtained in step 2 in cmd.

(5) Desktop

(6) Open in Notepad format

(7) Enable Quartus II

(8) then call the ROM + related programs to see me on the LCD. Haha

(9) Let's look at other things. Below are the five 32*32 characters of the MIF, 32-bit

Haha, you must be good at C ++ in the future. Write your own interface, write a small software, and send it to friends who play FPGA ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.