Perform the XOR/XNOR function with a diode bridge and a transistor
|Click here to download a PDF|
When designing logic for higher-than-usual supply voltages, such as 24V, you can use a voltage regulator with a standard logic family and interface it through level shifters. Alternatively, if the logic is not too complex and the speed is not extensively high, you can build gates from discrete components and operate them directly from the available voltage. Discrete-component AND, OR, and NOT functions are relatively straightforward, but XOR and XNOR functions usually require combining several of the basic AND, OR, and NOT functions.
This Design Idea presents an unusual method of performing the exclusive functions with two resistors, four diodes, and one transistor. The NPN configuration results in the XNOR operation, and the PNP configuration gives the XOR operation.
The choice of 6.8 kΩ at the collector is based on driving the A and the B inputs with standard transistor-transistor or CMOS logic, and you can change it to suit your application. The CMOS 4000 family can reliably source or sink 1 mA with a 5V supply. Low-speed TTL can source 0.4 mA and sink 8 mA. A 0.4-mA logic-one drive is sufficient for the base current, but the logic zero at either A or B forms the emitter current and is of more concern with regard to the limited 1-mA sink of the CMOS. With a net 1-mA current and approximately 250 μA remaining for the output load, you must choose a 6.8-kΩ resistor (0.75 mA×6.8 kΩ) to drop approximately 5V.
The concern here is with the TTL logic-one output current of approximately 0.4 mA, which is the transistor’s emitter current. With the choice of 10 kΩ for the collector resistor, the voltage drop across it can reach nearly 4V. This level would be tolerable for driving CMOS loads but not for TTL, which demands a current of at least 0.4 mA for logic-zero inputs when Y is at logic zero. The 10-kΩ resistor cannot provide this current. However, using the previous XNOR configuration and another inverting transistor after Y, you can obtain the XOR function (Figure 1b). The XOR seems to be suitable only for the CMOS/TTL input at A and B and capable of driving only CMOS at output Y.