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

MOD 3 - Digital Logic Operations

Uploaded by

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

MOD 3 - Digital Logic Operations

Uploaded by

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

DIT 002 –

FUNDAMENTALS OF
INFORMATION
TECHNOLOGY
MOD 3 - Digital Logic
Operations
Learning Objectives
• Logic Gates
• Combinational Gates
• Boolean Algebra
• Logic Circuit Design
• Truth Tables

MOD 3 - Digital Logic Operations 2


What are Logic Gates?
• A logic gate is a device that performs a Boolean function, a logical
operation performed on one or more binary inputs that produces a single
binary output.
• A logic gate is a device that acts as a building block for digital circuits.
• They perform basic logical functions that are fundamental to digital
circuits.
• Logic gates are an important concept if you are studying electronics.
• These are important digital devices that are mainly based on the Boolean
function.

MOD 3 - Digital Logic Operations 3


Logic Gates

LOGIC GATES

Understand logic gates and digital logic circuits


Digital Computers

- Imply that the computer deals with digital information, i.e., it deals
with the information that is represented by binary digits
- Why BINARY ? instead of Decimal or other number system ?

* Consider electronic signal 1 7


6
5 signal
4
3 range
2
1
0 0
binary octal

0 1 2 3 4 5 6 7 8 9
* Consider the calculation cost - Add 0 0 1 2 3 4 5 6 7 8 9
1 1 2 3 4 5 6 7 8 9 10
0 1 2
3
2 3 4 5 6 7 8 9 1011
3 4 5 6 7 8 9 101112
0 0 1 4 4 5 6 7 8 9 10111213
5 5 6 7 8 9 1011121314
1 1 10 6 6 7 8 9 101112131415
7 7 8 9 10111213141516
8 8 9 1011121314151617
9 9 101112131415161718
Logic Gates
BASIC LOGIC BLOCK - GATE -

Binary Binary
Digital Gate Digital
. Output
Input .
. Signal
Signal

Types of Basic Logic Blocks

- Combinational Logic Block


Logic Blocks whose output logic value
depends only on the input logic values

- Sequential Logic Block


Logic Blocks whose output logic value
depends on the input values and the
state (stored information) of the blocks

Functions of Gates can be described by

- Truth Table
- Boolean Function
- Karnaugh Map
Combinational Gates
• Combinational Logic Circuits are memoryless digital logic circuits whose
output at any instant in time depends only on the combination of its inputs.
• Unlike Sequential Logic Circuits whose outputs are dependant on both their
present inputs and their previous output state giving them some form
of Memory.
• The outputs of Combinational Logic Circuits are only determined by the
logical function of their current input state, logic “0” or logic “1”, at any given
instant in time.
• The result is that combinational logic circuits have no feedback, and any
changes to the signals being applied to their inputs will immediately have an
effect at the output.
• In other words, in a Combinational Logic Circuit, the output is dependant at
all times on the combination of its inputs. Thus a combinational circuit
is memoryless. MOD 3 - Digital Logic Operations 6
• So if one of its inputs condition changes state, from 0-1 or 1-0, so too
will the resulting output as by default combinational logic circuits
have “no memory”, “timing” or “feedback loops” within their design.

MOD 3 - Digital Logic Operations 7


