- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was literally stuck witha problem regarding the conversion of negative floating point number in binary and to write it in VHDL.For example the num is -0.8.when i convert it into binary it is like .11001100.since it is -ve i have to convert it into 2's complement and to provide the extra MSB bit.
My question is that how to represent it in VHDL without using that decimal point.Plz kindly help me in this regard.Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Floating point formats usually use a separate bit for the sign (so you have separate encodings for +0 and -0).
You might be much better off using 'fixed point' arithmetic - where you multiply the FP numbers by a constant and then process the integer part (using 2's compliment integer arithmetic).- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you don't use floating point, you'll most likely refer to a fixed point format with a specific number of fractional bits. You need to define the used format before converting to it.
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