I have the next circuit in logisim: It is a simple 8 bit counter, with a magnitude comparator that outputs 1 when certain value is met.
The problem is that if I simulate with a clock, the counter reaches 1d (just before the target value 1e) and then it resets to 00, so the circuit never outputs 1.
Is it something that I am doing wrong?
This is the circuit that I am building:
Context: It is a problem of a college assignment. I have to build a "ventilation system". T will be 1 when certain temperature is reach inside a room. N is an orange led, R is an red led and V turns on the fans in the room. First I build a Moore's diagram and define the states of my circuit.
- E0 : Temperature in the room is normal, N, R and V are off.
- E1 : Temperature in the room reached target. N (orange led) turns on. R1 = 1 and C1 starts counting.
- E2 : When T is 1 for 30 seconds, then N turns off, R and V turns on. (The fans start to cooldown the room).
- E3 : Once when T is 0, the fans (V) will be on for the next 5 mins (assume that they will prevent T from change to 1 again). Also, N is on and R is off. R2 = 1 and C2 starts counting.
- Finally C2 reaches 5 mins, S2 fires and everything comes back to E0.
Then I built a Moore's FSM (Ei = AB; E0 = 00; E1 = 01; E2 = 10; E3 = 11):
Then, I built this table who it will help me define the logic equations for the outputs, A(t+1) and B(t+1):
With the equations then I built C3:
First flip flop is A, the second is B.
C1 and C2 are modules like the first one, but with different target values. I found out if I feed a constant 1 to R1 it solves the problem. Now, when C3 feeds 1 to R1 the counter resets just before reaching the target value. If I increase or decrease the target value, the counter stills reaches target-1 and resets.
Maximum value is set to ff and 'Action on Overflow' is set to 'wrap around'.
My circuit does not fire S1 even though R1 is always 1 and C1 counts to 30 secs:
But if I put a constant 1, it does (even tough R1 stills at 1 also and never resets until S1 fires):