Logic Gates
COMBINATIONAL GATES
Name Symbol Function Truth Table
A B X
A X=A•B 0 0 0
AND X or 0
1
1
0
0
0
B X = AB 1 1 1
A B X
A 0 0 0
OR X X=A+B 0 1 1
1 0 1
B 1 1 1
A X
I A X X = A’
0
1
1
0
A X
0 0
Buffer A X X=A 1 1
A B X
A 0 0 1
NAND X X = (AB)’
0
1
1
0
1
1
B 1 1 0
A B X
A 0 0 1
NOR X X = (A + B)’ 0
1
1
0
0
0
B 1 1 0
A B X
A X=AB
XOR X or
0
0
0
1
0
1
Exclusive OR 1 0 1
B X = A’B + AB’
1 1 0
A B X
A X = (A  B)’
XNOR X or
0
0
0
1
1
0
Exclusive NOR
B X = A’B’+ AB 1 0 0
or Equivalence 1 1 1
Boolean Algebra
• Boolean algebra is a branch of mathematics that deals with operations on
logical values with binary variables.
• Boolean algebra is the category of algebra in which the variable's values
are the truth values, true and false, ordinarily denoted 1 and 0
respectively.
• Boolean variables are represented as binary numbers to represent truths:
1 = true and 0 = false.
• Elementary algebra deals with numerical operations, whereas Boolean
algebra deals with logical operations.

MOD 3 - Digital Logic Operations 9


Rule in Boolean Algebra
• Following are the important rules used in Boolean algebra.
•Variable used can have only two values. Binary 1 for HIGH
and Binary 0 for LOW.
•Complement of a variable is represented by an overbar (-).
•Thus, complement of variable B is represented as B overbar
•Thus if B = 0 then B overbar
= 1 and B = 1 then, B overbar
= 0.

MOD 3 - Digital Logic Operations 10


Boolean Algebra

BOOLEAN ALGEBRA

Boolean Algebra

* Algebra with Binary(Boolean) Variable and Logic Operations


* Boolean Algebra is useful in Analysis and Synthesis of
Digital Logic Circuits

- Input and Output signals can be


represented by Boolean Variables, and
- Function of the Digital Logic Circuits can be represented by
Logic Operations, i.e., Boolean Function(s)
- From a Boolean function, a logic diagram
can be constructed using AND, OR, and I

Truth Table

* The most elementary specification of the function of a Digital Logic


Circuit is the Truth Table

- Table that describes the Output Values for all the combinations
of the Input Values, called MINTERMS
- n input variables → 2n minterms
Logic Circuit Design
• In digital electronics, a logic gate is the most elementary component of
a digital circuit or a digital system.

• What is a Logic Gate?


• A logic gate is an electronic circuit that performs logical operations
based on the inputs provided to it and produces a logical output that
can be either "true" or "false".
• Logic gates are the primary building blocks of all digital circuits and
systems.
• The operation of logic gates is based on the Boolean mathematics.
MOD 3 - Digital Logic Operations 12
Types of Logic Gates
• Logic gates can be broadly classified into the following three
categories −
i. Basic Logic Gates − AND Gate, OR Gate, NOT Gate
ii. Universal Logic Gates − NAND Gate and NOR Gate
iii. Derived Logic Gates − XOR Gate and XNOR Gate
• All these gates are combined together to implement complex practical
digital systems to perform various computational and logical
operations.

MOD 3 - Digital Logic Operations 13


Boolean Algebra

LOGIC CIRCUIT DESIGN

x y z F
0 0 0 0
Truth 0 0 1 1
Table 0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
Boolean F = x + y’z
Function

x
F
Logic y
Diagram
z
BASIC IDENTITIES OF BOOLEAN ALGEBRA
[1] x + 0 = x [2] x • 0 = 0
[3] x + 1 = 1 [4] x • 1 = x
[5] x + x = x [6] x • x = x
[7] x + x’ = 1 [8] x • X’ = 0
[9] x + y = y + x [10] xy = yx
[11] x + (y + z) = (x + y) + z [12] x(yz) = (xy)z
[13] x(y + z) = xy +xz [14] x + yz = (x + y)(x + z)
[15] (x + y)’ = x’y’ [16] (xy)’ = x’ + y’
[17] (x’)’ = x
[15] and [16] : De Morgan’s Theorem
Usefulness of this Table
- Simplification of the Boolean function
- Derivation of equivalent Boolean functions
to obtain logic diagrams utilizing different logic gates
-- Ordinarily ANDs, ORs, and Inverters
-- But a certain different form of Boolean function may be convenient
to obtain circuits with NANDs or NORs
→ Applications of De Morgans Theorem

