3 ms·
Pretty good but one correction >To build a CPU, you need a few more elements than basic logic gates, namely memory and a way to synchronize everything to a clo
by Symmetry 4y ago
Pretty good but one correction
>To build a CPU, you need a few more elements than basic logic gates, namely memory and a way to synchronize everything to a clock, but this is a good starting point.
You can actually make all that with logic gates! Two NANDs with each's input connected to one of the other's output makes the most basic sort of static memory element. 4 NANDs and an inverter give you a D-latch that lets you synchronize your circuits to the clock signal. You can use fancier techniques that don't correspond to these so well but these are actually all you need.
- amelius 4y agoYeah, but you can't make DRAM cells (although you can emulate them with a lot more hardware).
- dreamcompiler 4y agoYep. You can even build the clock oscillator itself with chained NOT (or NAND) gates in a feedback configuration. It's not a great idea for a production machine but it's much more practical than the software analogy of using a Turing machine for everything.
- tspiteri 4y ago> 4 NANDs and an inverter give you a D-latch that lets you synchronize your circuits to the clock signal. A D latch would be enabled all the time the clock signal is high, so it is not suitable for synchronizing your circuits to the clock signal. What you need is for the device to store the input at the instant when the clock signal goes from low to high. (Using the tech terminology: the 4-NAND D-latch has level triggering, while for the clock you want edge triggering.)
- bcrl 4y agoYou can build an edge triggered flip flop from just NAND gates. Real world gates have delay, which means that you can generate the enable signal by using a NAND gate to invert the clock and generate a pulse on the edge of the clock by ANDing that with the clock.