Boolean logic

<< Previous: Producing robust programs test Next: Boolean logic test >>

Boolean logic

Boolean logic is understanding the logic with which Boolean expressions are evaluated. The Boolean expressions this course covers are NOT, AND, OR & XOR. Each one has its own logic gate symbol, truth table, and Boolean expression symbol.

AND/CONJUNCTION


The AND logic gate, takes two inputs and outputs true if both inputs are true and false in all other cases. The logic symbol is seen at the top. Next is the logic notation with ^ representing AND. The truth table shows all outputs for each possible combination of inputs.

OR/DISJUNCTION


An OR logic gate, accepts two inputs and outputs true if either input is true and false only when both inputs are false. The logic notation for OR is V. The truth table shows all outputs for each possible combination of inputs.

XOR/EXCLUSIVE DISJUNCTION


The XOR or exclusive OR, takes two inputs and outputs true if the inputs differ and false if they are both the same. The notation for XOR is V. The truth table shows all outputs for each possible combination of inputs.

NOT/NEGATION


The NOT logic gate, takes only one input and outputs the opposite. The notation used for negation is ¬. The truth table shows all outputs for each possible combination of inputs.

Logic circuits

Logic circuits are made up of multiple inputs and multiple gates. The output of each gate will be represented in the truth table. In the example below first we perform an OR on inputs A and B. Then we perform an AND on the output of that and input C.

Knowledge check


Questions:
Correct:

Question text


<< Previous: Producing robust programs test Next: Boolean logic test >>

© All materials created by and copyright S.Goff