What logic gates are required for Turing completeness?

后端 未结 7 2197
失恋的感觉
失恋的感觉 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: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

提交回复
热议问题