Digital-Logic-Sim icon indicating copy to clipboard operation
Digital-Logic-Sim copied to clipboard

Buffer-like Delay using isCyclic not persisting into saved component

Open RobMayer opened this issue 4 years ago • 6 comments

This was a bit of a hack in order to get a Buffer-like component, but I essentially took an AND gate, wired both A and B inputs into single SIGNAL IN. I then went into the text file and enabled "isCyclic" intentionally. The end result is a Buffer where the output will power on one "tick" after the input is powered on. This works great for a clock assembly, like so:

image

However, when I use this to create a component, the logic for the delay is gone and the clock never oscillates. I can provide my save file if need be.

RobMayer avatar Dec 10 '20 03:12 RobMayer

the "Buffer" component, illustrating the forced "isCyclic" flag

{ "name": "BUF", "creationIndex": 6, "colour": { "r": 0.7641509771347046, "g": 0.40998053550720217, "b": 0.19103774428367616, "a": 1.0 }, "nameColour": { "r": 1.0, "g": 1.0, "b": 1.0, "a": 1.0 }, "componentNameList": [ "SIGNAL IN", "SIGNAL OUT", "AND" ], "savedComponentChips": [ { "chipName": "SIGNAL IN", "posX": -7.6431, "posY": 0.67, "inputPins": [], "outputPinNames": [ "IN" ] }, { "chipName": "SIGNAL OUT", "posX": 7.6431, "posY": 0.757, "inputPins": [ { "name": "OUT", "parentChipIndex": 2, "parentChipOutputIndex": 0, "isCylic": true } ], "outputPinNames": [] }, { "chipName": "AND", "posX": -2.5327, "posY": 0.6177, "inputPins": [ { "name": "A", "parentChipIndex": 0, "parentChipOutputIndex": 0, "isCylic": false }, { "name": "B", "parentChipIndex": 0, "parentChipOutputIndex": 0, "isCylic": true } ], "outputPinNames": [ "OUT" ] } ] }

RobMayer avatar Dec 10 '20 03:12 RobMayer

An interesting side-effect of this BUF object.

image

This output will be delayed by 4 "ticks" from the input.

RobMayer avatar Dec 10 '20 05:12 RobMayer

A similar, simpler case: a NOT connected to itself and the output functions as a clock, but when used as a component it doesn't output anything.

CursedFlames avatar Dec 10 '20 05:12 CursedFlames

I think I figured out why. the "flow" of a powering on propagates each tick, but the cutting of power is immediate. in other words your clock has the power pulled before it's power can reach anything.

RobMayer avatar Dec 10 '20 11:12 RobMayer

cutting the clock speed in half seems to work better as a clock because of the delayed-on but instant-off issue.

image

RobMayer avatar Dec 10 '20 14:12 RobMayer

Even more fun with this little hacked component: a rising and falling edge detector: RISING goes high for one tick when IN goes high FALLING stays high except for one tick when IN goes low

image

"BUF" component will delay a HIGH signal by one tick, but will go low instantly "CAP" component will delay a LOW signal by one tick but will go high instantly - this is made with a NOT -> BUF -> NOT as which is what's in the FALLING leg.

RobMayer avatar Dec 10 '20 16:12 RobMayer