図1のように二つの入力に対し,一つの出力を行うボックスがある。このボックスへの入力は“賛成”か“反対”のいずれかであり,入力が二つとも“賛成”のときだけ“賛成”と出力し,その他のときは“反対”と出力する。図2のように,三つの入力を二つのボックスに入力したときの出力に関する記述のうち,正しいものはどれか。
平成26年度 春期 ITパスポート試験 問57
This question's explanation and your answers so far.
問 57
Incorrectア
“Always For if one or more inputs are For” describes the behavior of a logical OR, which is the opposite of Figure 2, where ANDs are cascaded. For example, when Input 1 = For, Input 2 = Against, Input 3 = Against, there is one For, yet the first box outputs Against, and the second box also contains an Against input, so the final output is Against.
Incorrectイ
“Two or more inputs are For” includes the case of exactly two For inputs, and in that case the output is always Against, so it cannot be said to be “always For.” If exactly two inputs are For, one input must be Against, and that Against input necessarily enters one of the boxes, so the final output is certainly Against. For example, when Input 1 = For, Input 2 = Against, Input 3 = For, the first box outputs Against, and the final output is Against too. For is output only when all three inputs are For.
Incorrectウ
Even a single Against makes the final output Against, so “it outputs Against only when two or more inputs are Against” is wrong. For example, when Input 1 = For, Input 2 = For, Input 3 = Against, there is only one Against, but the second box receives an Against input, so the final output is Against. The correct statement is “it outputs Against if one or more inputs are Against.”
- エ
正解 The box behaves as “output For only when both inputs are For, and output Against otherwise,” that is, it works exactly like a logical AND. In Figure 2, Input 1 and Input 2 first go into the first box, and its output together with Input 3 goes into the second box to produce the final output. Therefore the final output = (Input 1 AND Input 2) AND Input 3, so it is For only when all three inputs are For, and it is Against if even one input is Against. Choice エ, “It outputs For only when all three inputs are For,” matches this, so it is correct. Checking it concretely: if all three are For, the first box outputs For, and the second box then has two For inputs and outputs For. If only Input 3 is Against, the first box outputs For but the second box contains an Against input, so it outputs Against. If Input 1 or Input 2 is Against, the first box outputs Against, so the second box outputs Against as well.
- A box that outputs For only when both inputs are For is the same as a logical AND; even when the symbols or wording change, the standard approach is to convert it into a truth table (the correspondence between input combinations and the output).
- When ANDs are cascaded (connected in series), the whole circuit also becomes the AND of all the inputs. A three-input AND means “For only when all are For = Against if even one is Against.”