x’y’ = (x + y)’ x’+ y’= (xy)’


I, AND → NOR I, OR → NAND
• Objective

 Design combinational logic circuit


 Activate under specific conditions
 Test with LabVIEW
 Test using NI-ELVIS prototyping board
• Logic Functions

AND - “All or nothing operator”


 Output high (1) only when ALL inputs are
high (1)
OR gate - “Any or all operator”
 Output high (1) when at least ONE input is
high (1)
NOT operator – “Inverter”
 Output always opposite of input

• Logic Functions

Truth Table
Boolean Inputs Output
Logic Function Logic Symbol
Expression A B Y

0 0 0
0 1 0
AND A•B=Y
1 0 0
1 1 1
0 0 0
0 1 1
OR A+B=Y
1 0 1
1 1 1

A=Ā 0 - 1
NOT
• Sample Problem

 ATM machine has three options:


 Print statement
 Withdraw money
 Deposit money
 ATM machine will charge $1.00 to:
 Withdraw
 Print out statement with no transactions
 No charge for:
 Deposits without withdrawal
• Competition Rules

INPUTS OUTPUT A truth table displays all


possible input / output
P W D C combinations.
0 0 0 0
0 0 1 0
INPUT OUTPUT
0 1 0 1 P = Print C = Charge
0 1 1 1 W = Withdraw
1 0 0 1
D = Deposit
1 0 1 0
1 1 0 1 0 = “do not” 0 = $0.00
1 1 1 1 1 = “do” 1 = $1.00
Boolean Equations

Outputs with a value of


INPUTS OUTPUT “ONE” are kept
P W D C
0 0 0 0 C = PWD
0 0 1 0
0 1 0 1 + PWD
0 1 1 1
1 0 0 1 + PWD
1 0 1 0
1 1 0 1
+ PWD
1 1 1 1 + PWD
Karnaugh Maps (K-maps)

C = PWD+ PWD+ PWD + PWD + PWD

0 0 PWD
01 1 1 1 0
P W PW P W PW
0D 0 1 1 1
1D 0 1 1 0
_
WhyWhy can’t
can’t you you loop
switch PWthe three
and PW?
adjacent 1s in the top row together?
Karnaugh Maps (K-maps)

C = PWD+ PWD+ PWD + PWD + PWD


00 01 1 1 1 0
P W PW P W PW
0D 0 1 1 1
1D 0 1 1 0
NOTE:Circle neighboring ONES in powers of 2. Try to find the greatest amount of
“neighbors.” Only overlap circles as a last resort!
Simplified Boolean Equation
_ _ _
D D Opposite
PWD PWD values
PW 0 0 cancel out

PW 11 1 1_
C= W
PW 1 1 1 1PWD
_1 _
_
+ PD
PW 1 0 _
1 PWD
PWD PWD
Simplified Boolean Equation

Opposite values in circles cancel out


D D _ _ 3_

PW 0 0 Step
PWD
_ 2
PWD
=W
PWD PWD
1 1
1
PW 4
_ _
1
Step
PW 1 1 PWD
__ = PD
PW 1 0 PWD

C = W + PD
Combinational Logic Circuit

C=W
P _ PD
+ PD
D _ PD
D
• Integrated Circuits (ICs)

 Used for implementation of combinational


logic circuits
 Use TTL family (transistor transistor
logic)
• IC Identification
• Procedure

•Truth Table  Truth Table


•Boolean Expression  Determine input and output
•K-Map variable (s)
•Simplified Boolean
Expression
 How many combinations
•Logic Circuit are there?
•LabVIEW Simulation  Complete truth table on a
•NI-ELVIS sheet of paper
• Procedure

•Truth Table  Boolean Expression


