I have a 32bit fractional number with 4 integer bits and 28 fractional bits and I am interested in implementing it in VHDL without the use of package such as ieee_proposed.fixed_pkg.all . Is there any other method of representing this 32 bit number by using only the standard packages such as numeric_std.all. Help is appreciated
Asked
Active
Viewed 793 times
1
-
1Yes. Just remember where the decimal (oops, binary) point is, and write your VHDL accordingly. And check in simulation you get what you expect. Or, more simply, turn on VHDL-2008 mode. These packages are standard (part of the IEEE library) and you don't have to "introduce" anything. – Aug 08 '16 at 12:02
-
If you were to use a -2008 compliant VHDL implementation fixed_generic_pkg (fixed_pkg) would be available as part of the IEEE standard in library IEEE. You could also declare a your own type and subtypes allowing type conversion or custom conversion routines ( both pre -2008) or simply use implicit subtype conversion in type conversion (-2008) with package numeric_std for arithmetic. What have you tried that you're unsatisfied with or what problems have you encountered? – Aug 08 '16 at 12:04