Input Output 0 1 1 0
.....0 10 | 0 01 | 0 1.....0 10 | 0 11 | 1 10 | 11 | 0
apparently whenever you can swap the 0's for 1's and 1's for 0's in the truth table and the truth result remains unchanged.
Truth table of 'NAND' is 0 0 - 1 0 1 - 1 1 0 - 1 1 1 - 0 NAND is just opposite of AND as the name itself suggest NAND is the not of AND Truth table of "NOR" is 0 0 - 1 0 1 - 0 1 0 - 0 1 1 - 0 NOR is just opposite of OR as the name itself suggest NOR is the not of OR.
It is the very same in every programming language. For example: AND: 0 && 0 = 0 0 && 1 = 0 1 && 0 = 0 1 && 1 = 1
1 and 0 equal 0. "AND" behave like multiplication.
Its truth table is: input output 0 1 1 0
Input Output 0 1 1 0
I don't really know what this is supposed to mean, if you want to print the truth-table of the NAND-gate that will be something like this: for (a=0; a<=1; ++a) for (b=0; b<=1; ++b) printf ("%d %d %d\n", a, b, !(a&&b))
. p . . . . . q. 0 . . . . . 1. 1 . . . . . 0
.....0 10 | 0 01 | 0 1.....0 10 | 0 11 | 1 10 | 11 | 0
A NAND gate is a digital logic gate that outputs false only when all its inputs are true; otherwise, it outputs true. The truth table for a NAND gate with two inputs (A and B) is as follows: | A | B | Output (A NAND B) | |---|---|--------------------| | 0 | 0 | 1 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 0 | In this table, '0' represents false and '1' represents true.
apparently whenever you can swap the 0's for 1's and 1's for 0's in the truth table and the truth result remains unchanged.
Truth table of 'NAND' is 0 0 - 1 0 1 - 1 1 0 - 1 1 1 - 0 NAND is just opposite of AND as the name itself suggest NAND is the not of AND Truth table of "NOR" is 0 0 - 1 0 1 - 0 1 0 - 0 1 1 - 0 NOR is just opposite of OR as the name itself suggest NOR is the not of OR.
You cant!
#include<iostream> int main() { std::cout << "Truth table for AND gate\n\n"; std::cout << " |0 1\n"; std::cout << "-+---\n"; for (unsigned a=0; a<2; ++a) { std::cout << a << '|'; for (unsigned b=0; b<2; ++b) { std::cout << (a & b) << ' '; } std::cout << '\n'; } std::cout << std::endl; }
It is the very same in every programming language. For example: AND: 0 && 0 = 0 0 && 1 = 0 1 && 0 = 0 1 && 1 = 1