Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

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

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;

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    '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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    thanks you, Tricky and Nicolas...^^

    I have solve my problem....thanks so much...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- 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