Basic Logic Gates and De Morgan's Theorem Discussion D5.1 Appendix D
Basic Logic Gates and Basic Digital Design NOT, AND, and OR Gates NAND and NOR Gates XOR and XNOR Gates DeMorgan’s Theorem
NOT Gate -- Inverter X Y Behavior: The output of a NOT gate is the inverse (one’s complement) of the input
Y = ~X (Verilog) Y = !X (ABEL) Y = not X (VHDL) Y = X’ Y = X Y = X (textook) not(Y,X) (Verilog) NOT
X~X~~X = X X ~X ~~X
AND Gate AND X Y Z Z = X & Y X Y Z
X & Y (Verilog and ABEL) X and Y (VHDL) X Y X * Y XY(textbook) and(Z,X,Y)(Verilog) AND U V
OR Gate OR X Y Z Z = X | Y X Y Z
OR X | Y(Verilog) X # Y(ABEL) X or Y(VHDL) X + Y(textbook) X V Y X U Y or(Z,X,Y) (Verilog)
Y = ~X not(Y,X) Summary of Basic Gates NOT X Y X Y Z XY X Y Z AND OR X Y Z X Y Z Z = X & Y and(Z,X,Y) Z = X | Y or(Z,X,Y) Any logic circuit can be created using only these three gates
Basic Logic Gates and Basic Digital Design NOT, AND, and OR Gates NAND and NOR Gates XOR and XNOR Gates DeMorgan’s Theorem
NAND Gate NAND X Y Z X Y Z Z = ~(X & Y) nand(Z,X,Y)
NAND Gate NOT-AND X Y Z W = X & Y Z = ~W = ~(X & Y) X Y W Z W
2-Input NAND Gate NAND X Y Z Z = ~(X & Y) nand(Z,X,Y) X Y Z
NOR Gate NOR X Y Z X Y Z Z = ~(X | Y) nor(Z,X,Y)
NOR Gate NOT-OR X Y W = X | Y Z = ~W = ~(X | Y) X Y W Z Z W
2 Input NOR Gate NOR X Y Z Z = ~(X | Y) nor(Z,X,Y) X Y Z
Basic Logic Gates and Basic Digital Design NOT, AND, and OR Gates NAND and NOR Gates XOR and XNOR Gates DeMorgan’s Theorem
Exclusive-OR Gate X Y Z XOR X Y Z Z = X ^ Y xor(Z,X,Y)
XOR X ^ Y(Verilog) X $ Y(ABEL) Y xor(Z,X,Y) (Verilog)
2-Input XOR Gate XOR X Y Z Z = X ^ Y xor(Z,X,Y) X Y Z Note: if Y = 0, Z = X if Y = 1, Z = ~X Therefore, an XOR gate can be used as a controlled inverter
Exclusive-NOR Gate X Y Z XNOR X Y Z Z = ~(X ^ Y) Z = X ~^ Y xnor(Z,X,Y)
XNOR X ~^ Y(Verilog) !(X $ Y)(ABEL) Y xnor(Z,X,Y) (Verilog)
2-Input XNOR Gate XNOR X Y Z Z = ~(X ^ Y) Z = X ~^ Y xnor(Z,X,Y) Note: Z = 1 if X = Y Therefore, an XNOR gate can be used as an equality detector X Y Z
Basic Logic Gates and Basic Digital Design NOT, AND, and OR Gates NAND and NOR Gates XOR and XNOR Gates DeMorgan’s Theorem
NAND Gate X Y X Y Z Z Z = ~(X & Y)Z = ~X | ~Y = X Y W Z X Y ~X ~Y Z
De Morgan’s Theorem-1 ~(X & Y) = ~X | ~Y NOT all variables Change & to | and | to & NOT the result
NOR Gate X Y Z Z = ~(X | Y) X Y Z X Y Z Z = ~X & ~Y X Y ~X ~Y Z
De Morgan’s Theorem-2 ~(X | Y) = ~X & ~Y NOT all variables Change & to | and | to & NOT the result
De Morgan’s Theorem NOT all variables Change & to | and | to & NOT the result ~X | ~Y = ~(~~X & ~~Y) = ~(X & Y) ~(X & Y) = ~~(~X | ~Y) = ~X | ~Y ~X & ~Y = ~(~~X | ~~Y) = ~(X | Y) ~(X | Y) = ~~(~X & ~Y) = ~X & ~Y