Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17235 Discussions

Error 10327: Can't determine definition of operator ""=""

Altera_Forum
Honored Contributor II
6,371 Views

hello everyone, i am newbie in quartus2, an d I am trying to write a 2 digit bcdcounter, but i facing some error 

line 27 :Error 10327: Can't determine definition of operator ""="" 

the following is the code 

 

 

library IEEE; 

use IEEE.std_logic_1164.all; 

use IEEE.std_logic_arith.all; 

 

entity bcdcounter1 is 

port( 

RST : in std_logic; 

Digit1_0 : out unsigned(3 downto 0); 

Digit10_0 : out unsigned(3 downto 0); 

SW1 : in std_logic; 

clk : in std_logic 

); 

end bcdcounter1; 

 

architecture bcdcounter1_arch of bcdcounter1 is 

signal Digit1 : unsigned(3 downto 0); 

signal Digit2 : unsigned(3 downto 0); 

begin 

--BCD up counter 

process(clk, RST) 

begin  

if RST = '0' then 

Digit1 <= (others => '0'); 

Digit2 <= (others => '0'); 

elsif rising_edge(clk) then 

if (SW1 = '1') then 

if (digit1 = '8') then 

if Digit2 < 9 then  

Digit2 <= Digit2 + 1; 

Digit1 <= (others => '0'); 

else 

Digit1 <= (others => '0'); 

Digit2 <= (others => '0'); 

end if; 

else  

Digit1 <= (others => '0');  

end if; 

else  

if Digit1 < 9 then 

Digit1 <= Digit1+1; 

else  

Digit1 <= (others => '0');  

end if; 

end if; 

end if;  

end process; 

 

Digit1_0 <= Digit1; 

Digit10_0 <= Digit2; 

 

end bcdcounter1_arch;
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
4,739 Views

'8' is not a valid number. I think you meant 8 (without the ' ) 

 

Also, std_logic_arith is not a standard library. you should use numeric_std instead.
0 Kudos
Altera_Forum
Honored Contributor II
4,739 Views

Right, 

 

use the numeric_std lib. 

 

library ieee; 

use ieee.std_logic_1164.all; 

use ieee.numeric_std.all; 

 

Than you can write: 

 

if (Digit1 = 8) then 

 

or 

 

if (digit1 = to_unsigned(8, digit1'length)) then
0 Kudos
Altera_Forum
Honored Contributor II
4,739 Views

thanks you, Tricky and Nicolas...^^ 

I have solve my problem....thanks so much...
0 Kudos
Altera_Forum
Honored Contributor II
4,739 Views

 

--- Quote Start ---  

'8' is not a valid number. I think you meant 8 (without the ' ) 

 

Also, std_logic_arith is not a standard library. you should use numeric_std instead. 

--- Quote End ---  

 

 

thanks you tricky, you are very great...i have solve my problem
0 Kudos
Altera_Forum
Honored Contributor II
4,739 Views

thanks you too...^^ 

nicolas...i have solve my problem
0 Kudos
Reply