UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor huangpoh
Visitor
2,227 Views
Registered: ‎07-20-2017

Multiplier using numeric (VHDL)

Jump to solution
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity MULTIPLIER is
    Port ( A : in  STD_LOGIC_VECTOR (7 downto 0);
           B : in  STD_LOGIC_VECTOR (3 downto 0);
           RES : out  STD_LOGIC_VECTOR (11 downto 0));
end MULTIPLIER;


architecture Behavioral of MULTIPLIER is
	signal A_int: integer;
	signal B_int: integer;
	signal RES_int: integer;
begin

	A_int <= to_integer(unsigned(A));
        B_int <= to_integer(unsigned(B));
	RES_int <=  A_int * B_int;
        RES <= std_logic_vector(to_unsigned(RES_int , RES'length) );

--if I comment out everything related with RES_int and use the below code everything works --RES <= std_logic_vector(to_unsigned(A_int * B_int , RES'length) ); end Behavioral;

with the above code I get, but I don't understand why? Can someone help me understand?  

 

Xst:646 - Signal <RES_int<31:12>> is assigned but never used. This unconnected signal will be trimmed during the optimization process.   

 

 

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
3,502 Views
Registered: ‎10-24-2013

Re: Multiplier using numeric (VHDL)

Jump to solution

Hi @huangpoh

Your output is just 12 bit and you are assigning it to 32 bit values. So the the remaining bits 31:12 are never used.

I believe you are seeing the expected output in the simulation. Do you?

Thanks,Vijay
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
1 Reply
Highlighted
Xilinx Employee
Xilinx Employee
3,503 Views
Registered: ‎10-24-2013

Re: Multiplier using numeric (VHDL)

Jump to solution

Hi @huangpoh

Your output is just 12 bit and you are assigning it to 32 bit values. So the the remaining bits 31:12 are never used.

I believe you are seeing the expected output in the simulation. Do you?

Thanks,Vijay
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos