truncating std_logic_vector question

Status
Not open for further replies.

vivo_m

Member level 3
Joined
May 15, 2011
Messages
54
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,903
I'm trying to multiply two std_logic_vector(7 downto 0), i know the result will be new std_logic_vector(15 downto 0) but actually i want the output result to be std_logic_vector(7 downto 0)..
is there any idea how can i do this..
 

signal temp_result : std_logic_vector ( 15 downto 0 )
signal result : std_logic_vector ( 7 downto 0 ) ;

temp_result <= vector1 * vector2 ;
result <= temp_result ( 7 downto 0 ) ;
 
Reactions: vivo_m

    vivo_m

    Points: 2
    Helpful Answer Positive Rating
you cannot multiply std_logic_vectors. you need to use signed or unsigned type. But the method is the same as above.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…