The Museum of HP Calculators

HP Forum Archive 04

 Implement 'AND' function with 'XOR' function.Message #1 Posted by Tal on 12 Dec 2000, 1:46 a.m. 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.Message #2 Posted by Tom (UK) on 12 Dec 2000, 7:37 a.m.,in response to message #1 by Tal 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.Message #3 Posted by John Kono on 13 Dec 2000, 3:48 a.m.,in response to message #2 by Tom (UK) 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.Message #4 Posted by Joe Panico on 12 Dec 2000, 10:57 p.m.,in response to message #1 by Tal Tal, What are you up to now ??????????? Joe

 Re: Implement 'AND' function with 'XOR' function.Message #5 Posted by Steve (Australia) on 13 Dec 2000, 5:55 a.m.,in response to message #1 by Tal 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 :-)

Go back to the main exhibit hall