I have discovered a phenomenon that does not align with my understanding. Is it a bug?

An area for asking questions, making suggestion, share ideas and place circuit examples.
Post Reply
677
Posts: 2
Joined: Fri Sep 22, 2023 6:45 pm

I have discovered a phenomenon that does not align with my understanding. Is it a bug?

Post by 677 »

As shown in the figure, there is a clock, an 8-bit counter, an 8-bit unsigned comparator, an 8-bit combination switch, and a T-trigger. I think the situation is that when the circuit is running, first set the binary bits of the 8-bit switch, and then click the clear button to set the counter to 0. Under clock drive, the value of the counter will eventually be equal to the value of the 8-bit switch. At this time, the output of the 8-bit unsigned comparator is 1. Since the T-trigger is also connected to the output of the comparator, the output of the T-trigger is also 1, Afterwards, although the value of the counter will be greater than the value of the 8-bit switch, causing the comparator output to become 0, the output of the T trigger will remain at 1 due to its rising edge triggering.
However, the actual situation is that when the 8-bit switch is set to an odd value, it conforms to the situation I described above. On the contrary, when the 8-bit switch is set to an even value, the output of the T trigger will become 0 at a later time. Why is this?
Attachments
2023-09-23_111239.png
2023-09-23_111239.png (44.93 KiB) Viewed 34708 times
User avatar
admin
Site Admin
Posts: 417
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: I have discovered a phenomenon that does not align with my understanding. Is it a bug?

Post by admin »

Can you share your project file? It is hard to see what is going on from just a picture.
677
Posts: 2
Joined: Fri Sep 22, 2023 6:45 pm

Re: I have discovered a phenomenon that does not align with my understanding. Is it a bug?

Post by 677 »

This is my project file
Attachments
circuit.CircuitProject
(271.01 KiB) Downloaded 2501 times
User avatar
admin
Site Admin
Posts: 417
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: I have discovered a phenomenon that does not align with my understanding. Is it a bug?

Post by admin »

Well, the problem is synchronization of your circuit.
First, your flip-flops are not raising edge triggering they are level triggering. To fix it I’ve changed it to rear edge triggering. But it turns out not enough too, I also AND the output of comparator with clock. Now it appears to be working.
Attachments
circuit_fixed.CircuitProject
(287.14 KiB) Downloaded 2688 times
Post Reply