SlideShare a Scribd company logo
1 of 32
Digital Logic
CS2052 Computer Architecture
Computer Science & Engineering
University of Moratuwa
Dilum Bandara
Dilum.Bandara@uom.lk
Outline
 Logic gates
 Boolean Algebra
 Kanaugh Maps
2
Logic Gates
 Every digital device is based on a set of chips
designed to store & process information
 Basic building blocks of these chips are logic
gates
 Implementation of gates can be different
 Different materials & fabrication technologies
 Different operating voltages
 e.g., 5v vs. 0v, 3+v vs. 0.5v
 Today, they go as low as 1.9 - 2.1v
 But their logical behavior is consistent across all
computers
3
Common Logic Gates
 NOT/inverter
 AND
4
Truth table
Algebraic function
Common Logic Gates (Cont.)
 OR
 NAND
5
Common Logic Gates (Cont.)
 NOR
 XOR/EXOR (Exclusive OR)
6
Common Logic Gates (Cont.)
 NXOR/EXNOR (Exclusive NOR)
7
Exercise
 Implement 3-input AND using 2-inputs ANDs
 Implement a NOT gate using a NAND
8
Fundamental Logic Gate
 2-input NAND gate can be used to build any
other gate
9
Exercise
 Implement AND using NANDs
 Homework
 Implement following gates using NANDs
 OR
 XOR
10
Boolean Algebra
 Boolean variable
 Takes only 2 values – either TRUE (1) or FALSE (0)
 Boolean function
 Mapping from Boolean variables to a Boolean value
 Application
 Can represent complex relationships in a digital circuit
 Boolean algebra
 Deals with binary variables & logic operations
operating on those variables
 Application
 Can simplify a relationship among multiple inputs in a digital
circuit 11
Basic Identities of Boolean Algebra
 Basic operations
 AND (.), OR (+), NOT (– or /)
 0 – FALSE
 1 – TRUE
x + 0 = x x + x = x
x · 0 = 0 x . x = x
x + 1 = 1 x + x/ = 1
x · 1 = x x · x / = 0
12
Basic Identities (Cont.)
 Commutativity
x + y = y + x
xy = yx
 Associativity
x + ( y + z ) = ( x + y ) + z
x (yz) = (xy) z
 Distributivity
x ( y + z ) = xy + xz
x + yz = ( x + y )( x + z)
13
Textbook has a typo
Basic Identities (Cont.)
 DeMorgan’s Theorem
( x + y )/ = x/ y/
( xy )/ = x/ + y/
 Generalized DeMorgan's Theorem
(a + b + … z) / = a / b / … z /
(a.b … z) / = a / + b / + … z /
 Involution
(x /) / = x
14
Exercise
 Simplify following functions using Boolean Algebra
 a + ab
 a(a + b)
 a(a / + b)
 a + a/ b
 (a + b.c) /
