Altera_Forum
Honored Contributor
15 years agoOdd Counter Output.
Hello all;
I am trying to learn AHDL and have run into a problem. I tried searching the forum, but could not find anything like what I am seeing. I am sure I have done something to the settings or something to cause the problem, because even with a new project I get the same results. The reason I think it is a setting is when I first simulated the code it worked correctly. I used it for a couple hours while using it in another file to compare it to so I could verify that my other code was working I started to get this output. It worked fine, but I never could get the other code to work right. I then made a new project and retyped the code, not just copied it with the same results. I have made a simple counter. Below is the code: SUBDESIGN TEST2 ( clock :INPUT; Q[3..0] :OUTPUT; ) VARIABLE count[3..0] :DFF; BEGIN count[].clk = clock; count[].d = count[].q - 1; q[] = count[].q; END; I am not getting what I would expect, 15 to 0 repeating. What I am getting is this: 15,7,11,3,13,5,9,1,14,6,10,2,12,4,8,0 It keeps repeating. I did notice that all the numbers 0 to 15 are present. I am using Quartus II ver 9. Thanks for any help. Larry