calculate power of float number

Guest #6057245
I try to calculate y=2.5^x. y([0,2048)) is output which is 11 bits 
positive int and x([0,8)) is 6 bit which will fixed-point with 3 digits 
decimal and 3 digits fractional.


I write this module;

module prime(
    input [5:0] x,
    output [10:0] y
    );
    assign y = ((5'b11001)/(4'b1010))**( x / (10'b1111101000));
endmodule

RTL scheme : https://hizliresim.com/1ploYN

But it did not work. Also, I upload RTL scheme, x is not attached.
What is the reason for this? Could not verilog make a calculation with 
float numbers with this method?
Attached files:
Guest
Simply use a look-up table. Your 6 input bits result in 64 combinations, 
which you can easily write down.

Reply

A question of your own? This thread is over 6 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.