P3 - 19 - Boolean Algebra and Logic Circuits

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Chapter 19

Boolean Algebra and Logic Circuits

Laws of Boolean Algebra:


https://www.youtube.com/watch?v=EPJf4owqwdA

Simplifying Boolean Algebra:


https://www.youtube.com/watch?v=XMCW6NFLMsg

DeMorgan’s Theorem
https://www.youtube.com/watch?v=ZyCzgqijpmM
Boolean algebra and logic circuits
Learning objectives:

• Show understanding of Boolean algebra.


• Show understanding of Karnaugh Maps.
• Produce truth tables for logic circuits including half adders and full
adders.
• Show understanding of a flip-flop (SR, JK).

Boolean algebra and logic circuits:


https://student.craigndave.org/videos/slr-15-boolean-algebra
2
Boolean Algebra & Logic Circuits

Laws of Boolean Algebra, Simplifying expressions


& De Morgan’s Theorem.
LOGIC GATE
QUIZ

You want this set of logic gates with inputs A, B, and C to output Z = 1 only if there's an odd
number of inputs that equal 1.

What kind of gate should go at the question mark?


Suppose the top XOR gate outputs a 0. Then A and B are either both 0 or both 1; either
way, an even number of 1s.

So overall we have an odd number of 1s as long as C = 1. This means we want an


input of (0, 1) to be TRUE and an input of (0, 0) to be FALSE, which happens with either
an XOR gate or an OR gate.

Suppose the top XOR gate outputs a 1. Then either A or B is 1. So we have


an odd number of 1s as long as C = 0. This means we want an input of (1, 0) to be
TRUE and an input of (1, 1) to be FALSE, which happens with an XOR gate but not with
LOGIC GATE an OR gate.
ANSWER So the gate must be XOR.
We have seen logic gates and combination of gates. There is a way to represent
logic gate through Boolean algebra. Here is a refresher:

"Variable", "Complement" and "Literal" are terms used in Boolean Algebra.

A variable is a symbol used to represent a logical quantity. Any single variable can
have a

"1" or a "0" value

BOOLEAN OPERATIONS The complement is the inverse of a variable and is indicated by a bar over the
variable. The complement of a variable is not considered as a different variable
AND EXPRESSIONS
Every occurrence of a variable or its complement is called a Literal. It could be its
true form or its complement, both of them are called Literals.

A SUM TERM is the SUM of literals (A+B+C+D)

A sum term is equal to 1 if one or all of its inputs are 1, and is equal to 0 only
if all of its inputs are zero

