Learn Logic Gates

AND Gate (A && B)

Both must be 1 for the result to be 1, otherwise 0.

ABA && B
000
010
100
111

OR Gate (A || B)

At least one must be 1 for the result to be 1, otherwise 0.

ABA || B
000
011
101
111

NOR Gate (!(A || B))

Only 1 when both inputs are 0.

AB!(A || B)
001
010
100
110

NAND Gate (!(A && B))

Only 0 when both inputs are 1.

AB!(A && B)
001
011
101
110