Implement 'AND' function with 'XOR' function. - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: Implement 'AND' function with 'XOR' function. (/thread-7254.html) Implement 'AND' function with 'XOR' function. - tal - 12-12-2000 Hi, everybody! I appreciate it if someone could tell me how to implement 'AND' function with 'XOR' function. Best regards, Tal email: td@chem.ch.huji.ac.il Re: Implement 'AND' function with 'XOR' function. - Tom (UK) - 12-12-2000 I'm almost 100% sure you can't. The XOR function can't tell the difference between '1,1' and '0,0' at it's inputs. Inverting the inputs/output in whatever combination makes a new gate with an XOR or XNOR function. You can of course make and AND function from the following: A AND B = NOT(A) NOR NOT(B) This is not as silly as it seems as in transistor logic a NOR gate can be smaller/faster than an AND gate (which is made from an NAND gate followed by an inverter). Please feel free to correct me on any of the above if I have made an error. Re: Implement 'AND' function with 'XOR' function. - Joe Panico - 12-12-2000 Tal, What are you up to now ??????????? Joe Re: Implement 'AND' function with 'XOR' function. - John Kono - 12-13-2000 It can also be accomplished with an OR and two XORs. ``` | = OR ^ = XOR x ^ y ^ (x | y) ``` The logical reason an OR is required is that an XOR is derived from two ANDs, two NOTs, and an OR (or a logical equivalent thereof): ``` (x & !y) | (!x & y) ``` So, if an AND is desired, the OR must be factored out which, of course, requires an OR operation. Re: Implement 'AND' function with 'XOR' function. - Steve (Australia) - 12-13-2000 If you were to bu trying to build an AND function from XOR gates, then it is indeed possible. Imagine an XOR gate with one input held in a logic 1 state. The gate then acts as an inverter. Similarly, if the input is held low it acts as a non-inverting buffer. Using an additional 2 diodes, and a resistor allows you to "wire-AND" the outputs of two buffers, and then buffer the output. Depending on the nature of the surrounding logic, you could even dispense with the XOR gates :-)