Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Is this a synthesizable code?

Thread Tools

Is this a synthesizable code?

vb_thecapt vb_thecapt is offline
Junior Member
Join Date: Mar 2012
Posts: 3
Sorry for my newbie question. I have this code that perform a multiplication. Since the operatore '*' is not defined for std_logic_vector, i used integer variable to do so and then convert it to std_logic_vector. The simulations runs well, but is this really synthesizable? Or should i "build" a true multiplier? thanks

library IEEE;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_signed.all;

entity Mul is
    Port ( x : in  STD_LOGIC_VECTOR (7 downto 0);
           y : in  STD_LOGIC_VECTOR (7 downto 0);
           z : out  STD_LOGIC_VECTOR (15 downto 0));
end Mul ;

architecture Behavioral of Mul is


process (x,y)

variable multiplicand : integer :=0;
variable multiplier : integer :=0;
variable product : integer :=0;

	multiplicand := CONV_INTEGER(x);
	multiplier := CONV_INTEGER(y);
	product:= multiplicand*multiplier;
	z <= CONV_STD_LOGIC_VECTOR(product,16);
end process;

end Behavioral;
ps: is there a way to know if code is synthesizable without have to try on a board?
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Synthesizable (kind of) dual-edge FF Nicolas Matringe VHDL 1 10-12-2004 07:40 PM
synthesizable MOD operator Basel Naamna VHDL 2 05-14-2004 03:35 PM
SOS! newbie question about synthesizable VHDL : synthesis run successfully but post-synthesis failed... walala VHDL 4 09-09-2003 08:41 AM
is function conv_std_logic_vector() synthesizable? walala VHDL 2 09-06-2003 08:31 AM
GL85 synthesizable code Saeed Nari VHDL 2 07-28-2003 10:38 AM