0% found this document useful (0 votes)
16 views20 pages

Logicgates

Uploaded by

nkk0116716
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views20 pages

Logicgates

Uploaded by

nkk0116716
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Prepared By – Teran Subasinghe

Contents
Digital Logic Gates and Truth Tables .............................................................................................................................. 2
Basic Logic Gates................................................................................................................................................................ 2
Combinational Gates ........................................................................................................................................................ 3
Universal Gates ................................................................................................................................................................... 4
Simplification of Logic expressions.................................................................................................................................. 6
Laws of Boolean Algebra................................................................................................................................................. 6
Standard Logical Expressions ........................................................................................................................................ 7
Simplify Logic Expressions (Boolean Expression Simplification) ...................................................................... 8
Digital Circuits Design......................................................................................................................................................... 13
Design Circuits for the following expressions ....................................................................................................... 13
Design Circuits for the following expressions using only NAND gates ...................................................... 15
Design Circuits for the following expressions using only NOR gates .......................................................... 16
CPU and Memory with Logic Gates ............................................................................................................................... 17
Building blocks of CPU (Combinational Circuits) ................................................................................................. 17
Storing Bits in Digital Circuits (Memory – Sequential Circuits) ....................................................................... 18

Page 1 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

Digital Logic Gates and Truth Tables


BASIC LOGIC GATES
There are four basic logic gates OR, AND, NOT, XOR

OR Gate
Represents logical addition (+). The OR gate is an electronic circuit that gives a high output (1) if one
or more of its inputs are high. A plus (+) is used to show the OR operation.

A Q A B Q
0 0 0
B
0 1 1
1 0 1
Q=A+B
1 1 1

AND Gate
Represents logical multiplication. The AND gate is an electronic circuit that gives a high output (1)
only if all its inputs are high. A dot (.) is used to show the AND operation i.e. A.B. Bear in mind that
this dot is sometimes omitted i.e. AB

A A B Q
Q 0 0 0

B 0 1 0
1 0 0
1 1 1
Q = A.B

XOR Gate
Represents logical exclusive addition. The 'Exclusive-OR' gate is a circuit which will give a high output
if either, but not both, of its two inputs are high. An encircled plus sign ( ) is used to show the EOR
operation.

A A B Q
Q 0 0 0

B 0 1 1
1 0 1
1 1 0
Q=A B

Page 2 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

NOT Gate
The NOT gate is an electronic circuit that produces an inverted version of the input at its output. It is
also known as an inverter. If the input variable is A, the inverted output is known as NOT A. This is
also shown as A', or A with a bar over the top, as shown at the outputs. The NAND logic gate can be
configured to produce a NOT gate. It can also be done using NOR logic gates in the same way.

A Q
0 1
A Q 1 0

Q=A
̅

COMBINATIONAL GATES
These are formed by combining the basic logic gates except not gate, with not gate.

NAND Gate
This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate. The outputs of all
NAND gates are high if any of the inputs are low. The symbol is an AND gate with a small circle on
the output. The small circle represents inversion.

A A B Q
Q 0 0 1

B 0 1 1
1 0 1
1 1 0
Q = ̅̅̅̅̅
A. B

NOR Gate
This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The outputs of all NOR
gates are low if any of the inputs are high. The symbol is an OR gate with a small circle on the output.
The small circle represents inversion.

A A B Q
Q 0 0 1

B 0 1 0
1 0 0
1 1 0
Q = ̅̅̅̅̅̅̅
A+B

Page 3 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

XNOR Gate
The 'Exclusive-NOR' gate circuit does the opposite to the EOR gate. It will give a low output if either,
but not both, of its two inputs are high. The symbol is an EXOR gate with a small circle on the output.
The small circle represents inversion.

A A B Q
Q
0 0 1
B 0 1 0
1 0 0
1 1 1
Q = ̅̅̅̅̅̅
A B

UNIVERSAL GATES
The NAND gate and the NOR gate can be said to be universal gates since combinations of them can
be used to accomplish any of the basic operations and can thus produce an inverter, an OR gate or
an AND gate. In practice, this is advantageous since NAND and NOR gates are economical and easier
to fabricate and are the basic gates used in all IC digital logic families.

NOT using NAND

OR using NAND

Page 4 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

AND using NAND

NOT using NOR

OR using NOR

AND using NOR

Page 5 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

Simplification of Logic expressions


