Boolean algebra
Boolean algebra
Boolean algebra is the branch of algebra in which the values of the variables are the truth
values true and false, usually denoted 1 and 0, respectively.
The table used to represent the boolean expression of a logic gate function is commonly
called a Truth Table. A logic gate truth table shows each possible input combination to the gate
or circuit with the resultant output depending upon the combination of these input(s).
What are Universal Gates? A universal gate is a logic gate which can implement any
Boolean function without the need to use any other type of logic gate. The NOR gate and
NAND gate are universal gates. This means that you can create any logical Boolean expression
using only NOR gates or only NAND gates.
Annulment Law – A term AND‘ed with a “0” equals 0 or OR‘ed with a “1” will
equal 1
The AND gate is so named because, if 0 is called "false" and 1 is called "true,"
the gate acts in the same way as the logical "and" operator. The following
illustration and table show the circuit symbol and logic combinations for an
AND gate. (In the symbol, the input terminals are at left and the output
terminal is at right.) The output is "true" when both inputs are "true."
Otherwise, the output is "false." In other words, the output is 1 only when both
inputs one AND two are 1.
AND gate
1 1 1
The OR gate gets its name from the fact that it behaves after the fashion of
the logical inclusive "or." The output is "true" if either or both of the inputs are
"true." If both inputs are "false," then the output is "false." In other words, for
the output to be 1, at least input one OR two must be 1.
OR gate
1 1
1 1
1 1 1
The XOR ( exclusive-OR ) gate acts in the same way as the logical "either/or."
The output is "true" if either, but not both, of the inputs are "true." The output is
"false" if both inputs are "false" or if both inputs are "true." Another way of
looking at this circuit is to observe that the output is 1 if the inputs are
different, but 0 if the inputs are the same.
XOR gate
1 1
1 1
Input Output
The NAND gate operates as an AND gate followed by a NOT gate. It acts in
the manner of the logical operation "and" followed by negation. The output is
"false" if both inputs are "true." Otherwise, the output is "true."
NAND gate
1 1
1 1
1 1
NOR gate
1 1
The XNOR (exclusive-NOR) gate is a combination XOR gate followed by an
inverter. Its output is "true" if the inputs are the same, and "false" if the inputs
are different.
XNOR gate
1 1 1
High or low binary conditions are represented by different voltage levels. The
logic state of a terminal can, and generally does, often change as the circuit
processes data. In most logic gates, the low state is approximately
zero volts (0 V), while the high state is approximately five volts positive (+5 V).
Logic gates can be made of resistors and transistors or diodes. A resistor can
commonly be used as a pull-up or pull-down resistor. Pull-up and pull-down
resistors are used when there are any unused logic gate inputs to connect to
a logic level 1 or 0. This prevents any false switching of the gate. Pull-up
resistors are connected to Vcc (+5V), and pull-down resistors are connected
to ground (0 V).
Commonly used logic gates are TTL and CMOS. TTL, or Transistor-Transistor
Logic, ICs will use NPN and PNP type Bipolar Junction Transistors. CMOS, or
Complementary Metal-Oxide-Silicon, ICs are constructed from MOSFET or
JFET type Field Effect Transistors. TTL IC's may commonly be labeled as the
7400 series of chips, while CMOS ICs may often be marked as a 4000 series
of chips.
Boolean Algebra and the Laws of Boolean Algebra can be used to identify
unnecessary logic gates within a digital logic design reducing the number of
gates required saving on power consumption and cost.
We have seen throughout this section that digital logic functions can be
defined and displayed as either a Boolean Algebra expression or as a logic
gate truth table. So here are a few examples of how we can use Boolean
Algebra to simplify larger digital logic circuits.
First observations tell us that the circuit consists of a 2-input NAND gate, a 2-
input EX-OR gate and finally a 2-input EX-NOR gate at the output. As there
are only 2 inputs to the circuit labelled A and B, there can only be 4 possible
combinations of the input ( 22 ) and these are: 0-0, 0-1, 1-0 and finally 1-1.
Plotting the logical functions from each gate in tabular form will give us the
following truth table for the whole of the logic circuit below.
Inputs Output at
A B C D Q
0 0 1 0 0
0 1 1 1 1
1 0 1 1 1
1 1 0 0 1
From the truth table above, column C represents the output function
generated by the NAND gate, while column D represents the output function
from the Ex-OR gate. Both of these two output expressions then become the
input condition for the Ex-NOR gate at the output.
It can be seen from the truth table that an output at Q is present when any of
the two inputs A or B are at logic 1. The only truth table that satisfies this
condition is that of an OR Gate. Therefore, the whole of the above circuit can
be replaced by just one single 2-input OR Gate.
The system consists of an AND Gate, a NOR Gate and finally an OR Gate.
The expression for the AND gate is A.B, and the expression for the NOR gate
is A+B. Both these expressions are also separate inputs to the OR gate which
is defined as A+B. Thus the final output expression is given as:
The output of the system is given as Q = (A.B) + (A+B), but the notation A+B is
the same as the De Morgan´s notation A.B, Then substituting A.B into the
output expression gives us a final output notation of Q = (A.B)+(A.B), which is
the Boolean notation for an Exclusive-NOR Gate as seen in the previous
section.
B A A.B A+B Q
0 0 0 1 1
0 1 0 0 0
1 0 0 0 0
1 1 1 0 1
Then, the whole circuit above can be replaced by just one single Exclusive-
NOR Gate and indeed an Exclusive-NOR Gate is made up of these individual
gate functions.
Boolean Algebra Example No3
Find the Boolean algebra expression for the following system.
This system may look more complicated than the other two to analyse but
again, the logic circuit just consists of simple AND, OR and NOT gates
connected together.
As with the previous Boolean examples, we can simplify the circuit by writing
down the Boolean notation for each logic gate function in turn in order to give
us a final expression for the output at Q.
The output from the 3-input AND gate is only at logic “1” when ALL the gates
inputs are HIGH at logic level “1” (A.B.C). The output from the lower OR gate
is only a “1” when one or both inputs B or C are at logic level “0”. The output
from the 2-input AND gate is a “1” when input A is a “1” and inputs B or C are
at “0”. Then the output at Q is only a “1” when inputs A.B.C equal “1” or A is
equal to “1” and both inputs B or C equal “0”, A.(B+C).
By using “de Morgan’s theorem” inputs B and input C cancel out as to
produce an output at Q they can be either at logic “1” or at logic “0”. Then this
just leaves input A as the only input needed to give an output at Q as shown
in the table below.
Inputs Intermediates Output
0 0 0 0 1 1 1 0 0
0 0 1 0 1 1 1 1 1
0 1 0 0 0 1 1 0 0
0 1 1 0 0 1 1 1 1
1 0 0 0 1 0 1 0 0
1 0 1 0 1 0 1 1 1
1 1 0 0 0 0 0 0 0
1 1 1 1 0 0 0 0 1
Then we can see that the entire logic circuit above can be replaced by just
one single input labelled “A” thereby reducing a circuit of six individual logic
gates to just one single piece of wire, (or Buffer). This type of circuit analysis
using Boolean Algebra can be very powerful and quickly identify any
unnecessary logic gates within a digital logic design thereby reducing the
number of gates required, the power consumption of the circuit and of course the
cost.
A B Q
0 0 0
0 1 0
1 0 0
1 1 1
Boolean Expression Q = A.B Read as A AND B gives Q
Note that the Boolean Expression for a two input AND gate can be written as: A.B or
just simply AB without the decimal point.
A B Q
0 0 0
0 1 1
1 0 1
1 1 1
A Q
0 1
1 0
The NAND and the NOR Gates are a combination of the AND and OR Gates
respectively with that of a NOT Gate (inverter).
A B Q
0 0 1
0 1 1
1 0 1
1 1 0
A B Q
0 0 1
0 1 0
1 0 0
1 1 0
As well as the standard logic gates there are also two special types of logic gate
function called an Exclusive-OR Gate and an Exclusive-NOR Gate. The Boolean
The switching actions of both of these types of gates can be created using the above
standard logic gates. However, as they are widely used functions they are now
available in standard IC form and have been included here as reference.
A B Q
0 0 0
0 1 1
1 0 1
1 1 0
Boolean Expression Q = A ⊕ B
A B Q
0 0 1
0 1 0
1 0 0
1 1 1
Boolean Expression Q = A ⊕ B
0 0 0 1 0 1 0 1
0 1 0 1 1 0 1 0
1 0 0 1 1 0 1 0
1 1 1 0 1 0 0 1
The following table gives a list of the common logic functions and their equivalent
Boolean notation.
Logic Function Boolean Notation
AND A.B
OR A+B
NOT A
NAND A .B
NOR A+B
2-input logic gate truth tables are given here as examples of the operation of each
logic function, but there are many more logic gates with 3, 4 even 8 individual inputs.
The multiple input gates are no different to the simple 2-input gates above, So a 4-
input AND gate would still require ALL 4-inputs to be present to produce the required
output at Q and its larger truth table would reflect that.