3B - Logic Gates, Truth Tables & Logic Circuits
3B - Logic Gates, Truth Tables & Logic Circuits
Logic gates
These manipulate the bits entered to the gate and output a bit depending on the type of the
gate used
We usually use a truth table to show the different combinations of bits which can be entered
to the logic gate and their corresponding outputs. A bit can be either 0 or 1
You will need to know some of these gates and how to draw them and draw their truth table:
NOT Gate
Truth Table
Input Output
1 0
0 1
AND Gate
In this both the inputs must be true for the output to be true.
Truth Table
A B Output
0 0 0
0 1 0
1 0 0
1 1 1
It is very important to note down that if we have 2 inputs this gives us 22 possibilties and so
we have 4 combinations.
Also it better if you memorise the pattern of the input values as it is very useful.
In this gate either one of the input values must be true for the output to be true.
Truth Table
A B Output
0 0 0
0 1 1
1 0 1
1 1 1
NAND Gate
It is the opposite of the AND gate. This is done by using a NOT gate after the AND gate.
The output is TRUE only when both Inputs are not TRUE which means only when inputs are
both true the output is false. If one input is true and the other one is not then the output is
still true
In simpler terms the output is true when neither A or B are both true
Truth Table
A B Output
0 0 1
0 1 1
1 0 1
1 1 0
If you do forget how to draw the table just draw the opposite of the AND truth table.
NOR Gate
The Output is only TRUE if the neither the input values are TRUE.
So if one of the input values are true the output values is false.
Truth Table
A B Output
0 0 1
0 1 0
1 0 0
1 1 0
XOR
The output is TRUE when the input values are different (not same).
Truth Table
A B Output
0 0 0
0 1 1
1 0 1
1 1 0
3 Inputs
Most questions usually have 3 inputs (A B C) and so this leads to 23 possibilities = 8
combinations
So now there are 8 rows and 3 inputs. So we also need to remember this pattern
Truth Table
A B C
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
We create the truth table based on the number of input values the ciruit begins with and
not with the intermediate values
The systems reorders if the inventory level is below 10 units or if the user
makes a large order
A logic proposition is the statement which can be either TRUE or FALSE. Ex - the user makes
a large order can be true or false.
This must be converted to a logic expression which then we replace the the logic proposition
with simple variables such as:
System reorder(output) - X
Large order - B
This is like a normal simple logic gate but usually most examples contains 3 inputs.
X = A OR B
There are somethings you need to remember. By default we name the variable of a logic
proposition with a variable A - this when the value of the variable is 1.However, if we want to
represent the variable which has a value of 0 (FALSE). We must use NOT A
Lets see an example - the system sends an alarm if the chemical process is not working - 0
or if the user has switched off the system - 1
X = NOT C OR S
The reason why we define it this way is that we expect the output X to be 1 and usually they
state this in logic expressions
This is an example
Usually the brackets will be given but sometimes they don't give brackets such as the below
example:
In this way we read from the left to the right when drawing the logic ciruits so this means we
draw NOT A AND NOT B first then we Add the AND C. Note that I didn't make an
intermediate variable for NOT A OR NOT B as they are very easy to do.
So when we draw the truth tables for these its best to get the intermediate values
D = (NOT A OR NOT B)
We name a new variable for the intermediate steps. Then the D AND C are compared
X = D AND C
Usually logic cirucits are not that easy and sometimes there could be many intermediate
variables. Also you need to remember as 3 inputs are used there should be 8 possibilites.
Truth Table
A B C E(NOT A) F(NOT B) D X
0 0 0 1 1 1 0
0 0 1 1 1 1 1
0 1 0 1 0 0 0
0 1 1 1 0 0 0
1 0 0 0 1 0 0
1 0 1 0 1 0 0
1 1 0 0 0 0 0
1 1 1 0 0 0 0
D - NOT A AND NOT B
E - NOT A.
F - NOT B
This shows that the output is only true when both A and B are FALSE and C is TRUE
Simplifying the circuits or
removing variety
In some questions they give a logic ciruit and ask us draw the logic circuits to draw only
using a single type of Gate - NAND or NOR
There are infinite possibilites of replacing a gate with another gate and so there is no proper
answer. Also if you do want to find the gates used to replace a particular gate, you can use
my method
Say for example the AND gate must be replaced using only NAND gates
In other word if I compared the output of NAND gate with another NAND gate(or more)it
must give me 0001
1 - 0
1 - 0
1 - 0
0 - 1
For you to identify this requires practice and a bit of trial and error
As we know that the next gate must be a NAND gate(or else this could lead to infinite
possibilities).
So the value of the first NAND gate is compared with another NAND gate.
Which is same as the first row. This means the output is split or duplicated as the diagram
below
They will ask to replace NOR With OR gate as this is because OR and AND and NOT gates
are fundamental gates which are used to create more complex gates
Below I gave some very common examples which you have to remember
Recommended
These are things you might like. Clicking these ads can help us improve our free services in
the future...