一、XOR
The truth table for the XOR gate is:
A |
B |
C |
TRUE |
TRUE |
FALSE |
TRUE |
FALSE |
TRUE |
FALSE |
TRUE |
TRUE |
FALSE |
FALSE |
FALSE |
This can be written as:
C = A XOR B
Jumper A |
Jumper B |
Result |
Cleared the high jump |
Cleared the high jump |
Competition not over |
Cleared the high jump |
Knocked down the bar |
Competition over |
Knocked down the bar |
Cleared the high jump |
Competition over |
Knocked down the bar |
Knocked down the bar |
Competition not over |
也即,这个运算用于判断比赛是否结束。
二、AND
Truth table for the AND gate.
A |
B |
C |
TRUE |
TRUE |
TRUE |
TRUE |
FALSE |
FALSE |
FALSE |
TRUE |
FALSE |
FALSE |
FALSE |
FALSE |
Note that the truth table for the two inputAND gate is bigger than the truth table for the NOT gate. This is because wehave to take into account that each of the two inputs can be in one of two differentstates, so there are four possible combinations of inputs.
Another way of writing this is C = AAND B.
RAIN |
HEAT |
WEATHER |
Dry |
Hot |
Good |
Dry |
Cold |
Bad |
Wet |
Hot |
Bad |
Wet |
Cold |
Bad |
The weather is good if it is hot AND dry.
三、OR
Truth table for the OR gate.
A |
B |
C |
TRUE |
TRUE |
TRUE |
TRUE |
FALSE |
TRUE |
FALSE |
TRUE |
TRUE |
FALSE |
FALSE |
FALSE |
Another way of writing this is:
C = A OR B
You can enter the house if either the backdoor or the front door is unlocked. Only if both are locked will you be left onthe doorstep.