E
Elektro
Guest
I want to define a fix-point constant for a signed 24 bit number as
S.I1.23, that is a signed binary number with a 1 bit integer part and
a 23 bit fraction part.
I found a way but is look a bit ugly.
constant b0 : std_logic_vector (23 downto 0) :=
conv_std_logic_vector(integer(-0.2763932 * (2**23)), 24);
This is the same as "define b0 as a fix-point number with the value
-0.2763932"
Is there another nicer way to define this constant?
S.I1.23, that is a signed binary number with a 1 bit integer part and
a 23 bit fraction part.
I found a way but is look a bit ugly.
constant b0 : std_logic_vector (23 downto 0) :=
conv_std_logic_vector(integer(-0.2763932 * (2**23)), 24);
This is the same as "define b0 as a fix-point number with the value
-0.2763932"
Is there another nicer way to define this constant?