boolean_algebra.nor_gate

A NOR Gate is a logic gate in boolean algebra which results in false(0) if any of the inputs is 1, and True(1) if all inputs are 0. Following is the truth table of a NOR Gate:

Truth Table of NOR Gate: | Input 1 | Input 2 | Output | | 0 | 0 | 1 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 0 |

Code provided by Akshaj Vishwanathan

https://www.geeksforgeeks.org/logic-gates-in-python

Functions

nor_gate(→ int)

truth_table(→ str)

Module Contents

boolean_algebra.nor_gate.nor_gate(input_1: int, input_2: int) int
>>> nor_gate(0, 0)
1
>>> nor_gate(0, 1)
0
>>> nor_gate(1, 0)
0
>>> nor_gate(1, 1)
0
>>> nor_gate(0.0, 0.0)
1
>>> nor_gate(0, -7)
0
boolean_algebra.nor_gate.truth_table(func: collections.abc.Callable) str
>>> print(truth_table(nor_gate))
Truth Table of NOR Gate:
| Input 1  | Input 2  |  Output  |
|    0     |    0     |    1     |
|    0     |    1     |    0     |
|    1     |    0     |    0     |
|    1     |    1     |    0     |