Forum Discussion
3 Replies
- Altera_Forum
Honored Contributor
Verilog has very specific rules about how data types (bit widths, signedness, and realness) are propagated through an expression.
Verilog uses integer arithmetic by default when all operands are integers. You can covert to real arithmetic by using real constants writing: y - 100.0*p^(1000.0/5200.0); - Altera_Forum
Honored Contributor
--- Quote Start --- Is it possible to do that in verilog? --- Quote End --- It's possible to calculate real expressions at compile time, e.g. for constants, but the code isn't synthesizable. - Altera_Forum
Honored Contributor
If you are using constants you could represent them using binary form.
http://davidcastells.blogspot.com.es/2012/07/floating-point-to-fixed-point-online.html