Home > Basic Circuits >Basic Practical Circuits > XOR/XNOR function using a diode bridge and a transistor

XOR/XNOR function using a diode bridge and a transistor

Source: InternetPublisher:无人共我 Keywords: Diode Transistor Updated: 2024/09/05

When designing logic circuits with higher than common supply voltages (such as 24V), you can use a combination of standard logic families and a voltage regulator to interface through a level converter. Alternatively, if the logic is not too complex and the speed is not very high, you can use discrete components to build gated circuits that run directly from the current voltage. The AND, OR, and NOT functions of discrete components are relatively simple and clear, but XOR and XNOR functions usually require a combination of multiple AND, OR, and NOT basic functions.

This example shows an unusual way to perform the XOR function using two resistors, four diodes, and a transistor. The NPN structure obtains an XNOR operation, while the PNP structure obtains an XOR operation.

Consider the XNOR circuit in Figure 1a. When the inputs of the two gates A or B are in opposite logic states, there is a high voltage drop across the base-emitter junction minus the low voltage minus 1.2V, and the resulting voltage is forward biased. The transistor is turned on, and the logical zero voltage of the collector is approximately 0.6+VL+VCE, where VL is the low voltage and VCE is the collector-emitter voltage. When the inputs A and B are in the same logic state, the base-emitter junction of the transistor cannot be forward biased, so the output Y is the power supply voltage.

Figure 1. Discrete implementations of XNOR (a) and XOR operations (b) enable standard logic families to operate at higher supply voltages.

  Figure 1. Discrete implementations of XNOR (a) and XOR operations (b) enable standard logic families to operate at higher supply voltages.

The choice of 6.8kΩ on the collector depends on whether standard TTL logic or CMOS logic is driving the A and B inputs, and can be selected based on the application. The CMOS4000 series can reliably source or sink 1mA at a 5V supply. Slow-speed TTL can source 0.4mA and sink 8mA. For the base current, a 0.4mA logic 1 drive current is sufficient, but a logic 0 at the A or B terminal forms an emitter current, and the 1mA sink current limit of CMOS becomes a problem. With a net current of 1mA and an output load maintained at approximately 250μA, a 6.8kΩ resistor (0.75mA×6.8kΩ) must be selected to obtain a voltage drop of approximately 5V.

Then, consider the XOR structure, in which case the logic 0 of either A or B is relative to the base, and the logic 1 is relative to the emitter. The logic 1 voltage on Y is VH-0.6V-VCE, while the logic 0 is approximately 0V, but the current is limited by the collector resistor.

The problem here is that the output current of TTL logic 1 is about 0.4mA, which is the emitter current of the transistor. When the collector resistor is selected as 10kΩ, its voltage drop can reach nearly 4V. This level is enough to drive CMOS loads, but it is not the case for TTL. When Y is logic 0, its logic 0 input requires at least 0.4mA of current. 10kΩ cannot provide this current. However, taking the previous X NOR structure and adding an inverting transistor after Y, we get the XOR function (Figure 1b). XOR seems to only apply to CMOS/TTL inputs at the A and B terminals, and can only drive CMOS at the output Y.

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号