You are on page 1of 88

Digital

Electronics &
Computer
Organization

Logic gates and Cicuits


Outlines:

Logic Gates De Morgan’s Laws

Circuit Designing
Boolean Laws
Techniques
Definition

Basic Operation of logic gates

Logic Gates :
Introduction Binary input and outputs

Application of logic gates in digital circuit


Logic Gates: The Building Blocks of Digital World
Logic gates are the fundamental elements of any digital system. They act as
tiny electronic switches that perform basic logical operations on binary data.

A logic gate is an electronic circuit that implements a Boolean function.

In simpler terms, it takes one or more binary inputs (0 or 1) and produces a


single binary output (0 or 1) based on a specific rule.

These rules are derived from Boolean algebra, a branch of mathematics that
deals with logical operations.
Basic Operation:

AND: Output is 1 only if ALL inputs are 1.

OR: Output is 1 if at least one input is 1.

NOT (INVERTER): Inverts the input. If the input is 1, the


output is 0, and vice versa.
• Logic gates operate in the binary world,
where information is represented using only
two digits: 0 and 1.
Binary Input • These digits can represent various things like
ON/OFF, TRUE/FALSE, or HIGH/LOW voltage
and Outputs: levels in circuits.
• The input and output of a logic gate are also
binary, ensuring compatibility within digital
systems.
Applications in
Digital Circuits:
• Memory units: Store and retrieve information.
• Arithmetic logic units (ALUs): Perform
mathematical operations like addition and
subtraction.
• Processors: The central processing unit (CPU) of a
computer is built using millions of logic gates.
AND
OR Gate
Gate

NOT NAND
Gate Gate
Types of Gates: NOR XOR
Gate Gate

XNOR
gate
Function

Truth Table

Symbol and Logic Operation


AND Gate: IC 7408
Diagram

Application
The AND gate performs a
logical conjunction operation.
It outputs a 1 (HIGH) only
Function: when ALL of its inputs are 1
(HIGH).
If any input is 0 (LOW), the
output becomes 0 (LOW)
Symbol and Logical Operation:

Dot (.): A.B


Ampersand
(read as A dot
(&): A & B
B)
Truth Table:
Application:
• Implementing conjunctions in logical expressions: It can be used to combine multiple
conditions, where the output is true only if all conditions are true. For example, in a
security system, an alarm might activate only if both a door sensor (A) and a motion
sensor (B) detect an intrusion (A AND B).
• Data selection: AND gates can be used to select specific data based on multiple criteria.
For instance, in a computer program, you might only want to process data that falls
within a certain range (A) and comes from a specific source (B) (A AND B).
• Creating complex logic circuits: By combining AND gates with other logic gates like OR
and NOT, we can build more intricate digital circuits to perform various functionalities in
computers, communication systems, and other digital devices.
IC 7408
OR Gate : IC 7432

• Function
• Symbol and logic Operation
• Truth Table
• Applications
Function

• The OR gate is another essential logic gate, playing a


distinct role in digital circuits.
• The OR gate performs a logical disjunction operation.
• It outputs a 1 (HIGH) if at least one of its inputs is 1
(HIGH).
• If both inputs are 0 (LOW), the output becomes 0
(LOW).
Symbol and Logic
Operation:
Plus sign (+): A + B (read as A
plus B)

Pipe symbol (|): A | B


Representation
Applications

• Implementing disjunctions in logical expressions: It can be used to combine


multiple conditions, where the output is true if at least one condition is true. For
example, in a light controller circuit, a light might turn on if a switch (A) is
pressed or a motion sensor (B) detects movement (A OR B).
• Detecting any input: OR gates can be used to detect if any input is active. For
instance, in a fire alarm system, an alarm might sound if a smoke detector (A) or a
heat detector (B) senses danger (A OR B).
• Simplifying logic circuits: By using OR gates, we can sometimes simplify complex
logic circuits. For example, the output of multiple AND gates connected in series
can be combined using an OR gate to achieve the desired functionality.
IC 7432
NOT Gate
(Inverter): IC 7404
• Function
• Symbol and logic
Operation
• Truth Table
• Applications
Function

