In: Computer Science
1. write a truth table using this symbol: -->
2. write the inputs for the truth table to the left of the --> and write the outputs for the truth table to the right of the -->
3. write the compliment, or NOT using '
As an example:
The truth table for AND is written this way:
A B --> A AND B
0 0 --> 0
0 1 --> 0
1 0 --> 0
1 1 --> 1
or this way:
A B --> A AND B
a' b' --> 0
a' b --> 0
a b' --> 0
a b --> 1
As another example:
For a 3 input, 2 output truth table, the truth table is written this way:
A B C --> X Y
0 0 0 --> 0 0
0 0 1 --> 1 0
0 1 0 --> 1 0
0 1 1 --> 0 1
1 0 0 --> 1 0
1 0 1 --> 0 1
1 1 0 --> 0 1
1 1 1 --> 1 1
For the output F and the inputs A, B, C, and D, there is this Boolean equation:
F = A XOR B XOR C XOR D
Using the format for truth tables explained in the lab assignment instruction, write the truth table for the Boolean equation.
F = A XOR B XOR C XOR D
For given boolean example A, B, C and D are the inputs. F is the output.
Therefore A, B, C, D should come on the left side of --> and F should come on the right side.
As there are 4 inputs there can be 24 = 16 combinations of inputs
The truth table for given boolean equation is:
A B C D --> F
0 0 0 0 --> 0
0 0 0 1 --> 1
0 0 1 0 --> 1
0 0 1 1 --> 0
0 1 0 0 --> 1
0 1 0 1 --> 0
0 1 1 0 --> 0
0 1 1 1 --> 1
1 0 0 0 --> 1
1 0 0 1 --> 0
1 0 1 0 --> 0
1 0 1 1 --> 1
1 1 0 0 --> 0
1 1 0 1 --> 1
1 1 1 0 --> 1
1 1 1 1 --> 0
In this boolean equation XOR operation is used.
The truth table for XOR opration on 2 inputs A and B can be wriiten as:
Input A | Input B | Output A XOR B |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
According to this it can be inferred as if there are odd numbers of 1 in the inputs the output is 1.
So in case of given example, If input A, B, C and D has values in which 1 occurs odd times then output will be 1.
That is why for inputs 0001, 0010, 0100, 0111, 1000, 1011, 1101, 1110 the output will be 1.
If this is to be wriiten using compliments as shown in the problem statement,
A B C D --> F
a' b' c' d' --> 0
a' b' c' d --> 1
a' b' c d' --> 1
a' b' c d --> 0
a' b c' d' --> 1
a' b c' d --> 0
a' b c d' --> 0
a' b c d --> 1
a b' c' d' --> 1
a b' c' d --> 0
a b' c d' --> 0
a b' c d --> 1
a b c' d' --> 0
a b c' d --> 1
a b c d' --> 1
a b c d --> 0
This is done by assigning
Value of input | Assignment |
A=0 | a' |
A=1 | a |
B=0 | b' |
B=1 | b |
C=0 | c' |
C=1 | c |
D=0 | d' |
D=1 | d |
Some examples and step wise solution
If input is:
1) 0 XOR 1 XOR 0 XOR 0
= 1 XOR 0 XOR 0 ( as 0 XOR 1 =1 )
= 1 XOR 0 ( as 1 XOR 0 =1 )
= 1 ( as 1 XOR 0 = 1)
2) 1 XOR 1 XOR 1 XOR 1
= 0 XOR 1 XOR 1 ( as 1 XOR 1=0)
= 1 XOR 1 (as 0 XOR 1 = 1)
=0 (as 1 XOR 1=0)