Forum Discussion
Altera_Forum
Honored Contributor
16 years agoI wite a code for multiplier and I have a problem with this erro " can't determine definition of operator ""+"". I have used almost library as you see and tried many ways that I know but it's still bad. Help me plz. can you help me re-write this code or show me a good way to solve. Thanks alot. I use Quatus II , Web edition
library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use ieee.numeric_std.all; use ieee.std_logic_signed.all; -------------------------- entity mul is port(a: in bit_vector(3 downto 0); b: in bit_vector(3 downto 0); kq: out bit_vector( 7 downto 0)); end mul; -------------------------- architecture mul of mul is type arr is array( 0 to 3) of bit_vector(7 downto 0); begin process(a,b) variable x: arr; variable t: bit_vector(7 downto 0); begin for j in 0 to 3 loop if b(j)='1' then x(j):=("0000"& a); x(j):=(x(j) sll j); else x(j):=(others =>'0'); end if; t:=(t+x(j)); end loop; kq<=t; end process; end mul;