- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi, im new in quartus and vhdl. im trying to use the rom from the megafunction for my project. can i store real number in the rom? or it has to be hex? if it has to be hex, is it hav to be the ieee hex format?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you create the MIF (Memory initialization file) for the ROM, you will need to enter unsigned decimal numbers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks for the reply !
but if i have to use hex? is it the same? by the way, wats the different between hex and mif file? u mean unsigned decimal input...does that refer to integer only? what about real number with fraction?? and the address to the rom..is it compulsory to be 16bit (4 hex)?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried creating a HEX file form Quartus II and it still says I need to use unsigned decimal numbers. You do not need to key in HEX for HEX file. You still use unsigned decimal. It has to be integer in this case. It's up to your design to interprete the fraction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you very much.
but how do you create hex file with decimal number? i mean if hex i just do like: :03800000028100FA but if using decimal how? and if using decimal so the output of the rom shd be declared as integer? sorry for the trouble....- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- thank you very much. but how do you create hex file with decimal number? i mean if hex i just do like: :03800000028100FA but if using decimal how? and if using decimal so the output of the rom shd be declared as integer? sorry for the trouble.... --- Quote End --- .mif and .hex are simply different file formats used to store the initialization data. A mif file looks like this WIDTH=8; DEPTH=256; ADDRESS_RADIX=UNS; DATA_RADIX=UNS; CONTENT BEGIN 0 : 100; 1 : 101; 2 : 0102; [3..255] : 0; END; You can see the Address and data radix are set to UNS (Unsigned). This can be changed to HEX/Decimal etc. To make one of these Use the Quartus File menu->New->Other Files->Memory Initialization File and follow the prompts to build the size you want You can change the radix by right clicking on the data columns of the editor. You can also manually edit the generated mif file with text editors etc Hope this helps Vern
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank alot vernmid!
seems like using mif is more convenient than hex file! i will try it out! thanks alot!!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi, i have a question.
it is possible the data for rom in signed number?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the data in a rom is just a load of bits, so it can represent anything you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes it is possible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- When you create the MIF (Memory initialization file) for the ROM, you will need to enter unsigned decimal numbers. --- Quote End --- what its mean? i try to make a look up table content pre compute data... the data set in signed number... i try to using that MIF file, but it fail.. :confused: thank you with response from all...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The numbers in the MIF file is an unsigned binary number. That number has a signed equivolent, which is what you mean. You have to work out what the signed number is and in the mif file you put the unsigned equivolent. In the hardware it can mean whatever you want (because its just a load of bits).
Its easier just to create a constant and write behavioural VHDL to instantiate the ROM, then you can write it however you want.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
tq tricky,
i have 6 set of data n 256 word per set... so i think its much more easy for to using MIF file...- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page