
Jorge O. answered 09/28/23
M.S. in Computer Engineering, with 5+ years of teaching
For a regular XOR gate, the output is 1 only if the inputs differ. Boolean expression is A XOR B, or in table form:
However, the image shows that some inputs might be inverted before arriving at the XOR gate. If we take the first image, the Boolean expression is NOT(A) XOR B. It's useful to add another column to the truth table:
Notice that the /A column is just NOT(A). NOW it's a lot easier to see when NOT(A) and B are different values, namely the first and last rows. So, the truth table output becomes:
You can use the same process to solve for the second and third problems.
For the last three problems, a NAND gate is only false when both the inputs are true:
Add extra columns for each input that's inversed before the gate, and use the same method to write the boolean expression and truth table results.