- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Firstly sorry for my English, I used a translator.
I'm using the library sfixed used to do mathematical calculations, and because it synthesizes. I'm in trouble and perform the following calculation: 2 ^ 2.22 = 4.6589; sfixed: s <= to_sfixed (2 ** (2.22), 20, -20) -- worked! I wanted to put a variable in place of 2:22, thus: x <=to_fixed (2.22,20, -20); s <= to_sfixed (2 **(x), 20, -20); returns me the following error: # ** Error: C:/altera/Projetos/expoente/expoente.vhdl(112): No feasible entries for infix operator "**".# ** Error: C:/altera/Projetos/expoente/expoente.vhdl(112): No feasible entries for subprogram "to_sfixed".# ** Error: C:/altera/Projetos/expoente/expoente.vhdl(115): VHDL Compiler exiting att, João PedroLink Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no function to do integer ** sfixed. So you will have to either create one yourself, or I suggest using a look up table, as a power of function will be extreamly expensive in terms of logic.
2.22 is a real type, and integer**real is a valid function, and it works at first because it is a constant value so never changes. Using a variable as the exponent is not a good idea.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page