r/TuringComplete • u/jamesis135 • 27d ago
IRL Computer Building
Hey, so I'm trying to build the leg architecture IRL and I think I have it mostly figured out, but I can't figure out how to do the delay lines. I'd like the computer to be hand clocked (every time you press a particular button a tick passes) but idk how I'd actually do this. Does anyone have ideas for how I could do this/what components I would use for it?
2
Upvotes
7
u/Delicious-Ad2562 27d ago
ticks don't really exist in real life, and turing complete abstracts a lot of the clock timing away. I would look at doing something like this https://eater.net/8bit
3
u/pruby 27d ago
The logical equivalent (updates on a particular clock edge, on each cycle exposes the value that was its input on previous cycle) would be a D Flip-flop (not to be confused with a D latch).
The real implementations involve circular connections between gates, which Turing Complete doesn't handle, hence the abstracted delay line.
1
u/dmdeemer 24d ago
The basic component you need is a D flip-flop. https://www.ti.com/lit/ds/symlink/sn74hc74.pdf
However, you are going to need a lot of them, and sending a clock to so many flip-flops means you need to design your clock distribution network carefully. As a rule of thumb, the propagation delay in copper wire is 7 cm/ns. The propagation time through a flip-flop is probably a minimum of 10ns, so if the path difference were worse than 70cm, you could have a bit skip a cycle. You want to buffer your clock, probably with inverters, to manage the fan-out (the number of clock inputs connected to each buffer output), and make sure that the clock signal goes through the same number of inverters to each flip flop.
You also want to debounce your clock. The easiest way is with an RC filter and a Schmitt trigger (like a 74HC14). Choose R and C so that their product is at least 0.05 seconds (like 1uF and 50kOhm). The filter will slow down the signal and the schmitt trigger will add hysteresis so that it can't have any very short pulses.
So now that I've given you an answer assuming you are using basic CMOS gates, what are you using for your building blocks?
1
u/Fastpast93 6d ago
I would just use Rising Edge Detection. Depending on how fast your clock cycles are (if it's hand clocked VERY VERY slow) you can just use a NOT gate into an AND where the clock pulse goes into one port of the AND and the input of the NOT.