An emulator for a single-instruction (NOR) CPU
The NOR Machine
The idea is to use just one function to compute everything. It suffices to do this for bits: bytes consist of bits, and if we can compute bits, we also can compute bytes, and everything made up of bytes. That is, everything.
There are sixteen boolean functions of two arguments. Two of them are special: NOR and NAND. The other fourteen functions can be computed using only either NOR or NAND. We’ll use NOR.
NOR’s truth table is as follows:
===== ========
Input Output
===== ========
A B A NOR B
----- --------
0 0 1
0 1 0
1 0 0
1 1 0
===== ========
https://github.com/yuanxinyu/NOR-CPU
23 comments
[ 3.0 ms ] story [ 64.6 ms ] threadhttp://klabs.org/history/ech/agc_schematics/
http://hasith.vidanamadura.net/projects/subleq/
https://arxiv.org/pdf/1106.2593v1.pdf
"Our test results demonstrate that computational power of our Subleq OISC multi-processor is comparable to that of CPU of a modern personal computer."
I didn't see that coming for OISC projects. Pleasant surprise. :)
No, IMP does this as well. It has mostly been useful for memristor logic.
I have a suspicion there is a more general mathematical law that says any boolean rule with a 1-of-4 split (either exactly one true or exactly one false) can be used for general computation, if you can make a NOT gate out of it. (Since AND/OR obviously is not workable.) So there should be six possible universal logic gates.A → B |- ~(A & ~B)
1) A → B [by assumption] 1
2) A & ~B [by assumption] 2
3) A [conj. elim. 2] 2
4) B [imp by 1,2] 1,2
5) ~B [conj. elim 2] 2
6) B & ~B [conj 4,5] 1,2
7) ~(A & ~B) [reductio ad absurdum 2,6] 1
{Thus by assuming only A → B we prove that we can derive ~(A & ~B).}
From there you can also trivially prove that ~(A & ~B) |- A → B; thus, they are tautologous and so given the primitives ~ and &, implication is not quite as "special" for a Universal Turing machine. This is merely to show, independent of any construction using only IMP, one can trivially reduce it to more primitive components, thus undermining any claim to a "special" status in the context of universal computation.
As another note, for low gate count processors, you may want to look into bit-serial techniques, as used in the PDP-8/S.
I found Wikipedia entry on MLS-LFSR. How do those end up useful in program counters?
"you may want to look into bit-serial techniques"
You talking about the 1-bit ALU's like these?
https://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Comb/oneb...
Making a comeback in another field:
http://www.caesjournals.org/uploads/IJCAES-CSE-2012-132.pdf
The last diagram in the page you linked shows three 1-bit ALUs chained together to make one 3-bit ALU. As I understand it, the PDP-8/S used a single 1-bit ALU to sequentially calculate each bit in a 12-bit output word, taking 12 cycles to emulate a 12-bit ALU. For the 3-bit example, imagine there being a single ALU which acts first as the rightmost ALU in the diagram, and then once you have the carryout bit it acts as the middle ALU, and finally it acts as the leftmost ALU.
http://www.nand2tetris.org/
https://mitpress.mit.edu/books/elements-computing-systems