Get an
Unlimited Account!
Play Below Kryll
on Steam!
avatar-Zenchess
Zenchess

17/12/13

Hi. I thought I'd share the latest in my logic gate experiments. A developer said in the future there will be a flip flop 'gate', like the 'and' 'or' and 'not' gates that already exist. That will make the flip flop design below pretty much obsolete, but until then, here it is. Also, there is a method of making a counter or timer where you take a flip flop, and send its output into another flip flop. This let's you count (in binary). For instance, if you use 2 flip flops in this manner, you can cycle through the numbers 0, 1, 2, 3. More flip flops lead to bigger numbers that grow by the power of 2.

Thanks to greg (forgot the numbers at the end of his name) for help in this design, as he created a set/reset latch with only 2 logic gates. I am only using his set reset latch design in one part of this 'chip', but I am pretty sure that the following design can be reduced to much fewer logic gates with some thought.

The reason I did not use simpler kinds of flip flops is that this flip flop is "positive edge triggered", in other words, every time you send power to this flip flop, it toggles it's state, but does not repeatedly toggle while the power is on. So you can either activate the flip flop with a single trigger activation pulse, or you can stand on a kodo flower and send a continous stream of electricity to this flip flop and it will not go into an unstable state.

Again, I'd like to note this is just the first usable design I made, and I'm sure it can be massively improved upon.

The design is as follows:

###### Zenchess Flip Flop Design (with help from greg)######
AND)in:1nand4out in:1nand2out out:1nand1and
AND)in:1nand1out in:1clock out:1nand2and
AND)in:1nand2out in:1clock out:1nand3and
AND)in:1nand3and in:1nand4out out:13and32out
NOT)in:1on out:data
NOT)in:1nand1and out:1nand1out
NOT)in:1nand2and out:1nand2out
NOT)in:13and32out out:13nandout
AND)in:13nandout in:data out:1nand4and
NOT)in:1nand4and out:1nand4out

OR)in:1xora in:1xorb out:1orout
AND)in:data in: 1on out:1andout
AND)in:1orout in:1nandout out:xorout
NOT)in:1andout out:1nandout

AND)in:1f1 in:1on out: 1on
NOT)in:1nand2out out:1on
NOT)in:1off out:1f1
NOT)in:13nandout out:1off

To use the above design, of course place all the logic gates and name the inputs and outputs the same as above. To use a kodo flower to toggle the flip flop, place a kodo flower with the trigger name "1clock". Make sure the flip flop chips are visible near your character in the editor so you can confirm that the "1on" trigger toggles every time you step off of the kodo flower and back on again.

To make a counting system, build 2 of these flip flops (or more. Each flip flop you use gives you one extra bit of counting, example: 2 flip flops: 00, 3 flip flops: 000 4 flip flops: 0000). Change the variable names in the second flip flop to start with a "2" instead of a "1". This way your names do not clash. Change the name of the "1clock" inputs in both AND gates in the second flip flop to "1on". This way the output of your first flip flop is going to the clock of your second flip flop. The 2nd flip flop will toggle twice as slow as the first flip flop.

So lets say you have 4 flip flops set up in this fashion, you will get the following output for triggering the first flip flop a few times:
0000
0001
0010
0011
0100
etc.

In other words if you have a kodo flower set up to the flip flops the person must jump on the kodo flower 5 times to set the number to "0100"(base 2) or "4" (base 10).

To check to see if your user has picked a specific number you want, simply check for that exact number using the logic gates. For example, stack a few AND gates to check if the first flip flop is set to off, the second to off, the third to on, and the fourth to off. If all 4 conditions are true, then the user has entered the correct number.

avatar-Smackware
Smackware

17/12/13

We're still looking in to the flipflop gate.
Here is a diagram showing how to build a basic flipflop:

/images/flipflop.png

avatar-Zenchess
Zenchess

18/12/13

This is the flip flop greg showed me:http://imgur.com/PGytX8q

They seem to be identical in function. Unfortunately neither is a 'toggle' flip flop like the design i posted above. In order to toggle the state of either one, you have to send a trigger
to either 'off' or 'on'. That means in order to toggle it you need to know which state it is already in. I am sure my toggle design above can be improved and am working on that now :)

avatar-Zenchess
Zenchess

18/12/13

This is the flip flop greg showed me: http://imgur.com/PGytX8q

They seem to be identical in function. Unfortunately neither is a 'toggle' flip flop like the design i posted above. In order to toggle the state of either one, you have to send a trigger
to either 'off' or 'on'. That means in order to toggle it you need to know which state it is already in. I am sure my toggle design above can be improved and am working on that now :)

avatar-Smackware
Smackware

21/12/13

The two flip-flops are basically similar. The first part is identical actually. A NOT gate and an AND gate following it.

The difference is this:
The 2-gate flipflop (NOT+AND) can sustain one active trigger, or have it off.
The 3-gate flipflop (NOT+AND+NOT) alternates between two triggers ("on" and "off" in the diagram I showed) out of which one is always active.

avatar-m0she
m0she

07/07/14

A positive edge triggered toggle flipflop (7 gates):
http://imgur.com/zeCpVp8

avatar-mostro
mostro

07/07/14

Wow!.

Log in to comment!
EULA | Privacy Policy | Report an issue | Contact us | Game client release notes | Approval to monetize