a + ab = a(1+b)=a
a(a + b) = a.a +ab=a+ab=a(1+b)=a
a + a'b = (a + a')(a + b)=1(a + b) =a+b
a(a' + b) = a.a' +ab=0+ab=ab
(a + b.c)' = a'.b' + a'.c' 15
Homework
 Show steps for following simplifications
 (a + b)(a + b') = a
 ab + ab'c = ab + ac
 (a + b)(a + b' + c) = a + bc
 (a(b + z(x + a')))' = a' + b' (z' + x')
 (a(b + c) + a'b)'=b'(a' + c')
 (a + b)(a' + c)(b + c) = (a + b)(a' + c)
 No need to submit answers
16
Minterms
 Minterm
 Each combination of variables in a truth table
 As no of digital inputs (Boolean variables)
increase no of minterms increase
 2n minterms for n inputs
 As n increases
 Large truth tables
 Long Boolean functions
 Easier to represent using decimal equivalent of
sum of minterms
 F(a, b, c) = Σ (2, 4, 5, 7) 17
Exercise
 Represent all odd numbers between 0 – 7 as a sum of
minterms
 F(a, b, c) = Σ (1, 3, 5, 7)
 Use Boolean Algebra to simplify above function
Σ (1, 3, 5, 7) = a‘b‘c + a‘bc + ab‘c + abc
= a‘c(b‘ + b) + ac (b‘ + b)
= a‘c + ac = c (a‘+ a) = c
18
Sum of Products
Karnaugh Map (K-Map)
 Pictorial representation of a truth table
 Map of squares – each square for each minterm
 Adjacent squares change in minterm only by one
variable
19
bc
a
00 01 11 10
0 0 1 3 2
1 4 5 7 6
Decimal equivalent
of minterm
Example – 3 Variable K-Map
 Simplify represent of all odd numbers between 0 – 7
 F(a, b, c) = Σ (1, 3, 5, 7)
20
ab
c
00
01
11
10
0 1
1
1
1
1
0
0
0
0
= c
Exercise – 3 Variable K-Map
 Simplify following expression using a K-map
21
ab
c
00
01
11
10
0 1
1
0
0
0
1
1
0
0
= a’c’ + a’b’
Kanaugh Map – Simplification
 Squares containing 1’s are grouped to get sum-
of-product expression
 Group size must be 2n
 Group must be in rectangular shape
 Each group represents an algebraic term
 Its OK for groups to overlap
 OR of all those terms is the final expression
 Maximum group size  better simplification
 A don’t care (X) can be interpreted as either 0 or 1
when needed, only if it contributes to simplification
 Don’t group Xs together!
22
4 Variable K-Map
23
Example – 4 Variable K-Map
24
Exercise – 4 Variable K-Map
 What would be a Boolean expression of a circuit
that detects all even numbers between 0 – 15?
 Present as a sum of minterms
25
5 Variable K-Map – Option 1
26
BC
DE
A
1
/0
00 01 11 10
00
01
11
10
0
5
3
1
8124
2
20
11
106
7
14
16
13 9
15
19
18
17
28 24
31
2921
23
3022 26
25
27
Example – 5 Variable K-Map
 What would be a Boolean expression of a circuit
to detect all prime numbers between 0 & 31?
27
BC
DE
A
1
/0
00 01 11 10
00
01
11
10
0
5
3
1
8124
2
20
11
106
7
14
16
13 9
15
19
18
17
28 24
31
2921
23
3022 26
25
27
5 Variable K-Map – Option 2
28
Example – 5 Variable K-Map – Option 2
29
6 Variable K-Map
30
Simplification as Product of Sum
 Some times it is useful to obtain the algebraic
expression as a product of sums
 Can be obtained by finding sum of products for
F/ & converting it to F
 To find F/ Group 0s in a K-map
 F(a, b, c) = Σ (1, 3, 5, 7) = Π (1, 3, 5, 7)
31
Exercise – Product of Sum
 Find sum-of-product & product-of-sum
representation of following K-map
32
ab
c
00
01
11
10
0 1
1
x
1
1
0
0
0
1
F(a, b, c) = ab’ + c
F/(a, b, c) = a’c’ + bc’
(F/(a, b, c)) / = (a + c)(b’ + c)
= F(a, b, c)

More Related Content

What's hot

Number system
Number systemNumber system
Number system
aviban
 
Csc1401 lecture03 - computer arithmetic - arithmetic and logic unit (alu)
Csc1401   lecture03 - computer arithmetic - arithmetic and logic unit (alu)Csc1401   lecture03 - computer arithmetic - arithmetic and logic unit (alu)
Csc1401 lecture03 - computer arithmetic - arithmetic and logic unit (alu)
IIUM
 

What's hot (20)

3.codes( binary code ,excess 3, gray code )
3.codes( binary code ,excess 3, gray code )3.codes( binary code ,excess 3, gray code )
3.codes( binary code ,excess 3, gray code )
 
decoder and encoder
 decoder and encoder decoder and encoder
decoder and encoder
 
SHIFT REGISTERS
SHIFT REGISTERSSHIFT REGISTERS
SHIFT REGISTERS
 
MULTIPLEXER
MULTIPLEXERMULTIPLEXER
MULTIPLEXER
 
Demultiplexer
DemultiplexerDemultiplexer
Demultiplexer
 
Encoders and decoders
Encoders and decodersEncoders and decoders
Encoders and decoders
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)
 
Half adder and full adder
Half adder and full adderHalf adder and full adder
Half adder and full adder
 
Edge Trigged Flip Flops
Edge Trigged Flip FlopsEdge Trigged Flip Flops
Edge Trigged Flip Flops
 
Encoders
EncodersEncoders
Encoders
 
Number system
Number systemNumber system
Number system
 
BCD to Decimal - Digital Electronics
BCD to Decimal - Digital ElectronicsBCD to Decimal - Digital Electronics
BCD to Decimal - Digital Electronics
 
Presentation bcd adder
Presentation bcd adderPresentation bcd adder
Presentation bcd adder
 
Computer logic and gates
Computer logic and gatesComputer logic and gates
Computer logic and gates
 
Csc1401 lecture03 - computer arithmetic - arithmetic and logic unit (alu)
Csc1401   lecture03 - computer arithmetic - arithmetic and logic unit (alu)Csc1401   lecture03 - computer arithmetic - arithmetic and logic unit (alu)
Csc1401 lecture03 - computer arithmetic - arithmetic and logic unit (alu)
 
Introduction to Counters
Introduction to CountersIntroduction to Counters
Introduction to Counters
 
Digital logic design part1
Digital logic design part1Digital logic design part1
Digital logic design part1
 
Binary to Decimal Conversion
Binary to Decimal ConversionBinary to Decimal Conversion
Binary to Decimal Conversion
 
Digital Electronics Notes
Digital Electronics Notes Digital Electronics Notes
Digital Electronics Notes
 

Viewers also liked

Basics in algorithms and data structure
Basics in algorithms and data structure Basics in algorithms and data structure
Basics in algorithms and data structure
Eman magdy
 
Chapter 3.1
Chapter 3.1Chapter 3.1
Chapter 3.1
sotlsoc
 
Chapter 7.4
Chapter 7.4Chapter 7.4
Chapter 7.4
sotlsoc
 
Applied electronics-outcome-1
Applied electronics-outcome-1Applied electronics-outcome-1
Applied electronics-outcome-1
doovood
 

Viewers also liked (20)

Digital Logic Design-Lecture 5
Digital Logic Design-Lecture 5Digital Logic Design-Lecture 5
Digital Logic Design-Lecture 5
 
Data Structure Basics
Data Structure BasicsData Structure Basics
Data Structure Basics
 
Webpage Visual Design and Online Prototype
Webpage Visual Design and Online PrototypeWebpage Visual Design and Online Prototype
Webpage Visual Design and Online Prototype
 
Basics in algorithms and data structure
Basics in algorithms and data structure Basics in algorithms and data structure
Basics in algorithms and data structure
 
Chapter 3.1
Chapter 3.1Chapter 3.1
Chapter 3.1
 
Chapter 7.4
Chapter 7.4Chapter 7.4
Chapter 7.4
 
Logic Formulation 2
Logic Formulation 2Logic Formulation 2
Logic Formulation 2
 
Lect 1
Lect 1Lect 1
Lect 1
 
Chap 2(const var-datatype)
Chap 2(const var-datatype)Chap 2(const var-datatype)
Chap 2(const var-datatype)
 
Parity Generator and Parity Checker
Parity Generator and Parity CheckerParity Generator and Parity Checker
Parity Generator and Parity Checker
 
2. electric field calculation
2. electric field calculation2. electric field calculation
2. electric field calculation
 
Applied electronics-outcome-1
Applied electronics-outcome-1Applied electronics-outcome-1
Applied electronics-outcome-1
 
Combinational Logic with MSI and LSI
Combinational Logic with MSI and LSICombinational Logic with MSI and LSI
Combinational Logic with MSI and LSI
 
Problem Solving with Algorithms and Data Structure - Lists
Problem Solving with Algorithms and Data Structure - ListsProblem Solving with Algorithms and Data Structure - Lists
Problem Solving with Algorithms and Data Structure - Lists
 
digital logic design Chapter 2 boolean_algebra_&_logic_gates
digital logic design Chapter 2 boolean_algebra_&_logic_gatesdigital logic design Chapter 2 boolean_algebra_&_logic_gates
digital logic design Chapter 2 boolean_algebra_&_logic_gates
 
Problem Solving with Algorithms and Data Structure - Graphs
Problem Solving with Algorithms and Data Structure - GraphsProblem Solving with Algorithms and Data Structure - Graphs
Problem Solving with Algorithms and Data Structure - Graphs
 
101495802 ee2258-lm-1
101495802 ee2258-lm-1101495802 ee2258-lm-1
101495802 ee2258-lm-1
 
Digital logic gate and its application
Digital logic gate and its applicationDigital logic gate and its application
Digital logic gate and its application
 
Digital Logic & Design (DLD) presentation
Digital Logic & Design (DLD) presentationDigital Logic & Design (DLD) presentation
Digital Logic & Design (DLD) presentation
 
digital logic design number system
digital logic design number systemdigital logic design number system
digital logic design number system
 

Similar to Digital Logic

Basic gates and boolean algebra
Basic gates and boolean algebraBasic gates and boolean algebra
Basic gates and boolean algebra
Sudheesh S Madhav
 
Computer organiztion3
Computer organiztion3Computer organiztion3
Computer organiztion3
Umang Gupta
 

Similar to Digital Logic (20)

Basic gates and boolean algebra
Basic gates and boolean algebraBasic gates and boolean algebra
Basic gates and boolean algebra
 
Chapter 3 2
Chapter 3 2Chapter 3 2
Chapter 3 2
 
Chapter-3.pptx
Chapter-3.pptxChapter-3.pptx
Chapter-3.pptx
 
2dig circ
2dig circ2dig circ
2dig circ
 
Computer organiztion3
Computer organiztion3Computer organiztion3
Computer organiztion3
 
DLD BOOLEAN EXPRESSIONS
DLD BOOLEAN EXPRESSIONSDLD BOOLEAN EXPRESSIONS
DLD BOOLEAN EXPRESSIONS
 
WEEK 4- DLD-GateLvelMinimization.pptx
WEEK 4- DLD-GateLvelMinimization.pptxWEEK 4- DLD-GateLvelMinimization.pptx
WEEK 4- DLD-GateLvelMinimization.pptx
 
ECE 2103_L6 Boolean Algebra Canonical Forms.pptx
ECE 2103_L6 Boolean Algebra Canonical Forms.pptxECE 2103_L6 Boolean Algebra Canonical Forms.pptx
ECE 2103_L6 Boolean Algebra Canonical Forms.pptx
 
Digital logic circuit
Digital logic circuitDigital logic circuit
Digital logic circuit
 
ECE 2103_L6 Boolean Algebra Canonical Forms [Autosaved].pptx
ECE 2103_L6 Boolean Algebra Canonical Forms [Autosaved].pptxECE 2103_L6 Boolean Algebra Canonical Forms [Autosaved].pptx
ECE 2103_L6 Boolean Algebra Canonical Forms [Autosaved].pptx
 
Ch1 2 (2)
Ch1 2 (2)Ch1 2 (2)
Ch1 2 (2)
 
Logic gates
Logic gatesLogic gates
Logic gates
 
tutorial5.ppt
tutorial5.ppttutorial5.ppt
tutorial5.ppt
 
Ec2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.orgEc2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.org
 
Ch1-2, Digital Logic Circuit and Digital Components.ppt
Ch1-2, Digital Logic Circuit and Digital Components.pptCh1-2, Digital Logic Circuit and Digital Components.ppt
Ch1-2, Digital Logic Circuit and Digital Components.ppt
 
CH1_2.ppt
CH1_2.pptCH1_2.ppt
CH1_2.ppt
 
Ch1 2
Ch1 2Ch1 2
Ch1 2
 
CH1_2.ppt
CH1_2.pptCH1_2.ppt
CH1_2.ppt
 
Logic gates and boolean algebra.ppt
Logic gates and boolean algebra.pptLogic gates and boolean algebra.ppt
Logic gates and boolean algebra.ppt
 
digital logic circuits, logic gates, boolean algebra
digital logic circuits, logic gates, boolean algebradigital logic circuits, logic gates, boolean algebra
digital logic circuits, logic gates, boolean algebra
 

More from Dilum Bandara

More from Dilum Bandara (20)

Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
Time Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in PracticeTime Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in Practice
 
Introduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCAIntroduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCA
 
Introduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive AnalyticsIntroduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive Analytics
 
Introduction to Concurrent Data Structures
Introduction to Concurrent Data StructuresIntroduction to Concurrent Data Structures
Introduction to Concurrent Data Structures
 
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-MatrixHard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
 
Introduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with HadoopIntroduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with Hadoop
 
Embarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsEmbarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel Problems
 
Introduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale ComputersIntroduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale Computers
 
Introduction to Thread Level Parallelism
Introduction to Thread Level ParallelismIntroduction to Thread Level Parallelism
Introduction to Thread Level Parallelism
 
CPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching TechniquesCPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching Techniques
 
Data-Level Parallelism in Microprocessors
Data-Level Parallelism in MicroprocessorsData-Level Parallelism in Microprocessors
Data-Level Parallelism in Microprocessors
 
Instruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware TechniquesInstruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware Techniques
 
Instruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler TechniquesInstruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler Techniques
 
CPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An IntroductionCPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An Introduction
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCP
 
Introduction to Content Delivery Networks
Introduction to Content Delivery NetworksIntroduction to Content Delivery Networks
Introduction to Content Delivery Networks
 
Peer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and StreamingPeer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and Streaming
 
Mobile Services
Mobile ServicesMobile Services
Mobile Services
 

Recently uploaded

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

Digital Logic

  • 1. Digital Logic CS2052 Computer Architecture Computer Science & Engineering University of Moratuwa Dilum Bandara Dilum.Bandara@uom.lk
  • 2. Outline  Logic gates  Boolean Algebra  Kanaugh Maps 2
  • 3. Logic Gates  Every digital device is based on a set of chips designed to store & process information  Basic building blocks of these chips are logic gates  Implementation of gates can be different  Different materials & fabrication technologies  Different operating voltages  e.g., 5v vs. 0v, 3+v vs. 0.5v  Today, they go as low as 1.9 - 2.1v  But their logical behavior is consistent across all computers 3
  • 4. Common Logic Gates  NOT/inverter  AND 4 Truth table Algebraic function
  • 5. Common Logic Gates (Cont.)  OR  NAND 5
  • 6. Common Logic Gates (Cont.)  NOR  XOR/EXOR (Exclusive OR) 6
  • 7. Common Logic Gates (Cont.)  NXOR/EXNOR (Exclusive NOR) 7
  • 8. Exercise  Implement 3-input AND using 2-inputs ANDs  Implement a NOT gate using a NAND 8
  • 9. Fundamental Logic Gate  2-input NAND gate can be used to build any other gate 9
  • 10. Exercise  Implement AND using NANDs  Homework  Implement following gates using NANDs  OR  XOR 10
  • 11. Boolean Algebra  Boolean variable  Takes only 2 values – either TRUE (1) or FALSE (0)  Boolean function  Mapping from Boolean variables to a Boolean value  Application  Can represent complex relationships in a digital circuit  Boolean algebra  Deals with binary variables & logic operations operating on those variables  Application  Can simplify a relationship among multiple inputs in a digital circuit 11
  • 12. Basic Identities of Boolean Algebra  Basic operations  AND (.), OR (+), NOT (– or /)  0 – FALSE  1 – TRUE x + 0 = x x + x = x x · 0 = 0 x . x = x x + 1 = 1 x + x/ = 1 x · 1 = x x · x / = 0 12
  • 13. Basic Identities (Cont.)  Commutativity x + y = y + x xy = yx  Associativity x + ( y + z ) = ( x + y ) + z x (yz) = (xy) z  Distributivity x ( y + z ) = xy + xz x + yz = ( x + y )( x + z) 13 Textbook has a typo
  • 14. Basic Identities (Cont.)  DeMorgan’s Theorem ( x + y )/ = x/ y/ ( xy )/ = x/ + y/  Generalized DeMorgan's Theorem (a + b + … z) / = a / b / … z / (a.b … z) / = a / + b / + … z /  Involution (x /) / = x 14
  • 15. Exercise  Simplify following functions using Boolean Algebra  a + ab  a(a + b)  a(a / + b)  a + a/ b  (a + b.c) / a + ab = a(1+b)=a a(a + b) = a.a +ab=a+ab=a(1+b)=a a + a'b = (a + a')(a + b)=1(a + b) =a+b a(a' + b) = a.a' +ab=0+ab=ab (a + b.c)' = a'.b' + a'.c' 15
  • 16. Homework  Show steps for following simplifications  (a + b)(a + b') = a  ab + ab'c = ab + ac  (a + b)(a + b' + c) = a + bc  (a(b + z(x + a')))' = a' + b' (z' + x')  (a(b + c) + a'b)'=b'(a' + c')  (a + b)(a' + c)(b + c) = (a + b)(a' + c)  No need to submit answers 16
  • 17. Minterms  Minterm  Each combination of variables in a truth table  As no of digital inputs (Boolean variables) increase no of minterms increase  2n minterms for n inputs  As n increases  Large truth tables  Long Boolean functions  Easier to represent using decimal equivalent of sum of minterms  F(a, b, c) = Σ (2, 4, 5, 7) 17
  • 18. Exercise  Represent all odd numbers between 0 – 7 as a sum of minterms  F(a, b, c) = Σ (1, 3, 5, 7)  Use Boolean Algebra to simplify above function Σ (1, 3, 5, 7) = a‘b‘c + a‘bc + ab‘c + abc = a‘c(b‘ + b) + ac (b‘ + b) = a‘c + ac = c (a‘+ a) = c 18 Sum of Products
  • 19. Karnaugh Map (K-Map)  Pictorial representation of a truth table  Map of squares – each square for each minterm  Adjacent squares change in minterm only by one variable 19 bc a 00 01 11 10 0 0 1 3 2 1 4 5 7 6 Decimal equivalent of minterm
  • 20. Example – 3 Variable K-Map  Simplify represent of all odd numbers between 0 – 7  F(a, b, c) = Σ (1, 3, 5, 7) 20 ab c 00 01 11 10 0 1 1 1 1 1 0 0 0 0 = c
  • 21. Exercise – 3 Variable K-Map  Simplify following expression using a K-map 21 ab c 00 01 11 10 0 1 1 0 0 0 1 1 0 0 = a’c’ + a’b’
  • 22. Kanaugh Map – Simplification  Squares containing 1’s are grouped to get sum- of-product expression  Group size must be 2n  Group must be in rectangular shape  Each group represents an algebraic term  Its OK for groups to overlap  OR of all those terms is the final expression  Maximum group size  better simplification  A don’t care (X) can be interpreted as either 0 or 1 when needed, only if it contributes to simplification  Don’t group Xs together! 22
  • 24. Example – 4 Variable K-Map 24
  • 25. Exercise – 4 Variable K-Map  What would be a Boolean expression of a circuit that detects all even numbers between 0 – 15?  Present as a sum of minterms 25
  • 26. 5 Variable K-Map – Option 1 26 BC DE A 1 /0 00 01 11 10 00 01 11 10 0 5 3 1 8124 2 20 11 106 7 14 16 13 9 15 19 18 17 28 24 31 2921 23 3022 26 25 27
  • 27. Example – 5 Variable K-Map  What would be a Boolean expression of a circuit to detect all prime numbers between 0 & 31? 27 BC DE A 1 /0 00 01 11 10 00 01 11 10 0 5 3 1 8124 2 20 11 106 7 14 16 13 9 15 19 18 17 28 24 31 2921 23 3022 26 25 27
  • 28. 5 Variable K-Map – Option 2 28
  • 29. Example – 5 Variable K-Map – Option 2 29
  • 31. Simplification as Product of Sum  Some times it is useful to obtain the algebraic expression as a product of sums  Can be obtained by finding sum of products for F/ & converting it to F  To find F/ Group 0s in a K-map  F(a, b, c) = Σ (1, 3, 5, 7) = Π (1, 3, 5, 7) 31
  • 32. Exercise – Product of Sum  Find sum-of-product & product-of-sum representation of following K-map 32 ab c 00 01 11 10 0 1 1 x 1 1 0 0 0 1 F(a, b, c) = ab’ + c F/(a, b, c) = a’c’ + bc’ (F/(a, b, c)) / = (a + c)(b’ + c) = F(a, b, c)

Editor's Notes

  1. ( x + y )( x + z) = x + xz + xy + yz = x(1 + z + y) + yz = x + yz