dareon
Newbie level 5
I have been working on converting my code from using integer math to signed math.
I am using
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
in my code I am multiplying to signed 16 bit numbers.
signal SINE_IN : std_logic_vector(15 downto 0); --From ADC
signal SINE_TABLE : signed(15 downto 0); -- From Table
-- These numbers are multiplied and stored in a array (32 position shift register)
Mult_ARRAY(0) <= signed(SINE_IN) * SINE_TABLE;
The problem is the compiler gives me warnings depending on the width of the array.
If I make the array 32 bits wide (31 downto 0) I get 32 warnings (32 position array)
WARNING:Xst:2677 - Node <Mult_ARRAY_8_31> of sequential type is unconnected in block <Position>.
If I make the array 31 bits wide (30 downto 0) I get
WARNING:Xst:643 - "C:/VHDLPrograming/Nano/DNPREV01/position.vhd" line 183: The result of a 16x16-bit multiplication is partially used. Only the 31 least significant bits are used. If you are doing this on purpose, you may safely ignore this warning. Otherwise, make sure you are not losing information, leading to unexpected circuit behavior.
I feel like 31 bits should really have enough space since in theory it is really 2^15 *2^15 squared and a sign bit. I want to make sure I'm not somehow losing the sign bit or something important.... I'm am just working on doing the coding now I won't have the hardware for about a week to really test it.
I am really new to VHDL coding and am using ISE 11.5
Thank You
Russell
---------- Post added at 09:50 ---------- Previous post was at 09:46 ----------
Also in the 31 bit scenario I get another warning
WARNING:Xst:1610 - "C:/VHDLPrograming/Nano/DNPREV01/position.vhd" line 183: Width mismatch. <Mult_ARRAY<0>> has a width of 31 bits but assigned expression is 32-bit wide.
I am using
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
in my code I am multiplying to signed 16 bit numbers.
signal SINE_IN : std_logic_vector(15 downto 0); --From ADC
signal SINE_TABLE : signed(15 downto 0); -- From Table
-- These numbers are multiplied and stored in a array (32 position shift register)
Mult_ARRAY(0) <= signed(SINE_IN) * SINE_TABLE;
The problem is the compiler gives me warnings depending on the width of the array.
If I make the array 32 bits wide (31 downto 0) I get 32 warnings (32 position array)
WARNING:Xst:2677 - Node <Mult_ARRAY_8_31> of sequential type is unconnected in block <Position>.
If I make the array 31 bits wide (30 downto 0) I get
WARNING:Xst:643 - "C:/VHDLPrograming/Nano/DNPREV01/position.vhd" line 183: The result of a 16x16-bit multiplication is partially used. Only the 31 least significant bits are used. If you are doing this on purpose, you may safely ignore this warning. Otherwise, make sure you are not losing information, leading to unexpected circuit behavior.
I feel like 31 bits should really have enough space since in theory it is really 2^15 *2^15 squared and a sign bit. I want to make sure I'm not somehow losing the sign bit or something important.... I'm am just working on doing the coding now I won't have the hardware for about a week to really test it.
I am really new to VHDL coding and am using ISE 11.5
Thank You
Russell
---------- Post added at 09:50 ---------- Previous post was at 09:46 ----------
Also in the 31 bit scenario I get another warning
WARNING:Xst:1610 - "C:/VHDLPrograming/Nano/DNPREV01/position.vhd" line 183: Width mismatch. <Mult_ARRAY<0>> has a width of 31 bits but assigned expression is 32-bit wide.