•Boolean Expression  Gather all combinations
•K-Map that produce a 1 for output
•Simplified Boolean
Expression
•Logic Circuit  Create a Boolean
•LabVIEW Simulation expression from these
•NI-ELVIS smaller expressions
(independent conditions)
Truth Tables
• What is a Truth Table?
• A truth table is a tool that helps you analyze statements or arguments
in order to verify whether or not they are logical, or true.
• There are five basic operations that you will utilize when creating a
truth table.
• These operations are the conjunction, disjunction, negation,
conditional, and bi-conditional.
• These operations are also referred to as “and,” “or,” “not,” “if-then,”
and “if and only if.”

MOD 3 - Digital Logic Operations 31


Truth Tables
• Because complex Boolean statements can get tricky to think about, we can create
a truth table to keep track of what truth values for the simple statements make the
complex statement true and false
• Truth Table
• A table showing what the resulting truth value of a complex statement is for all the
possible truth values for the simple statements.
• Example 1
• Suppose you’re picking out a new couch, and your significant other says “get a
sectional or something with a chaise.”
• This is a complex statement made of two simpler conditions: “is a sectional,” and “has
a chaise.”
• For simplicity, let’s use S to designate “is a sectional,” and C to designate “has a
chaise.”
• The condition S is true if the couch is a sectional.
MOD 3 - Digital Logic Operations 32
• A truth table for this would look like this:
S C S or C

T T T

T F T

F T T

F F F

MOD 3 - Digital Logic Operations 33


• In the table, T is used for true, and F for false.
• In the first row, if S is true and C is also true, then the complex
statement “S or C” is true.
• This would be a sectional that also has a chaise, which meets our
desire.
• Remember also that or in logic is not exclusive; if the couch has both
features, it does meet the condition.
• To shorthand our notation further, we’re going to introduce some
symbols that are commonly used for and, or, and not.

MOD 3 - Digital Logic Operations 34


Symbols
• The symbol ⋀ is used for and: A and B is notated A ⋀ B.
• The symbol ⋁ is used for or: A or B is notated A ⋁ B
• The symbol ~ is used for not: not A is notated ~A
• You can remember the first two symbols by relating them to the
shapes for the union and intersection.
• A ⋀ B would be the elements that exist in both sets, in A ⋂ B.
• Likewise, A ⋁ B would be the elements that exist in either set, in A ⋃
B.

MOD 3 - Digital Logic Operations 35


• In the previous example, the truth table was really just summarizing
what we already know about how the or statement work.
• The truth tables for the basic and, or, and not statements are shown
below.

MOD 3 - Digital Logic Operations 36


Basic Truth Tables

A B A⋀B

T T T

T F F

F T F

F F F

MOD 3 - Digital Logic Operations 37


A B A⋁B

T T T

T F T

F T T

F F F

MOD 3 - Digital Logic Operations 38


A ~A

T F

F T

Truth tables really become useful when analyzing more complex Boolean statements.

MOD 3 - Digital Logic Operations 39


Example 2
• Create a truth table for the statement A ⋀ ~(B ⋁ C)
• It helps to work from the inside out when creating truth tables, and create
tables for intermediate operations.
• We start by listing all the possible truth value combinations for A, B,
and C.
• Notice how the first column contains 4 Ts followed by 4 Fs, the second
column contains 2 Ts, 2 Fs, then repeats, and the last column alternates.
• This pattern ensures that all combinations are considered.
• Along with those initial values, we’ll list the truth values for the innermost
expression, B ⋁ C.

MOD 3 - Digital Logic Operations 40


A B C B⋁C

T T T T

T T F T

T F T T

T F F F

F T T T

F T F T

F F T T

F F F F

MOD 3 - Digital Logic Operations 41


• Next we can find the negation of B ⋁ C, working off the B ⋁ C column we
just created.
A B C B⋁C ~(B ⋁ C)

T T T T F

T T F T F

T F T T F

T F F F T

F T T T F

F T F T F

F F T T F

F F F F T

MOD 3 - Digital Logic Operations 42


***END***

MOD 3 - Digital Logic Operations 43

You might also like