and then tried to add a reset mechanism but ended up with a Logical Left Shift instead.
Which is precisely what happened to me when I was fiddling with the setup the other day!
These Faulty Logic Lamp Flip-Flips (FLLFFs, right?) seem to almost have a mystical desire to do binary computing opperations. I hid my FLLFF shifter and reset builds
here, at the bottom of
my thread on flip-flops.
Note that mine run the wrong direction (towards the left), because I'm silly like that.
Most significant bit should be left-most, of course (the other way around). But I gave my rows a little more vertical space, and kept them in line, so it's visually easier to see what's going on and also extend the lines out vertically to more devices, etc:
Note a few things:
- For count to indicate correctly on torches, the torches connected to each counter stage's lamp must be in the on state when the FLLFF input lamps are darker looking. This seemed backwards to me, but I guess that darker indicates actuated, which would be associated with switching state for the first time: off to on.
- Because of the above point, I found that the a (simple) reset always set the count to 11111 (all torches on), so I needed to add +1 after the reset action. (If the reset line had inverted logic state, that's when it becomes a shifter function instead...) I did that using a single self-feedback and gate plugged into the first stage of the counter (but in the reset row of gates). I took the idea from @DicemanX's AND gate reset mechanism.
- I found an invert all bits function, by simply sending input to all the faulty lamps of the counter at the same time. (AKA, compliment or NOT function.) I needed to add an extra buffer gate to the input (1s) stage to invert this layer.
- You can count in 1s, but also in 2s, 4s, 8s, etc, by sending input to that stage of the counter directly. So it's probably more appropriate to call this thing an 'accumulator', since you add to it any other binary number, just by transferring input states to all the appropriate positions at once, and have it ripple through. I could be wrong, in that I'm not sure the gates will always be able to handle this, given there build in protection coding. (Will they sometimes smoke and fail?)
Anyway, here's mine demonstrated doing a subtraction as an addition to an inverted number (and then reverting after, so the second number entered is subtracted from the first):
So anyway. Keep up the good work/play. I'm very interested to see how multiplication will be done most simply. It should just be shifted adding, but I think might require a 3rd 'register' to perform it easily in a setup like these.
Shifting is also one of the two parts of binary to binary coded decimal conversion. The other part (for the
double dabble conversion method) being: +3 if the 4th bit of a BCD digit is st to 1. BCD convertors are all that is currently lacking, now, to interface these counters/calculators to decimal 7-seg displays. It may well be that this algorithm (which Diceman previously implemented with hoiktronics) is not the most appropriate, now, with these gates. I think there are other (more directly reversible) methods and also ways of doing calculations natively with BCD, without converting back and forth to straight binary. But that's beyond my knoweledge, so I'm waiting to be dazzled.