In the previous unit we looked at AND,OR and NOT logic. Today let's take a look at XOR logic.
Logic gates are used to process 1 and 0.
Click on each one to view its name.
Which one is the odd one out?
A Woodcutting Company uses a digital sensor system to determine if a woodcutter is busy.
Note: Woodcutters are experts at using saws and axes.
A woodcutter is busy if:
Note: if he is holding both an axe and a saw, he is not busy because it is impossible to use both at the same time.
In this activity, you will design a smart woodcutter system using logic gates in , simulating how computers process sensor information.
We will design a logic circuit which has 2 inputs:
Each input will be either 1 meaning true or 0 meaning false.
In CircuitVerse, place 2 inputs and annotate them as follows
A woodcutter is busy if:
In this case, he is busy if only one of the inputs is true, not both.
This is XOR logic.
To simulate a woodcutter being busy or not, we will use a lamp: when the lamp is ON, it means the woodcutter is busy.
Does it work?
Test your design for each of the 4 input combinations.
Use the output to complete this table and check that it is correct.
| has axe | has saw | Busy |
|---|---|---|
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
This is XOR logic and can be descibed as follows:
The output is 1 if either, but not both, of the inputs is 1.
The system designers have decided that a woodcutter can never be busy if he is hungry. He needs to prioritise lunch.
So, a woodcutter is busy if:
A woodcutter is busy if:
AND
he is not hungry
Let's introduce a new input to our system, hungry.
This is 1 when the woodcutter is hungry and 0 when he is not hungry.
Develop your circuit in CircuitVerse according to the above logic.
The circuit has 3 inputs.
And so there are 23 possible combinations.
In the worksheet, complete the Truth Table where indicated and predict what the output should be for each input combination.
Then, test your circuit by using the Truth Table. Does it work as expected?
Can you remember the logic of an AND gate and an OR gate?
NAND is basically NOT AND
NOR is simply NOT OR
As so, if we can recall the truth tables for AND and OR, we should be able to derive the truth tables for NAND and NOR!
| A | B | Output |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
| A | B | Output |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
images courtesy of circuitverse