• The NOT gate, also known as an


inverter, is a fundamental logic gate that
performs a crucial operation in digital
circuits.
• The NOT gate performs a logical
negation operation.
• It simply inverts its single input. If the
input is 1 (HIGH), the output becomes 0
(LOW), and vice versa.
Symbol and Logic
Operation:

¬A (read as "not A")


Representation
IC 7404
Applications

• Negation in logical expressions: It can be used to negate (reverse the truth value)
of a single condition. For example, in a security system, an "armed" signal (A) might
be used to trigger an alarm when negated (¬A), indicating the system is disarmed.
• Signal conditioning: NOT gates can be used to invert signals for various purposes.
For example, in a communication system, a data signal might be transmitted in its
inverted form using a NOT gate, and then inverted back at the receiver for proper
interpretation.
• Creating other logic gates: By combining NOT gates with other logic gates like AND
and OR, we can create more complex logic gates like NAND and NOR, which are
essential building blocks for digital circuits.
NAND Gate
The NAND gate stands out as a unique and powerful logic
gate, earning its title as the universal gate.

The NAND gate performs a logical NAND (NOT AND) operation.


It outputs 1 (HIGH) only if both of its inputs are 0 (LOW).

If at least one input is 1 (HIGH), the output becomes 0 (LOW).


Representation:
Deriving Other Gates using NAND:
• AND gate: Connect two NAND gates in series, and then connect the
output of the second gate to an inverter (another NAND gate with a
single input).
• OR gate: Connect multiple NAND gates in series, and then connect
the output to an inverter.
• NOT gate (inverter): Simply connect a single input to a NAND gate
and disregard one of the inputs (tie it to a constant HIGH or LOW).
XOR Gate : IC7486

The XOR (Exclusive OR) gate is a digital logic gate that


performs a comparison between its inputs.

Outputs 1 (HIGH) only if exactly one input is 1 (HIGH).

Outputs 0 (LOW) if both inputs are 0 (LOW) or both are


1 (HIGH).
Symbol and Logic Operation:

No specific symbol
Represented by a
for XOR operation,
triangular shape with
but commonly
two inputs and one
denoted by A ⊕ B
output.
(read as A XOR B).
Truth Table
Odd Number Detector: A simple application is
detecting odd numbers. If you connect two binary
inputs to an XOR gate, the output will be 1 only if
there's an odd number of 1s at the inputs (e.g., 01
XOR 10 = 1).

Applications:
Data Encryption: XOR gates are fundamental in
encryption algorithms where data is scrambled by
XORing it with a secret key.

Error Detection: By XORing data with a specific


value before transmission and XORing it again with
the same value at the receiving end, errors can be
detected if the final XOR operation doesn't result in
the expected value.
XNOR Gate (Equivalent OR NOT): IC 74266

The XNOR gate, also known as the equivalence gate or EX-NOR


gate, performs a logical operation based on the similarity of its
inputs.
Outputs 1 (HIGH) only when both inputs are the same (either
both 0 (LOW) or both 1 (HIGH)).

Outputs 0 (LOW) if the inputs are different.


Truth Table:
Implementation
of XNOR Gate
using NAND
Gate
Simplification:
Y = ((A.(A.B)’)’ . B.(A.B)’)’
A.(A.B)’ + b.(A.B)’
A(A’ + B’) +B(A’ + B’)
(A + B)(A’ + B’)
Y=AB’ + A’B
Y= A ⊕ B = A⨀B
Implementation
of XNOR Gate
Using NOR Gate
Applications:
Comparators: They are used to compare binary values.

Binary Arithmetic: XNOR gates are used to detect equal values in binary addition and subtraction.

Parity Checking: XNOR gates are utilized to ensure even or odd parity in data.

Multiplexers (MUX): They assist in selecting input channels.

