- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
when i create a multiplier, adder or comparator using megawizard in quartus do these blocks also valid when i use floating point input
such that if the 2 input to the adder are 10 bits length and the last 3 bits represent fraction and the first bit is sign bit and the rest represent integer, in this case could i create a normal adder block or multiplier block using mega function wizard????????Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For add/substract floating point numbers use altfp_add_sub megafuntion, for multiply altfp_mult megafuntion. All megafunctions whose names begin with "altfp" operate with floating point numbers (single precision 32 bits and double precision 64 bits). Be carefull, because floating point arithmetic is expensive, check this first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what if I want to use 10 bits only as in my case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10 bits is a very low resolution for floating point representation, anyway, in that case you must describe your own arithmetic cores. Instead, i think you should use a fixed-point representation with, say, 18 bits of resolution.
Are you going to use theese arithmetic operators on your turbo decoder? what is the more frequent arithmetic operation? what are the maximum values of domain and range?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes i am going to use this arithematics in my turbo decoder.
in my first trial to write the code i used 32 bit but i found that i will be using a lot of memory in registers so i am trying to minimize the memory used because i have been told that if i use more than 64k i should switch to ram and addressing issues.Ofcourse if 32 bits is used this will be alot easier for me right now could i use 32 bits resolution with this huge memory and still use registers? One thing i need a little help here because i am feeling that i am totaly lost i have written a matlab code to simulate this decoder which i can't convert to VHDL so please can you help me please because it seems that u r familiar with the turbo code i am really running out of time- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The term floating point in the thread title is misleading as you clearly referred to fixed point in your initial post. To answer the original question, there's no difference between integer and fixed point in add/sub, but the result scaling is different in multiply. I suggest, that you try by pencil and paper method first. Generally, when multiplying two 10 bit signed numbers, you get a 20 bit result. It has to be scaled to a 10 bit number to keep the original format. At the MSB side, you may want to apply saturation to handle possible overflows, at LSB side, some bits are simply cut off. Altera has no MegaFunctions for this operation, you must provide it in your code. If you run short of FPGA resources, it can be meaningful to reduce the precision to 9 bit, which is the size of an elementary hardware multiplier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
there are some Megafunctions that will give you access to the hardware saturation/rounding in the Stratix devices, altmult_add for example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok thank u so much i have tried what you told me you were realy helpful but anyway i will try not to use floating point in this code to simplify it i will normalize the input to insure that it's all fraction and use normal adder and multiplier

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page