The XOR Gate

XOR Gate, Diode XOR Gate, BJT XOR gate

 The logic symbol is the same as the XOR gate with an inversion bubble placed at the output side.


Learning Objectives:

  • Introducing AND gate implementation using


Working:

Case 1: 

Input A = 0

Input B = 0

Output = 0


Case 2:

Input A = 0

Input B = 1

Output = 1


Case 3:

Input A = 1

Input B = 0

Output = 1


Case 4:

Input A = 1

Input B = 1

Output = 0







Logical Expression

Y = A ⊕ B



2 Input XOR Gate

Input A

Input B

Output

0

0

0

1

0

1

0

1

1

1

1

0


Logical XOR Gate (Explain with the help of switches)



Implementation Using Diode Logic

XOR is not among the basic logic gates. There are many different ways to implement XOR logic with the help of diodes. I tried the circuit below. The circuit is for learning purposes. The diode logic is no longer used these days.


Case 1:

Both the inputs are connected to the ground. All diodes are off. The output of the circuit is zero (logic 0).


Case 2:

In this case, look at the schematic, switch S1 is closed. Diode D1, LED, D2, D4 turns ON. 


Case 3: 

Look at the schematic in case 3. Switch S2 is closed. Diodes D2, LED and D4 turn ON. 


Case 4:

Look at the schematic in case 4. Switch S1 and S2 both are closed (connected to the 5V sources). Carefully looking at all the junctions, there is no potential difference between these junctions ideally (there is no potential drop across ideal diodes). And hence no current flows through any diode.



Implementation Using Transistor Logic

XOR is a little bit difficult to implement with the help of BJT. There are many other ways to implement XOR logic. I come up with this simple circuit that consists of three BJT.


Case 1:

Look at the schematic in case 1. Both switches are tied to the ground and hence Q1, Q2 and Q3 transistors are off. Output is zero (logic low).


Case 2:

Look at the schematic, switch 1 is connected to a 5V source. Closely looked at Q1. The base of the Q1 transistor is connected to a 5V source. The collector is powered by a 12V source and the emitter is connected to the ground. It is a common emitter configuration. Transistor Q1 is ON while Q2 is OFF. The output of the Q1 transistor is connected to the base of Q3. The positive voltage at the base will turn ON Q3 and hence output goes high. 


Case 3:

Same as case 2.


Case 4:

Look at the schematic in case 4. The base of the transistor Q1 is connected to a 5V source and the emitter is also connected to a 5V source. To operate a transistor VBE = VB - VE ≥ 0.7V. 

In our case VBE = 0. Since base and emitter are at the same potential. So, transistor Q1 is off. Similarly, this is true for Q2. Both transistors (Q1 and Q2) are off. There is no voltage at the base of Q3. So, the output is also low. 






The NOR Gate

The NOR Gate - Introduction, NOR Gate Circuit Using BJT, Diodes and Switches

 The OR Gate - Truth Table, Timing Diagram, Switch Model:

The logic symbol is the same as the OR gate with an inversion bubble placed at the output side. Its function is NOT-OR. It has a similar truth table to that of a NAND gate. Its output is high only when both of the inputs are low. 

Learning Objectives:

  • Introducing NOR gate implementation using


Working:

Case 1: 

Input A = 0

Input B = 0

Output = 1


Case 2:

Input A = 0

Input B = 1

Output = 1


Case 3:

Input A = 1

Input B = 0

Output = 0


Case 4:

Input A = 1

Input B = 1

Output = 0


In figure 1 the waveforms or timing diagram of the NOR gate is also given. The input and output signals are represented by the pulses (a pulse of square wave). There are two inputs A and B and output is Y as shown. The output pulse falls to 0V when any one of the two inputs are high.



NOR gate waveforms, logical expression
Figure 1: NOR gate - schematic symbol, truth table, logical equation and waveforms
Circuit simulation of NOR gate
Figure 2: Simple circuit simulation results


Truth Table Of 2-Input NOR Gate:

2 Input NOR Gate

Input A

Input B

Output

0

0

1

1

0

0

0

1

0

1

1

0


Logical Expression:

Y = (A + B)C


Logical NOR Gate (Explain with the help of switches) | NOR Gate Switch Logic:


Switch model of NOR gate
Figure 3: Switch Model of NOR gate

In the above figure, there is a switch model of a NOR gate. It is easy to understand the operation of the gate with the help of switches. The inputs are represented by two switches A and B. The output is represented by an LED. The LED turns ON only when both of the switches are off (open). The only path for the current to flow is from the LED. If anyone switch turns ON, the current will flow from the least resistive path.


