Xor Gate
Abstraction and Implementation of Xor Gate in Hardware Design Language and Java™.
Last updated
Abstraction and Implementation of Xor Gate in Hardware Design Language and Java™.
Last updated
The Xor function, also known as Exclusive-OR, returns 1 (true) when either of the inputs are same (both are 0 or both are 1 simultaneously).
Xor Gate can be implemented in four ways: (in fact, they are simplifications by DeMorgan's laws.)
Xor Gate can be implemented using Not, And and Or gates implemented previously as follows:
Another way to implement is to substitute all gates with basic Nand gates, eventually ending up with four Nand gates.
We can simply the expression of first implementation of Xor gate as follows:
Output = A'B + B'A
= A'A + A'B + B'A + B'B (since A'A = B'B = 1)
= (A + B)(A' + B')
In the expression of third implementation of Xor gate, A' + B' can be rewritten as (AB)' [ Nand gate ] using DeMorgan's laws.
(A + B)(A' + B') = (A + B)(AB)'
Similar to the implementations in HDL. While we're not going to implement every implementation, you can try other implementations to see if it works.