Computer science Logic gates
Computer science Logic gates
Truth Tables:
➜
Used to trace the output from a logic gate or circuit
➜Each logic gate is currently restricted to two inputs(except NOT, which has only
one)
➜Each input will give a different output, based onthe logic gate
31
MOJZA
Logic gates:
1) NOT gate Input Output
➜
The output is the opposite of the 0 1
input➜X = NOT A (logic notation)
1 0
) AND gate
2 Input A Input B Output X0 0
➜Output is 1 when BOTH inputs are
0
1➜X = A AND B (logic notation)
0 1 0
1 0 0
1 1 1
1 0 1
1 1 1
32
MOJZA
) NAND gate
4 Input A Input B Output X0 0
➜Opposite of AND gate
1
➜Output will be 1 when both inputs are
NOT 1 0 1 1
➜X = A NAND B
1 0 1
1 1 0
1 1 0
1 0 1
1 1 0
33
MOJZA
:
A B C
1 1 1
problem statement
A
➜Form a logic expression from the problem statement
➜Draw the logic circuit
34
MOJZA
Example:
gas fire has a safety circuit made up of logic gates. It generates an alarm (X = 1) in
A
response to certain conditions.
Input Description Binary value Condition
Solution:
35
MOJZA