0% found this document useful (0 votes)
4 views

Boolean algebra

Boolean algebra deals with truth values represented as 1 (true) and 0 (false) and is fundamental in digital logic design. It includes various laws and universal gates like NAND and NOR, which can implement any Boolean function. The document also explains basic logic gates, their truth tables, and provides examples of simplifying logic circuits using Boolean algebra.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Boolean algebra

Boolean algebra deals with truth values represented as 1 (true) and 0 (false) and is fundamental in digital logic design. It includes various laws and universal gates like NAND and NOR, which can implement any Boolean function. The document also explains basic logic gates, their truth tables, and provides examples of simplifying logic circuits using Boolean algebra.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

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.

Basic logic gates


There are seven basic logic gates: AND, OR, XOR, NOT, NAND, NOR, and
XNOR.

Description of the Laws of Boolean Algebra

 Annulment Law – A term AND‘ed with a “0” equals 0 or OR‘ed with a “1” will
equal 1

o A.0=0 A variable AND’ed with 0 is always equal to 0


o A + 1 = 1 A variable OR’ed with 1 is always equal to 1

 Identity Law – A term OR‘ed with a “0” or AND‘ed with a “1” will always equal
that term

o A + 0 = A A variable OR’ed with 0 is always equal to the variable


o A.1=A A variable AND’ed with 1 is always equal to the variable

 Idempotent Law – An input that is AND‘ed or OR´ed with itself is equal to that
input

o A+A=A A variable OR’ed with itself is always equal to the


variable
o A.A=A A variable AND’ed with itself is always equal to the
variable

 Complement Law – A term AND‘ed with its complement equals “0” and a
term OR´ed with its complement equals “1”

o A.A=0 A variable AND’ed with its complement is always equal


to 0
o A+A=1 A variable OR’ed with its complement is always equal to
1

 Commutative Law – The order of application of two separate terms is not
important

o A.B=B.A The order in which two variables are AND’ed makes


no difference
o A+B=B+A The order in which two variables are OR’ed makes
no difference

 Double Negation Law – A term that is inverted twice is equal to the original
term

o A =A A double complement of a variable is always equal to the


variable

 de Morgan’s Theorem – There are two “de Morgan’s” rules or theorems,

 (1) Two separate terms NOR‘ed together is the same as the two terms inverted
(Complement) and AND‘ed for example: A+B = A . B

 (2) Two separate terms NAND‘ed together is the same as the two terms inverted
(Complement) and OR‘ed for example: A.B = A + B

AND | OR | XOR | NOT | NAND | NOR | XNOR

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

Input 1 Input 2 Output

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

Input 1 Input 2 Output

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

Input 1 Input 2 Output


1 1

1 1

1 1

A logical inverter, sometimes called a NOT gate to differentiate it from other


types of electronic inverter devices, has only one input. It reverses the logic
state. If the input is 1, then the output is 0. If the input is 0, then the output is
1.

Inverter or NOT gate

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

Input 1 Input 2 Output

1 1

1 1

1 1

The NOR gate is a combination OR gate followed by an inverter. Its output is


"true" if both inputs are "false." Otherwise, the output is "false."

NOR gate

Input 1 Input 2 Output

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

Input 1 Input 2 Output

1 1 1

Complex operations can be performed using combinations of these logic


gates. In theory, there is no limit to the number of gates that can be arrayed
together in a single device. But in practice, there is a limit to the number of
gates that can be packed into a given physical space. Arrays of logic gates
are found in digital ICs. As IC technology advances, the required physical
volume for each individual logic gate decreases and digital devices of the
same or smaller size become capable of performing ever-more-complicated
operations at ever-increasing speeds.

Composition of logic gates

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 Examples


Boolean Algebra examples of how to reduce the number of digital gates using Boolean
Algebra Laws

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.

Boolean Algebra Example No1


Construct a Truth Table for the logical functions at points C, D and Q in the
following circuit and identify a single logic gate that can be used to replace the
whole circuit.

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.

Boolean Algebra Example No2


Find the Boolean algebra expression for the following system.

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.

Inputs Intermediates Output

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

C B A A.B.C B C B+C A.(B+C) Q

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.

Home / Boolean Algebra / Boolean Algebra Truth Tables

Boolean Algebra Truth Tables


Boolean Algebra Expressions can be used to construct digital logic truth tables for their
respective functions

As well as a standard Boolean Expression, the input and output information of


