5 ms·
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
by JPLeRouzic 6y ago
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
- theresistor 6y agoNOR (like NAND) is a universal logic gate. You can build any other logic gate out of just NORs. For this ALU, you’d presumably write a subroutine that computed XORs in terms of NORs, and then use that as a primitive for building an adder.
- pmiller2 6y agoYes, but this thing advertises that it uses a single NOR gate as an ALU.
- theresistor 6y agoThat’s just moving the composition between hardware and software - the equivalence still applies. I can build any logic (software) function out of a function that evaluates NOR.
- pmiller2 6y agoFalse advertising, then, IMO.
- garmaine 6y ago...but that's exactly the claim, restated.
- pmiller2 6y agoNot 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.
- magicalhippo 6y agoYes, it's a "Single board computer with 20 ICs, and a single-gate ALU". To me it's not really an ALU either, since the NOR gate doesn't really do the job I expect from an ALU.
- garmaine 6y agoThat’s how I interpreted the OP though... I really don’t know what you were reading into it.
- srott 6y agoNo, AFAIU the computation is serialized, driven by the microcode and this gate is reused for every step
- captn3m0 6y agoFrom the website: http://www.mynor.org/downloads/NOR-Logic.pdf http://www.mynor.org/downloads/NOR-Logic.pdf
- JPLeRouzic 6y agoThanks but in the linked PDF they use 12 NOR gates for a ONE bit adder.
- rrobukef 6y agoThen you need at most 12 registers for a one-bit adder.
- amenghra 6y agohttp://www.mynor.org/downloads/MyNOR-HowItWorks.pdf http://www.mynor.org/downloads/MyNOR-HowItWorks.pdf has some more info.
- dzamlo 6y agoThe nor gate (like nand) is a universal gate. You can implement all the other gate with a combination of nor gate. See https://en.m.wikipedia.org/wiki/NOR_logic#XOR https://en.m.wikipedia.org/wiki/NOR_logic#XOR for example.
- OJFord 6y agoNot with a 'single NOR gate'.
- pjc50 6y agoYes .. if you feed its output to its input on the next cycle.
- JPLeRouzic 6y agoThen the ALU includes the sequencer and the microprogram. Shifts are implemented with look-up tables. Anyway it's a beautiful work.
- dvdkhlng 6y agoI 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)
- ant6n 6y agoFun logic tongue twister: Neither an or gate nor an xor gate are universal
- apetersonBFI 6y agoAny expression or series of gates of only ORs has the non-decreasing property, changing an input from 0 to 1 can never change the result from 1 to 0. So you can't implement any gate that needs that using ORs. Similarly, any collection of XOR gates is simply a summation mod 2.