Altera_Forum
Honored Contributor
11 years agoup down counter problem
hi everyone
i try to make a project to count people entering or going out from a hall using VHDL and altera board DE0 i made two clocks one for counting up (clku) it come from a trigger outside board and one for counting down (clkd) also come from a trigger outside board . but when doing this Error 10820 appear that says "can't infer register for count because its behavior depends on the edges of multiple distinct clocks" the Full Code is here ENTITY mod_ten_ud ISPORT( clku,clkd, enable :IN BIT ; q :OUT INTEGER RANGE 0 TO 9);END mod_ten_ud; ARCHITECTURE a OF mod_ten_ud ISBEGIN PROCESS (clku ,clkd) VARIABLE count :INTEGER RANGE 0 TO 9; BEGIN IFenable = '1' THEN IF( clku = '1' AND clku'EVENT ) THEN count := count + 1; ELSIF( clkd = '1' AND clkd'EVENT ) THEN count := count - 1; END IF; END IF; q <= count; END PROCESS; END a; please help me because it is my final study project and thanks a lot