[sdiy] an XOR question

Michael Baxter mab at cruzio.com
Sun Sep 12 01:19:25 CEST 2004


Dan,

Just cascade XOR2 gates, instead of making a tree out of them. The truth 
table for XOR4 in fact does go H for an odd number of inputs H. 

Due to limited graphic options here, I'll just inline the circuit for you
using structural Verilog, something you could build with 4070:

module xor4(f, i0, i1, i2, i3);
// module ports
output f;
input i0, i1, i2, i3;

// internal interconnect wires
wire aw, bw;

// structural Verilog implementation of xor4 using 2-wide xor primitive
xor U0 (aw, i0, i1);
xor U1 (bw, aw, i2);
xor U2 (f, bw, i3);

endmodule // xor4

Best,
Michael



On Sat, 11 Sep 2004, Schierl, Dan wrote:

> Hi list--
> I have an application I'm working on in which I need to perform an exclusive OR on 4 inputs. Since I don't think anyone makes a 4-input XOR, I tried to rig something up using some CMOS chips. My first attempt was a little too simplistic (i.e. wrong), which I didn't realize until I'd already wired it into my application. I think my second attempt works (haven't tried it yet, tho) but i think it might be overkill. 
>  
> Go here: http://people.msoe.edu/~schierld/temp/xor.html to see my two ideas.
>  
> My question is: the second idea is pretty much a literal definition of an XOR gate, but I wonder if there are any trick ways to make one of these with fewer chips. Any thoughts you might have would be appreciated. thanks!
> 



More information about the Synth-diy mailing list