EmbDev.net

Forum: FPGA, VHDL & Verilog calculate power of float number


von Yusuf (Guest)


Attached files:

Rate this post
0 useful
not useful
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?

von Svenska (Guest)


Rate this post
0 useful
not useful
Simply use a look-up table. Your 6 input bits result in 64 combinations, 
which you can easily write down.

von Lothar M. (lkmiller) (Moderator)


Rate this post
0 useful
not useful
Yusuf wrote:
> Could not verilog make a calculation with float numbers with this
> method?
What says the manual of your specific toolchain?

And what result do you get in the simulation?

von Alexander (Guest)


Rate this post
0 useful
not useful
Lothar M. wrote:
> What says the manual of your specific toolchain?

Youtube-Video "Berlitz German Coastguard"

???

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig