Forum Discussion
Altera_Forum
Honored Contributor
12 years agoa std_logic_vector is not a number - its just a collection of bits. it is also similar to sfixed in that it is an array of std_logic.
1.5 in a fixed point would be "0110" in 4.2 notation. As a a std_logic_vector, it would be "0110" also (its just an array of bits). Similarly, in an unsigned type, it would also be "0110". The only difference is that the sfixed contains the power information via the +ve (integer part) and -ve (fraction) in it's indeces. For the other types you need to keep track of where the separation lies. the fixed_pkg has a to_slv function that will return a std_logic_vector of the correct length. NOTE: 1000000001 in signed is -1023, not -1 (its twos compliment).