Two ways can be used to simplify a Boolean expression:
• Laws of Boolean Algebra
• Karnaugh Maps

LAWS OF BOOLEAN ALGEBRA


Following are the laws of Boolean algebra included in the syllabus:
Commutative

Associative

Distributive

Identity

Redundancy

De Morgan’s

*In addition to the above laws following axioms are used

*Laws from TIM: Idempotent Law, Inverse/Complement Law, Double Complement Law

Page 6 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

STANDARD LOGICAL EXPRESSIONS


There are mainly two types of standard logical expressions:

• SOP (Sum of Products)


Also known as the minterm canonic form or canonic sum function. A function in the form of
the " sum " (OR) of minterms.
• POS (Product of Sums)
Also known as the maxterm canonic form or canonic product function. A function in the form
of the " product " (AND) of maxterms.

Fill the following table with Minterms and Maxterms based on A, B and C.

A B C Minterm Maxterm

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

Page 7 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

Consider the following Truth table.

A B C F (Output)

0 0 0 1
0 0 1 0

0 1 0 1

0 1 1 1

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 1

SOP (Sum of Products)


The function has value 1 for the combinations shown, therefore:

F (A, B, C) =

POS (Product of Sums)


The function has value 0 for the combinations shown, therefore:

F (A, B, C) =

SIMPLIFY LOGIC EXPRESSIONS (BOOLEAN EXPRESSION SIMPLIFICATION)


Two ways can be used to simplify a Boolean expression:

• Laws of Boolean Algebra


• Karnaugh Maps

Page 8 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

Using Laws to Simplify the following expressions

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

Page 9 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

Page 10 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

Using Karnaugh Maps to Simplify


K-map has everything in a truth table.

Two inputs K-Map Three inputs K-Map

Four inputs K-Map


Grouping Rules
1. No diagonals.
2. Only power of 2 number of cells in each group.
3. Groups should be as large as possible.
4. Every “1” must be in at least one group.
5. Overlapping allowed.
6. Wrap around allowed.
7. Fewest number of groups possible.

Simplify the following expressions using Karnaugh Maps:

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

Page 11 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

Page 12 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

Digital Circuits Design

DESIGN CIRCUITS FOR THE FOLLOWING EXPRESSIONS

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

Page 13 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

Page 14 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

DESIGN CIRCUITS FOR THE FOLLOWING EXPRESSIONS USING ONLY NAND GATES

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

Page 15 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

DESIGN CIRCUITS FOR THE FOLLOWING EXPRESSIONS USING ONLY NOR GATES

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

Page 16 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

CPU and Memory with Logic Gates


CPU uses combinational logic gates while memory uses sequential logic gates.

BUILDING BLOCKS OF CPU (COMBINATIONAL CIRCUITS)


CPU consist of Half Adder and Full Adder Circuits to perform calculations.

Half Adder
With the help of half adder, we can design circuits that are capable of performing simple addition with
the help of logic gates.

A B S C
0 0
0 1
1 0
1 1

Full Adder
The main difference between a half-adder and a full-adder is that the full-adder has three inputs and
two outputs. The first two inputs are A and B and the third input is an input carry designated as Carry
In. When a full adder logic is designed we will be able to string eight of them together to create an 8-
bit adder and cascade the carry bit from one adder to the next. However there are two versions which
performs the same function.

A B C in S C out
0 0
0 1
1 0
1 1

Page 17 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

A B C in S C out
0 0
0 1
1 0
1 1

STORING BITS IN DIGITAL CIRCUITS (MEMORY – SEQUENTIAL CIRCUITS)


Combinational circuits: Output depends only on the input of that time.
Sequential Circuit: Output depends not only on the present inputs but also on the previous inputs
and outputs. This type of circuit is required to perform sequence of actions without getting any further
inputs. Use for memory storage (SRAM)

SR Flipflop using NAND gates

𝐒̅ ̅
𝐑 𝐐 ̅
𝐐
1 0
0 0
0 1
0 0
1 1

Page 18 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

RS Flipflop using NOR gates

𝐒 𝐑 𝐐 ̅
𝐐
1 0
0 0
0 1
0 0
1 1

But How Memory is Formed with This?

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

Page 19 of 20 www.itguru.lk
Prepared By – Teran Subasinghe

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

__________________________________________________________________________________________________________

Page 20 of 20 www.itguru.lk

You might also like