Implementation Using Diode Logic


NOR gate diode circuit | NOR gate using diode logic
Figure 4: Diode circuit of NOR gate

Case 1:


Both switches are off (opened), and hence both
diodes are off. Current flows from V3 to LED and ground.


Case 2:

In case 2, look at the schematic. Switch S1 is ON while S2 is off. The positive terminal of the diode is connected to a 5V source and hence turns on. On the negative terminal of D1, there is a positive potential because of V3. So, there is no or very little current will flow.


Case 3:

Same as case 2.


Case 4:

Same as case 2 and case 3.





Implementation Using Transistor Logic

NOR gate is easily implemented with the help of two BJT transistors. The transistors are connected in differential pair form. It is a common emitter configuration. The output is taken from the collector while the input is at base.

NOT gate BJT circuit | NOR gate implementation using Transistors
Figure 5: BJT circuit of NOR gate
Case 1:


Look at the schematic diagram in case 1. Both switches are off. Both transistors are off. The only path available for the current is through the LED. And Hence LED glows. 


Case 2:

In case 2, S1 is on and hence Q1 is ON. The current will flow from Q1 to the ground. No current will flow through the LED.


Case 3:

Same as case 2.


Case 4:

Same as case 2 and case 3.







The OR Gate - Truth Table, Circuit Symbol, Diode Circuit & Transistor Circuit

<meta content="width=device-width, initial-scale=1" name="viewport"></meta> <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> <script async="" id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

 The OR Gate:

The OR gate performs logical OR function. The output is high when any one input is high. 


Learning Objectives:

  • Introducing OR gate implementation using


Working:

Case 1: 

Input A = 0

Input B = 0

Output = 0


Case 2:

Input A = 0

Input B = 1

Output = 1


Case 3:

Input A = 1

Input B = 0

Output = 1


Case 4:

Input A = 1

Input B = 1

Output = 1


In figure 1 the waveforms or timing diagram of OR gate are also given. The output pulse rises from 0 to 1 when any one of the two inputs are high.



OR gate waveforms, truth table, logical expression
Figure 1: OR Gate circuit symbol, truth table, logical expression and waveforms


OR gate basic circuit, Multisim simulation results
Figure 2: OR gate basic working


Truth Table Of OR Gate:


2 Input OR Gate

Input A

Input B

Output

0

0

0

1

0

1

0

1

1

1

1

1


Logical Expression Of OR Gate:

Y = A + B


Logical OR Gate (Explain with the help of switches) | Switch Model and OR Logic:

The OR gate implementation using switches | How to produce or logic using switches
Figure 3: OR gate switch model

Before starting the circuit model of OR gate, it is better to understand the concept of OR logic with the help of switches. The figure shows the switch model of OR gate. Two switch (switch A and switch B) are connected in parallel in between input and output. Input doesn't reach when both switches are off (open). If anyone switches on (closed) input reaches to output. 

Implementation Of OR Gate Using Diode Logic


How to implement OR gate using switches?
Figure 4: OR gate diode circuit

Practically diode circuit models are not used. But for beginners and better understanding of circuit analysis, implementation and designing, it is better to understand this topic.

Case 1:

See schematic in case 1, both inputs are connected to ground. Both diodes (D1 and D2) are off. Output is zero (LED remains off).


Case 2:

See schematic in case 2. Switch S1 is connected to a 5V source, turns on the D1 diode. Switch S2 is connected to the ground, D2 remains off. The current flows from 5V source to LED and the current grounded.


Case 3: 

 This case is the same as case 2.

Case 4:

See schematic in case 4. Both switches (S1 & S2) are connected to a 5V voltage source. As a result both the diodes are turned on. Current flows from 5V sources to the LED and grounded.


Implementation Of OR Gate Using Transistor Logic:


BJT OR gate | OR gate implementation using bipolar junction transistors
Figure 5: OR gate Bipolar Junction Transistor circuit

Case 1:

Look at the schematic in case 1, both switches are open. There is no voltage at the base. Both transistors are turned off. 


Case 2:

Look at the schematic in case 2, S1 is closed and hence Q1 is turned on. The transistor is in common collector configuration. Output is taken from the emitter. Once the transistor is ON, LED starts to glow. 


Case 3: 

Same as case 2.


Case 4:

Both transistors are ON. Current flows from emitter to collector and hence LED turns ON or output is logic high.






Popular Posts