Latch and Flip-Flop Control: XNOR gates enable or disable storage elements.

Decoders: These gates activate specific outputs based on input codes.

Clock Synchronization: XNOR gates play a role in synchronizing clock signals.

Data Storage: They improve data storage efficiency when combined with SRAM cells.

Bistable Latching: XNOR gates help maintain stable output states.

Control Logic: They are pivotal in sequencing and decision-making.

Full Adders and ALUs: XNOR gates are integral in performing arithmetic operations in digital circuits.
De Morgan's Laws
Why ?
Simplifying Logic Circuits: They allow you to rewrite complex logic expressions using only AND, OR, and
NOT gates. This can sometimes lead to simpler and more efficient circuit designs with fewer gates.

Versatility with NAND Gates: Since NAND gates can be used to build all other logic gates (AND, OR, NOT),
De Morgan's Laws become even more crucial. By applying these laws, you can create any desired logic
function using only NAND gates, which can be beneficial in situations where limited gate types are available.

Understanding Relationships: They help us understand the relationships between the fundamental
operations of AND, OR, and NOT. By manipulating expressions using De Morgan's Laws, we can see how
these operations are interrelated and how they can be used to build more complex logic.
De Morgan's Laws:
Simplifying the World
of Logic
De Morgan's Laws state that the negation (NOT) of a
combined expression (either AND or OR) is equivalent to
the individual negations combined with the opposite
operation.
1. First Law: The NOT of an OR is equal to the AND of the
individual NOTs.
2. Second Law: The NOT of an AND is equal to the OR of
the individual NOTs.
Relationship Between AND, OR, and NOT:

Complementing Operations: They show how negating a combined expression (AND or OR) can be
achieved by negating each individual term and then combining them with the opposite operation.

Alternative Implementations: They allow us to express a logic function using different


combinations of gates. For example, you can achieve the same functionality with a combination of
NOT gates and OR gates as you could with an AND gate, given De Morgan's Laws.
Theorem 1 :
(A . B)’ = A’ + B’
Truth Table:
Theorem 2 :
(A + B)’ = A’ . B’
Truth Table:
DeMorgan’s
Equivalent Gates
Implementing Logic Circuits:

• Optimize Circuit Design: By applying De


Morgan's Laws, you might be able to create a
simpler circuit with fewer gates, leading to a
more efficient and compact design.
• Use Specific Gate Types: If a circuit design is
limited to using a particular type of gate (like
NAND gates), De Morgan's Laws can help you
build the desired logic using only those gates by
converting other operations (AND, OR) into
combinations of NAND gates.
Boolean Law:

• Introduction
• Common Boolean Laws
• Applications of Boolean Laws
Boolean Algebra: The Logic Behind the
Digital World
Boolean algebra, named after mathematician George Boole, forms the
foundation of digital logic.

It's a branch of mathematics that deals with variables that can only have two
values: 0 (false) and 1 (true).

These values can represent various things in digital circuits, like the state of a
switch (on/off), the presence of a voltage (high/low), or the truth value of a
statement (true/false).
Basic Operations:
1. AND (⋅ or &): Represents a conjunction
(both conditions must be true). Output is 1
only if both inputs are 1.
2. OR (+) : Represents a disjunction (at least
one condition must be true). Output is 1 if at
least one input is 1.
3. NOT (¬): Represents negation (inverts the
input). Output is 1 if the input is 0, and vice
versa.
Axioms (Postulates):
• A variable is either 0 or 1 (Law of excluded middle).
• A variable is not both 0 and 1 (Law of non-
contradiction).
• A variable and its negation are opposite (¬A ≠ A).
Laws of Boolean
algebra
• Commutative Law: A ⊕ B = B ⊕ A
• (works for AND, OR)
• Associative Law: (A ⊕ B) ⊕ C = A ⊕ (B ⊕ C)
• (works for AND, OR)
• Distributive Law: A ⊕ (B ⋅ C) = (A ⊕ B) ⋅ (A
⊕ C)
• (works for AND, OR)
• De Morgan's Laws: These relate negation to
AND/OR operations (discussed separately).
Commutative Law :
Associative Law
Distributive Law:
• the distributive law for OR form:
• A(B + C) = AB + AC
• the distributive law for AND form:
• P.(Q + R) = P.Q + P.R
Rules of Boolean algebra
Circuit Designing
Techniques

