Live data from Hacker News

MyNOR: Single board computer that uses a single NOR gate as its ALU

mynor.org

31–40 of 70 posts

Re: MyNOR: Single board computer that uses a single NOR gate as its ALU

#31

I wonder how this ALU works. From what I remember ALUs use lot of XOR gates because an adder is simply a network of XOR gates with carry propagation. How could a NOR gate do one bit addition? Add two bits ... XOR ... NOR 0 + 0 = 0...........0...........1 0 + 1 = 1...........1...........0 1 + 0 = 1...........1...........0 1 + 1 = 0...........0...........0

I think the idea is that you use registers and apply the NOR gate multiple times. In this sense the NOR gate is universal, while an OR gate nor a XOR gate are neither universal. I.e. XOR(x,y) = NOR(0, NOR(NOR(x,y), NOR(NOR(x,0),NOR(y,0))))) (maybe not the most minimal version and maybe even wrong)

Fun logic tongue twister: Neither an or gate nor an xor gate are universal

Re: MyNOR: Single board computer that uses a single NOR gate as its ALU

#32

What sort of simulator is required to go from “running” to ordering a prototype board 26 days later? I had assumed physical breadboards and wires and chips were always necessary to prototype... 2019-11-02 The first version of the MyNOR simulator is running. The circuit works! 2019-11-17 I have finished the work on the microcode. I added support for MyNOR to my cross-assembler myca. 2019-11-28 PCB layout completed. A…

Solderless breadboards are the equivalent of exploratory programming. If you know what you want to make you might as well go for a PCB (you can simulate the logic quite nicely these days).

Re: MyNOR: Single board computer that uses a single NOR gate as its ALU

#33

What sort of simulator is required to go from “running” to ordering a prototype board 26 days later? I had assumed physical breadboards and wires and chips were always necessary to prototype... 2019-11-02 The first version of the MyNOR simulator is running. The circuit works! 2019-11-17 I have finished the work on the microcode. I added support for MyNOR to my cross-assembler myca. 2019-11-28 PCB layout completed. A…

When I was in university, we used Logisim[0] for our intro to digital logic class. I think you could probably simulate such a computer in this tool if you wanted something intuitive. Otherwise you can prepare your design in a high level logic language like Verilog and test it using Verilator [1]. Naturally there is always a risk when going from running in a simulator to the real PCB.

[0] http://www.cburch.com/logisim/ [1] https://www.veripool.org/wiki/verilator

Re: MyNOR: Single board computer that uses a single NOR gate as its ALU

#34

Earlier quoted context omitted.

False advertising, then, IMO.

...but that's exactly the claim, restated.

Not really. It's completely trivial, if extremely slow (which the article acknowledges) to emulate an ALU in software, with access to a single, universal hardware gate. Why don't they just say "we put a NOR gate on a chip, then added all this other stuff (RAM, boot EEPROM, etc.) to make it function as a computer." That would, at least, be a non-misleading statement of the claim.

Re: MyNOR: Single board computer that uses a single NOR gate as its ALU

#37
post #5

Earlier quoted context omitted.

From the website: http://www.mynor.org/downloads/NOR-Logic.pdf

Thanks but in the linked PDF they use 12 NOR gates for a ONE bit adder.

Then you need at most 12 registers for a one-bit adder.

Re: MyNOR: Single board computer that uses a single NOR gate as its ALU

#38

What sort of simulator is required to go from “running” to ordering a prototype board 26 days later? I had assumed physical breadboards and wires and chips were always necessary to prototype... 2019-11-02 The first version of the MyNOR simulator is running. The circuit works! 2019-11-17 I have finished the work on the microcode. I added support for MyNOR to my cross-assembler myca. 2019-11-28 PCB layout completed. A…

Solderless breadboards are the equivalent of exploratory programming. If you know what you want to make you might as well go for a PCB (you can simulate the logic quite nicely these days).

This doesn't work for high speed designs though. Probably anything over 20MHz will be difficult to make useful on a breadboard.

Re: MyNOR: Single board computer that uses a single NOR gate as its ALU

#39
From the very first few lines of the description I was wondering how this could be possible. The problem isn't the NOR gate - that's definitely enough for all computation - but how to drive it. Looking at the schematic, it is only wired to bit 0 in the data bus, which is 8 bits. So how do you perform ALU ops on all the other bits? There is no shift data path. How can an 8-bit CPU use a 1-bit ALU with no barreling/bit multiplexing?

It took me a while to find the answer in the description of the add instruction:

http://www.mynor.org/downloads/The_MyNOR_ADD_Instruction.pdf

It uses a lookup table to perform bit rotates. Unfortunately, this kind of breaks the entire idea of a one-NOR ALU data path. Now you have a table-driven 8-bit rotate ALU op (which is the same amount of table space needed for a 4-bit add!), and at that point you might as well ditch the NOR gate and implement everything else in microcode tables too. You can use lookup tables to implement any logic function, of course.

IOW I bet you could just modify the microcode of this thing to make it much faster by replacing the core of the ADD with another table.

Conversely, you can also just implement the NOR operation (or anything else) as control flow in the microcode sequencer, if you have any way to test bits instead, giving you a "zero-gate" ALU (ed: yeah, there is a conditional jump microinstruction).

So while this is definitely a very cool project and interesting design, I do find the claim of one-NOR purity questionable. It cheats. In a fun way, but this isn't a 1-NOR ALU CPU, it's a highly microcoded table-driven CPU that uses a two-transistor NOR gate as a gimmicky ALU component :-)

For implementing a faster ADD with the existing design, tables, and ditching the NOR, the tricky bit is mixing the inputs. One simple optimization would be to have a table that implements "rotate and add one" and one that implements "rotate". Then you can just test bit 0 of one operand, use that to select a table (via control flow) to apply to the second operand, then rotate the first operand, and repeat (2 table lookups). No NOR ops necessary. You could test two bits and cut it down to 3 table lookups per 2 bits added, or 5 table lookups per 4 bits added by just adding more tablespace. The issue here is you still need the flop+NOR to mix inputs bit by bit (even if just as control flow), but since addresses are split into halves, you could also have a table that converts one operand into the right table address MSB to index a 4-bit addition with rotate, for each nybbke. That gives you 8-bit addition in 4 table lookups, 256+256+4096 bytes of tables, and no conditional jumps, flip-flop, or NOR necessary. I bet there are other better ways of doing this too.

Post reply on HN