Gates in decisions: NAND, NOR and XOR
Answers are for parents and teachers.
1
A cupboard opens when the code is right and the lock is not jammed. Write the inputs as questions, the output, the formula and the table (A for the code, B for jammed).
A: is the code right? B: is the lock jammed? Y: does the cupboard open? Y = A·¬B. The rows 00, 01, 10, 11 give 0, 0, 1, 0.
2
Show on all four rows that NOT (A AND B) equals (NOT A) OR (NOT B).
Both columns give 1, 1, 1, 0 for the rows 00, 01, 10, 11.
3
Which gate gives the output 1 for exactly the rows 00 and 11?
XNOR (NOT XOR): its output is 1 when the two inputs are equal.
4
What does this PHP line print? echo (int)!(1 && 0), " ", (int)!(0 || 0), " ", 1 ^ 1;
1 1 0.
5
What do Console.WriteLine(True Xor True) and Console.WriteLine(Not (True Or False)) print in VB.NET?
False and False.