any Logic Gate or circuit can be plotted into a standard table to give a visual
representation of the switching function of the system.
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).
For example, consider a single 2-input logic circuit with input variables labelled
as A and B. There are “four” possible input combinations or 22 of “OFF” and “ON”
for the two inputs. However, when dealing with Boolean expressions and especially
logic gate truth tables, we do not general use “ON” or “OFF” but instead give them bit
values which represent a logic level “1” or a logic level “0” respectively.
Then the four possible combinations of A and B for a 2-input logic gate is given as:
 Input Combination 1. – “OFF” – “OFF” or ( 0, 0 )
 Input Combination 2. – “OFF” – “ON” or ( 0, 1 )
 Input Combination 3. – “ON” – “OFF” or ( 1, 0 )
 Input Combination 4. – “ON” – “ON” or ( 1, 1 )
Therefore, a 3-input logic circuit would have 8 possible input combinations or 23 and a
4-input logic circuit would have 16 or 24, and so on as the number of inputs increases.
Then a logic circuit with “n” number of inputs would have 2n possible input
combinations of both “OFF” and “ON”.
So in order to keep things simple to understand, in this tutorial we will only deal with
standard 2-input type logic gates, but the principals are still the same for gates with
more than two inputs.
Then the Truth tables for a 2-input AND Gate, a 2-input OR Gate and a single
input NOT Gate are given as:

2-input AND Gate


For a 2-input AND gate, the output Q is true if BOTH input A “AND” input B are
both true, giving the Boolean Expression of: ( Q = A and B ).

Symbol Truth Table

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.

2-input OR (Inclusive OR) Gate


For a 2-input OR gate, the output Q is true if EITHER input A “OR” input B is true,
giving the Boolean Expression of: ( Q = A or B ).

Symbol Truth Table

A B Q

0 0 0

0 1 1

1 0 1

1 1 1

Boolean Expression Q = A+B Read as A OR B gives Q

NOT Gate (Inverter)


For a single input NOT gate, the output Q is ONLY true when the input is “NOT”
true, the output is the inverse or complement of the input giving the Boolean
Expression of: ( Q = NOT A ).

Symbol Truth Table

A Q

0 1

1 0

Boolean Expression Q = NOT A or A Read as inversion of A gives Q

The NAND and the NOR Gates are a combination of the AND and OR Gates
respectively with that of a NOT Gate (inverter).

2-input NAND (Not AND) Gate


For a 2-input NAND gate, the output Q is NOT true if BOTH input A and input B are
true, giving the Boolean Expression of: ( Q = not(A AND B) ).

Symbol Truth Table

A B Q

0 0 1
0 1 1

1 0 1

1 1 0

Boolean Expression Q = A .B Read as A AND B gives NOT-Q

2-input NOR (Not OR) Gate


For a 2-input NOR gate, the output Q is true if BOTH input A and input B are NOT
true, giving the Boolean Expression of: ( Q = not(A OR B) ).

Symbol Truth Table

A B Q

0 0 1

0 1 0
1 0 0

1 1 0

Boolean Expression Q = A+B Read as A OR B gives NOT-Q

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

with a plus sign inside a circle, ( ⊕ ).


expression to indicate an Exclusive-OR or Exclusive-NOR function is to a symbol

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.

2-input EX-OR (Exclusive OR) Gate


For a 2-input Ex-OR gate, the output Q is true if EITHER input A or if input B is true,
but NOT both giving the Boolean Expression of: ( Q = (A and NOT B) or (NOT A
and B) ).

Symbol Truth Table

A B Q

0 0 0

0 1 1
1 0 1

1 1 0

Boolean Expression Q = A ⊕ B

2-input EX-NOR (Exclusive NOR) Gate


For a 2-input Ex-NOR gate, the output Q is true if BOTH input A and input B are the
same, either true or false, giving the Boolean Expression of: ( Q = (A and B) or (NOT
A and NOT B) ).

Symbol Truth Table

A B Q

0 0 1

0 1 0

1 0 0

1 1 1
Boolean Expression Q = A ⊕ B

Summary of 2-input Logic Gates


The following Truth Table compares the logical functions of the 2-input logic gates
above.

Inputs Truth Table Outputs For Each Gate

A B AND NAND OR NOR EX-OR EX-NOR

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

EX-OR (A.B) + (A.B) or A ⊕ B

EX-NOR (A.B) + (A.B) or 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.

You might also like