• Introduction
• Sum-of-Products (SOP)
• Product-of-Sums (POS)
• Karnaugh Map (K-Map)
• Choosing the Right Technique
Unveiling the Tools: Techniques for Circuit Design

A Boolean function is a mathematical expression that represents


the relationship between one or more input variables (A, B, C, etc.)
and a single output (F).

Our goal is to translate this function into a physical circuit using


logic gates (AND, OR, NOT) to achieve the desired logic operation.
Sum-of-Products
(SOP):
• This method expresses the output (F) as the OR (Σ) of all
possible product terms (AND gates) where the output is
1 (TRUE).
• Each product term represents a combination of input
values (A, B, C) for which the function is true.
A circuit for a truth table with N input columns
can use AND gates with N inputs, and each row
in the truth table with a ‘1’ in the output column
requires one N-input AND gate.

Construct Inputs to the AND gate are inverted if the input


shows a ‘0’ on the row, and not inverted if the

SOP from input shows a ‘1’ on the row.

a Truth
Table: All AND terms are connected to an M-input OR
gate, where M is the number of ‘1’ output rows.

The output of the OR gate is the function output.


Product-of-Sums
(POS):
• This method expresses the output (F) as the AND (Π) of
all possible sum terms (OR gates) where the output is 0
(FALSE).
• Each sum term represents a combination of input values
for which the function is false.
A circuit for a truth table with N input columns
can use OR gates with N inputs, and each row in
the truth table with a ‘0’ in the output column
requires one N-input OR gate.

Construct Inputs to the OR gate are inverted if the input


shows a ‘1’ on the row, and not inverted if the

POS from input shows a ‘0’ on the row.

a Truth
Table: All OR terms are connected to an M-input AND
gate, where M is the number of ‘1’ output rows.

The output of the AND gate is the function output.


Minterm:
• Definition: A minterm is a product term in a Sum-of-Products (SOP)
expression of a Boolean function. It represents a single combination
of input variables that results in a function output of 1 (TRUE).
• Structure: A minterm is formed by ANDing together literals
(variables or their negations). Each variable appears exactly once in
the product term, either in its original form (A) or negated form (A').
• Example: Consider a function with three variables (A, B, C). A
minterm could be AB'C, which represents the combination where A
and C are 1, and B is 0 (only when these specific conditions are met
will the function output be 1).
Maxterm:
• Definition: A maxterm is a sum term in a Product-of-Sums (POS)
expression of a Boolean function. It represents a single combination
of input variables that results in a function output of 0 (FALSE).
• Structure: A maxterm is formed by ORing together literals. Similar
to minterms, each variable appears exactly once in the sum term,
either in its original or negated form.
• Example: Using the same three variables, a maxterm could be (A + B
+ C'). This maxterm represents any combination where at least one
of the following conditions is true: A is 1, B is 1, or C is 0 (any of
these scenarios will result in the function output being 0).
Key Difference:

• Minterms: Focus on combinations that make the


function TRUE (product terms with AND).
• Maxterms: Focus on combinations that make the
function FALSE (sum terms with OR).
Karnaugh Maps: A Visual
Approach to Logic
Minimization
• Karnaugh Maps (K-Maps) are a powerful graphical
tool used in digital logic design to simplify Boolean
expressions and minimize the number of logic gates
required in a circuit.
• They offer a visual representation of truth tables,
making it easier to identify groups of minterms or
maxterms that can be combined using Boolean
laws.
2 variables
3 variables
4 Variables:
Redundant Group in K Map
Karnaugh Map:
Some Examples:
Using
Boolean
Using Nand
Gate Sol:

You might also like