- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
'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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks you, Tricky and Nicolas...^^
I have solve my problem....thanks so much...- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks you too...^^
nicolas...i have solve my problem
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page