Altera_Forum
Honored Contributor
14 years agoError with operators
Everytime i try to use an operator (+, -,...), I have the following error:
Error(10327) - can't determine definition of operator "-", found 0 possible definitions. Here is the full code, but the problem is at the bold part. LIBRARY ieee; USE ieee.std_logic_1164.all; use ieee.numeric_std.all; ENTITY reg_b IS PORT ( clk, dec: IN STD_LOGIC; D: IN STD_LOGIC_VECTOR(3 downto 0); B: OUT STD_LOGIC); END reg_b; ARCHITECTURE comportamento OF reg_b IS signal Q: std_logic_vector(3 downto 0); signal Q_integ: integer range 0 to 15; BEGIN PROCESS (clk) BEGIN IF clk'EVENT AND clk = '1' THEN Q<=D; END IF; END PROCESS; Q_integ <= to_integer(unsigned(Q)); Process(dec) Begin If dec'event AND dec='1' Then q_integ <= q_integ - '1'; IF Q='0' Then B<='1'; End IF; END IF; End Process; END comportamento; I appreciate some help. Thank you.