What logic gates are required for Turing completeness?

后端 未结 7 2174
失恋的感觉
失恋的感觉 2021-02-05 02:36

My son has been playing Little Big Planet 2 lately, and I noticed that the game editor allows AND gates, OR gates and NOT gates... Is it Turing complete? If so, can anyone recom

相关标签:
7条回答
  • 2021-02-05 02:40

    I'm know I'm late to the game here but yes. I play LBP2, and it has an AND, OR, NOT, XOR, NAND, NOR. You can also add and subtract signals, there is also ways to do binary in the game.

    0 讨论(0)
  • 2021-02-05 02:42

    An idea: you should be able to construct a NAND gate, so you can then build a XOR gate. With XOR and AND you can build a half-adder. Combine half-adders to build a full-adder. That would be a start at least.

    NAND and NOR are basic building blocks for other gates so chances are Turing completeness is just around the corner.

    0 讨论(0)
  • 2021-02-05 02:42

    You can build logic circuit of any complexity with either NAND or NOR gates.

    NAND is an AND with a NOT on the output pin.

    NOR is an OR with a NOT on the output pin.

    Any NAND-based circuit can be rebuilt using NOR's exclusively and vice versa.

    So, you can build any logic circuit given only NAND gates. Or you can use just NOR gates. Or you can use NOT and AND gates. Or you can use NOT and OR gates. Or, you can also use AND, NOT and OR gates: you can certainly reduce the number of transistors by creating an optimal combination by using all three types of gates.

    All this can be proven by boolean algebra using truth tables: any combination of truth tables can be built from a combination of above mentioned gates. When there are two inputs, there are 4 possible combinations of inputs, giving 16 possible truth tables. By using combinations of above mentioned gates you can create all of these 16 truth tables, and so, you don't need 16 different gates. This holds when you add more inputs and outputs, and even when you create registers and latches to create memory bits, CPU registers and/or any sequential logic circuits.

    https://en.wikipedia.org/wiki/NAND_logic

    https://en.wikipedia.org/wiki/NOR_logic

    https://en.wikipedia.org/wiki/Truth_table

    0 讨论(0)
  • 2021-02-05 02:44

    AND, OR and NOT is functionally complete, that is, all possible truth tables can be expressed. Which I believe also makes it turing complete, since you can construct a general purpose processor with any functionally complete set of gates

    0 讨论(0)
  • 2021-02-05 02:55

    You need NOT and one of AND or OR to be able to do all binary logic. This is DeMorgan's Law, basically.

    However, this is not sufficient for Turing completeness. For that you also need random (or reducably equivalent) access (theoretically) infinite memory.

    Odds are, you'll be able to build a flip flop (a D flip flop is built using NANDs, so it's straightforward) using the available logic gates. From those, you can build a register, and with enough of those you'll be equipped to build some simple programs.

    0 讨论(0)
  • 2021-02-05 02:55

    A NAND gate is all that is required, everything can be built from that, so the three you have are plenty. Here's a course that takes you from logic gates, up through building a computer, all the way to writing an operating system: The Elements of Computing Systems: Building a Modern Computer from First Principles

    0 讨论(0)
提交回复
热议问题