Tried to make flip flop

As the title, states I tried to make a Flip Flop gate, but for some reason I am getting a “False” statement in the watch.

I am using two NAND gates, and the pulse representing the CPU clock is false, therefore, if I am not wrong, both watches should display true?

Anyone got any idea as to why, it isn’t working?

It would be a lot easier to help if you could include a copy of your xodball or a picture of your patch. (I find picture easier for small patches as I don’t have to download the xodball, but that is just personal preference.)

FYI: a flip-flop node already exists, but it is coded in C++

1 Like

Whoops, thought I had already posted the screenshot.

Here you go :slight_smile:

That is not proper wiring for a NAND flip-flop.

If you add watch nodes to the top nand gates, you will see that they are both true (neither has both inputs true, so “and” is false, and nand negates that). Since 2nd row of nand gates has both inputs true, “and” is true, and nand negates it to false.

A true flip-flop built using gates is going to need wires looping back up to provide feedback on the current state. Any wires looping back will need to have a defer node added so XOD can figure out how to deal with the feedback loop.

Set-Reset flip-flop:
image

Toggle flip-flop:

If you just need a flip-flop, the existing node is your best bet. If you are just experimenting, start with one of the above diagrams (or do an internet search…there are LOTS of options).

1 Like

Thank you for the suggestion of nodes,

I did it like this

But now I am getting “cloud compilation limits exceeded.”

Supposedly the cloud server should update every 10 minutes, but I have waited over 10 minutes between my attempts to simulate, so is there something wrong with my chain, or is it indeed the cloud that has to update?

Your patch still doesn’t match the toggle example I provided. The top nand gates should have 3 inputs with additional wires looping back.

If you are not logged into XOD, I think logging in will give you more compiles.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.