A PRODUCT TERM is the PRODUCT of literals (A.B.C.D(

A product term is equal to 1 if one or all of its inputs are 1, and is equal to 0
if any one (or all) of its inputs are zero
Describing Logic Circuits Algebraically:
Any logic circuit, no matter how complex, can be described with Boolean
operations because the OR gate, AND gate and NOT gate are the basic building
blocks of digital circuits

Boolean algebra provides a concise way to express the operation of a logic circuit
formed by a combination of logic gates so that the output can be determined for
various combination of input values.

BOOLEAN OPERATIONS To derive the Boolean expression for a given logic circuit you have to begin at the
left most inputs and work towards the final output, writing the expression for each
AND EXPRESSIONS gate.

Laws and Rules of Boolean Algebra:


Equivalent and Complement of Boolean Expressions

Two given Boolean expressions are said to be equivalent if one of them equals
"1" only when the other also equals "1" and same case with "0"

They are said to be complement of each other if one expression equals "1" only
when the other equals "0" and vice versa.
Postulates of Boolean Algebra
The following are the important postulates of Boolean algebra

1. 1.1 = 1 & 0+0 = 0

2. 1.0 = 0.1 = 0 & 0+1 = 1+0

3. 0.0 = 0 & 1+1 = 1

BOOLEAN OPERATIONS 4. 1=0 & 0=1

AND EXPRESSIONS

Theorem of Boolean Algebra


Boolean theorems can be useful in simplifying a logic expression like reducing
the number of terms in the expression.

It is useful in the sense that the number of gates are reduced which in turn also
reduces heat dissipation from the circuit (energy saving)

When this is done, the reduced expression will produce a circuit that is less
complex than the one which the original expression would have produced
Commutative Laws
Rule 1:

For Addition
X+Y=Y+X

For Multiplication
X.Y = Y.X

BOOLEAN OPERATIONS Associative Laws


AND EXPRESSIONS LAWS Rule 2:

For Addition
X + (Y + Z) = Y + (Z + X) = Z + (X + Y)

For Multiplication
X.(Y.Z) = Y.(Z.X) = Z.(X.Y)

Distributive Laws
Rule 3:

X. (Y + Z) = X.Y + X.Z

X.(Y.Z) = Y.(Z.X) = Z.(X.Y)


Operations with '0' and '1'
Rule 4:

OR LAWS
These laws use the OR operation. Therefore they are called as OR Laws

0+X=X (i) A + 0 = A (iii) A + A = A


1+X=1 (ii) A + 1 = 1 (iv) A + Ã = 1

AND LAWS
BOOLEAN OPERATIONS These laws use the AND operation. Therefore they are called as AND laws

AND EXPRESSIONS LAWS 0.X = 0 (i) A.0 = 0 (iii) A.1 = A


1.X = X (ii) A.A = A (iv) A.Ã = 0

Idempotent or Identity Laws


Rule 5:

X.X.X.X...............X = X

Rule 6:

X+X+X+X...............+X = X
Complementation Law:
Rule 7:
_
X.X = 0

Rule 8:
_
X+X = 1

BOOLEAN OPERATIONS
AND EXPRESSIONS LAWS Involution Law / Inversion Law:
Rule 9:
This law uses the NOT operation. The inversion law states that double inversion of
a variable result in the original variable itself.
_
_
X=X

De Morgans Theorem:

NOT(A + B) = NOT A * NOT B = A’ * B’

NOT(A * B) = NOT A + NOT B = A’ + B’


Absorption Law or Redundancy Law:
Rule 10:

X+X.Y = X

Rule 11:
BOOLEAN OPERATIONS _
AND EXPRESSIONS LAWS X+X.Y = X+Y

Rule 12:

(X+Y).(X+Z) = X+Z.Y
BOOLEAN OPERATIONS
AND EXPRESSIONS
Karnaugh Map (K-Map)

Visual Truth Table and Simplification


K-maps
A Karnaugh map is a method of creating a Boolean algebra expression from a
truth table.

KARNAUGH MAP It can make the process much easier than if you use sum-of-products to
create minterms.

The truth table for an OR gate is as follows:


The Karnaugh map rules:
Using the sum-of-products approach gives the
1. Only cells containing a 1 are considered. following expression for X:
2. Groups of cells containing 1s are identified _ _
where possible, with a group being a row, a X = A.B + A.B + A.B
column or a rectangle.
This is not recognisable as A + B but using Boolean
3. Groups must contain 2, 4, 8 cells and so
algebra laws it can be shown to be the same.
on.
4. Each group should be as large as possible.
5. Groups can overlap
6. If an individual cell cannot be contained in The Karnaugh map approach is simpler. Each cell in the Karnaugh map below
any group it is treated as being a group shows the value of the output X for a combination of input values for A and B.
7. Within each group, the only input values
Column
retained are those which retain a constant B remains unchanged but A changes so B is retained.
value throughout the group.
Row
A remains unchanged

Thereby, the Boolean algebra expression is:

https://www.youtube.com/watch?v=RO5alU6PpSU X=A+B
LOGIC CIRCUITS
Circuits that are used to construct components that
provide functionality in computer hardware.

These are combinational circuits.


- output is dependent only on the input values.
LOGIC CIRCUITS
Circuits that are used to construct components that
provide functionality in computer hardware.

These are combinational circuits.


- output is dependent only on the input values.
K-Map Introduction:
https://www.youtube.com/watch?v=3vkMgTmieZI&t=27s

K-Map Simplify Expressions:


https://www.youtube.com/watch?v=UfZKvPQku8w
KARNAUGH MAPS (K-MAP)
K-Map Four Variables:
https://www.youtube.com/watch?v=YJSqf_Z024w&t=2s
Half / Full Adder

Logic Circuits of Half Adder, 2 Half adder to form a


Full Adder. Many Full Adders to form multiple bits
adders.
Half Adder
Result of adding two bits is either 1 or 0. However, when 1 is added to 1 the result is 0 but
there is a carry bit equal to 1. This cannot be ignored if two numbers with several bits in each
are being added.
Sum bit

LOGIC CIRCUITS
Input Output Carry bit
Circuits that are used to construct components that A B S C
provide functionality in computer hardware.
0 0 0 0
Half Adder
These are combinational circuits. 0 1 1 0 Truth Table
- output is dependent only on the input values. S=A⊕B
1 0 1 0
C = A.B
Logic Gates: Half, Full & Ripple adder: 1 1 0 1
https://youtu.be/TXZBqtfAOpY

XOR AND
gate gate
Full Adder
If a half adder is used each time, there has to be separate circuitry to handle the carry bit
because the half adder only takes two inputs.

The full adder is a circuit that has three inputs including the previous carry bit.
One possible circuit for implementation contains two half adder circuits and an OR gate is
shown below:
Sum bit

LOGIC CIRCUITS Carry out

Circuits that are used to construct components that


provide functionality in computer hardware.
Carry in
These are combinational circuits. Input Output
- output is dependent only on the input values. A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
Full Adder 0 1 0 1 0
Truth Table
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
LOGIC CIRCUITS
Circuits that are used to construct components that
provide functionality in computer hardware.

These are combinational circuits.


- output is dependent only on the input values.
SR Latch, Flip-Flop and JK Flip Flop

Logic Circuits of Latch and Flip Flop.


Problems with SR latch / Flip-flop and how JK Flip
Flop addresses those issues.
SR Latch / Flip-Flop
It can be constructed with two NAND gates or two NOR gates. Figure below shows the version with
two NOR gates. The flip-flop is a two- state device. Either it has Q set to 1 and Q' set to 0 or it has the
LOGIC CIRCUITS reverse.

Circuits that are used to construct components that Set Reset NOR Q Q’
provide functionality in computer hardware.
0 0 1 Q Q’
These are sequential circuits. 0 1 0 0 1
- output depends on the input and on the previous
output. 1 0 0 1 0
SR flip-flop can be used as a storage device for 1 bit and 1 1 0 0 0
therefore could be used as a component in RAM
because a value is stored but can be altered .

1. SR Latch: Input Initial Final


https://youtu.be/kt8d3CYWGH4 Signals State State
2. SR Flip-flop: S R Q Q' Q Q'
https://youtu.be/HZg7fNu-l24 The two lines of the truth table where 0 0 1 0 1 0
both S and R are input as 0 produce no 1 0 1 0 1 0
SR Flip-flop: Truth table, Excitation Table:
change in the values set for Q or Q'. This is 0 1 1 0 0 1
https://youtu.be/uiKKRPZbuXA] the condition when no signal is input to
the flip-flop. 0 0 0 1 0 1
1 0 0 1 1 0
Input of S = 1 and R = 0 always produces Q = 1 and Q' = 0.
0 1 0 1 0 1
Input of S = 0 and R = 1 always produces Q = 0, Q’ = 1. (the reverse)
JK Flip-Flop
Circuit can arrive in an uncertain state if inputs do not arrive quite at the same time. In order to
prevent this, a circuit may include a clock pulse input to give a better chance of synchronising inputs.
LOGIC CIRCUITS
Circuits that are used to construct components that
provide functionality in computer hardware.

These are sequential circuits.


- output depends on the input and on the previous
output.

3. JK Flip-flop:
https://youtu.be/j6krFp511HA The workings of the circuit are
viewed in terms of the value of the
4. Latch v Flip-flop: Q output immediately after the
https://youtu.be/m1QBxTeVaNs circuit detects a clock pulse. , J K Clock Q

5. CS SR SR Latch (NOR & NAND) : Overcome SR Flip flop issues:


0 0 1 Q unchanged

https://www.youtube.com/watch?v=-aQH0ybMd3U 1. Invalid state - 1 0 1 1

2. Uncertain state if inputs do not 0 1 1 0


CS SR Latch Flip-flop 2:
arrive at same time 1 1 1 Q toggles
https://www.youtube.com/watch?v=HxAhOETcvr4

The J input acts as a set input and the K as a clear so there is some similarity
to the functioning of the SR flip-flop.
However, if both J and K are input as a 1 then Q always switches value.
SR Latch (NOR and NAND gates)
Summary: Boolean Algebra and Logic Circuits.
• There are Boolean algebra laws that can be used to simplify logic
expressions.
• Binary addition can be carried out using a half adder or a full
adder circuit.
• SR or JK flip-flop circuits can be used to store a bit value.
• The sum of products method can be used to create an equivalent
logic expression containing minterms from a truth table.
• A Karnaugh map is a representation of a truth table that allows a
simplified logic expression to be derived from a truth table.

27

You might also like