hey if i have a signed 16-bit value and i want to transform it into a 32-bit IEEE float in [-1.0,1.0) range solely with simple bit operations, how would i do it? i have no floating point hardware, however all simple bit operations are free
-
Show this thread
-
Replying to @whitequark
JFYI. Not claiming this is optimal in any way. But I tested it with all 65536 16-bit values, so at least it's correct. ;) http://svn.clifford.at/handicraft/2019/short2float …pic.twitter.com/NGjrydoOX0
1 reply 0 retweets 29 likes -
-
Replying to @whitequark
I should probably do something else with my time .. but .. here is a version using the ternary ops from RISC-V Bitmanip.pic.twitter.com/uZ3cYmbXhB
1 reply 0 retweets 8 likes -
Replying to @oe1cxw
neat! unfortunately i was trying to do it in HDL, so your elegant solution is unfortunately entirely lost on me...
2 replies 0 retweets 1 like -
Replying to @whitequark
Yeah, I knew that already (from reading other tweets in the thread) before I even started working on the first version. But it's a neat bit-manipulation task.. I might add it to the example apps section in the RISC-V Bitmanip document.
1 reply 0 retweets 4 likes
Aaand here is something to compare your nMigen implementation against. (short2float.v in that same SVN directory.)pic.twitter.com/FmlNARzkLp
-
-
Replying to @oe1cxw
wow, that's impressively simple, it did not occur to me to derive the exponent like that.
0 replies 0 retweets 5 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.