SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Lecture 2
Digital Logic Design
 Basics
 Combinational Circuits
 Sequential Circuits
Thanks to Adapted from the slides prepared by S. Dandamudi for the book,
Fundamentals of Computer Organization and Design.
Inam Ul-Haq
Senior Lecturer in Computer Science
University of Education Okara Campus
Inam.bth@gmail.com
Member at IEEE & ACM
Introduction to Digital Logic Basics
 Hardware consists of a few simple building blocks
 These are called logic gates

AND, OR, NOT, …

NAND, NOR, XOR, …
 Logic gates are built using transistors

NOT gate can be implemented by a single transistor

AND gate requires 3 transistors
 Transistors are the fundamental devices

Pentium consists of 3 million transistors

Compaq Alpha consists of 9 million transistors

Now we can build chips with more than 100 million transistors
Basic Concepts
 Simple gates
 AND
 OR
 NOT
 Functionality can be
expressed by a truth table
 A truth table lists output for
each possible input
combination
 Precedence
 NOT > AND > OR
 F = A B + A B
= (A (B)) + ((A) B)
Basic Concepts (cont.)
 Additional useful gates
 NAND
 NOR
 XOR
 NAND = AND + NOT
 NOR = OR + NOT
 XOR implements
exclusive-OR function
 NAND and NOR gates
require only 2 transistors
 AND and OR need 3
transistors!
Basic Concepts (cont.)
 Number of functions
 With N logical variables, we can define
22
N
functions
 Some of them are useful

AND, NAND, NOR, XOR, …
 Some are not useful:

Output is always 1

Output is always 0
 “Number of functions” definition is useful in proving
completeness property
Basic Concepts (cont.)
 Complete sets
 A set of gates is complete

If we can implement any logical function using only
the type of gates in the set
 You can uses as many gates as you want
 Some example complete sets

{AND, OR, NOT} Not a minimal complete
set

{AND, NOT}

{OR, NOT}

{NAND}

{NOR}
 Minimal complete set
 A complete set with no redundant elements.
Basic Concepts (cont.)
 Proving NOR gate is universal
• Proving NAND gate is universal
Logic Chips (cont.)
Logic Chips (cont.)
 Integration levels
 SSI (small scale integration)

Introduced in late 1960s

1-10 gates (previous examples)
 MSI (medium scale integration)

Introduced in late 1960s

10-100 gates
 LSI (large scale integration)

Introduced in early 1970s

100-10,000 gates

VLSI (very large scale integration)

Introduced in late 1970s

More than 10,000 gates
Explore how many transistors in SSI?
Explore how many transistors in MSI?
Explore how many transistors in LSI?
Explore how many transistors in VLSI?
Logic Functions
 Logical functions can be expressed in several
ways:
 Truth table
 Logical expressions
 Graphical form
 Example:
 Majority function

Output is one whenever majority of inputs is 1

We use 3-input majority function
Logic Functions (cont.)
Truth Table
A B C F
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
 Logical expression form
F = A B + B C + A C
Graphical Form
Logical Equivalence
 All three circuits implement F = A B function
Logical Equivalence (cont.)
 Proving logical equivalence of two circuits
 Derive the logical expression for the output of each
circuit
 Show that these two expressions are equivalent

Two ways:
1. You can use the truth table method

For every combination of inputs, if both expressions
yield the same output, they are equivalent

Good for logical expressions with small number of
variables
1. You can also use algebraic manipulation

Need Boolean identities
Logical Equivalence (cont.)
 Derivation of logical expression from a circuit(graphical form)
 Trace from the input to output

Write down intermediate logical expressions along the path

(write down truth table of expression F3)
Logical Equivalence (cont.)
 Proving logical equivalence: Truth table method
 (write down graphical form from below truth table)
A B F1 = A B F3 = (A + B) (A + B) (A + B)
0 0 0 0
0 1 0 0
1 0 0 0
1 1 1 1
Boolean Algebra (2nd
method)
(Prove each property through truth table)
Boolean Algebra (cont.)
(Prove each property through truth table)
Boolean Algebra (cont.)
 Proving logical equivalence: Boolean algebra
method
 To prove that two logical functions F1 and F2 are
equivalent

Start with one function and apply Boolean laws to
derive the other function

Needs intuition as to which laws should be applied
and when
 Practice helps

Sometimes it may be convenient to reduce both
functions to the same expression
 Example: F1= A B and F3 are equivalent
Logic Circuit Design Process
 A simple logic design process involves
1. Problem specification
2. Truth table derivation
3. Derivation of logical expression
4. Simplification of logical expression
5. Implementation
Deriving Logical Expressions
 Derivation of logical expressions from truth tables
 sum-of-products (SOP) form
 product-of-sums (POS) form
 SOP form
 Write an AND term for each input combination that
produces a 1 output

Write the variable if its value is 1; complement
otherwise
 OR the AND terms to get the final expression
 POS form
 Dual of the SOP form
Deriving Logical Expressions (cont.)
 3-input majority function
A B C F
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
 SOP logical expression
 Four product terms
 Because there are 4 rows
with a 1 output
F = A B C + A B C +
A B C + A B C
Deriving Logical Expressions (cont.)
 3-input majority function
A B C F
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
 POS logical expression
 Four sum terms
 Because there are 4 rows
with a 0 output
F = (A + B + C) (A + B + C)
(A + B + C) (A + B + C)
Logical Expression Simplification
 Algebraic manipulation

Use Boolean laws to simplify the expression
 Difficult to use
 Don’t know if you have the simplified form
Algebraic Manipulation
 Majority function example
A B C + A B C + A B C + A B C =
A B C + A B C + A B C + A B C + A B C + A B C
 We can now simplify this expression as
B C + A C + A B
 A difficult method to use for complex expressions
Added extra
Implementation Using NAND Gates
 Using NAND gates
 Get an equivalent expression
A B + C D = A B + C D
 Using de Morgan’s law
A B + C D = A B .
C D
 Can be generalized

Majority function
A B + B C + AC = A B .
BC .
AC
Idea: NAND Gates: Sum-of-Products, NOR Gates: Product-of-Sums
Implementation Using NAND Gates
(cont.)
 Majority function
Introduction to Combinational Circuits
 Combinational circuits

Output depends only on the current inputs
 Combinational circuits provide a higher level of
abstraction
 Help in reducing design complexity
 Reduce chip count
 We look at some useful combinational circuits
Multiplexers
 Multiplexer
 2n
data inputs
 n selection inputs
 a single output
 Selection input
determines the
input that should
be connected to
the output
4-data input MUX
Multiplexers (cont.)
4-data input MUX implementation
Multiplexers (cont.)
MUX implementations
Multiplexers (cont.)
Example chip: 8-to-1 MUX
Multiplexers (cont.)
Efficient implementation: Majority function
Demultiplexers
Demultiplexer (DeMUX)
Decoders
 Decoder selects one-out-of-N inputs
Decoders (cont.)
Logic function implementation
(Full Adder)
Comparator
 Used to implement comparison operators (= , > , < , ≥ , ≤)
Comparator (cont.)
4-bit magnitude comparator chip
A=B: Ox = Ix (x=A<B, A=B, & A>B)
Comparator (cont.)
Serial construction of an 8-bit comparator
1-bit Comparator
x y
x>y
x=y
x<y
x y x>y x=y x<y
CMP
8-bit comparator
x y
x>y
x=y
x<y
CMP
xn>yn
xn=yn
xn<yn
Adders
 Half-adder
 Adds two bits

Produces a sum and carry
 Problem: Cannot use it to build larger inputs
 Full-adder
 Adds three 1-bit values

Like half-adder, produces a sum and carry
 Allows building N-bit adders

Simple technique

Connect Cout of one adder to Cin of the next

These are called ripple-carry adders
Adders (cont.)
Adders (cont.)
A 16-bit ripple-carry adder
Adders (cont.)
 Ripple-carry adders can be slow
 Delay proportional to number of bits
 Carry lookahead adders
 Eliminate the delay of ripple-carry adders
 Carry-ins are generated independently

C0 = A0 B0

C1 = A0 B0 A1 + A0 B0 B1 + A1 B1

. . .
 Requires complex circuits
 Usually, a combination carry lookahead and
ripple-carry techniques are used
1-bit Arithmetic and Logic Unit
Preliminary ALU design
2’s complement
Required 1 is added via Cin
1-bit Arithmetic and Logic Unit (cont.)
Final design
Arithmetic and Logic Unit (cont.)
16-bit ALU
Arithmetic and Logic Unit (cont’d)
4-bit ALU

Weitere ähnliche Inhalte

Was ist angesagt?

Logic gates and NAND and NOR univarsal gates
Logic gates and NAND and NOR univarsal gatesLogic gates and NAND and NOR univarsal gates
Logic gates and NAND and NOR univarsal gatesDhwanil Champaneria
 
Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparatorPreet_patel
 
BOOLEAN ALGEBRA AND LOGIC GATE
BOOLEAN ALGEBRA AND LOGIC GATE BOOLEAN ALGEBRA AND LOGIC GATE
BOOLEAN ALGEBRA AND LOGIC GATE Tamim Tanvir
 
NAND and NOR implementation and Other two level implementation
NAND and NOR implementation and  Other two level implementationNAND and NOR implementation and  Other two level implementation
NAND and NOR implementation and Other two level implementationMuhammad Akhtar
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adderGaditek
 
Digital Logic & Design (DLD) presentation
Digital Logic & Design (DLD) presentationDigital Logic & Design (DLD) presentation
Digital Logic & Design (DLD) presentationfoyez ahammad
 
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsSSE_AndyLi
 
Magnitude Comparator and types of MC
Magnitude Comparator and types of MCMagnitude Comparator and types of MC
Magnitude Comparator and types of MCEasy n Inspire L
 
Design half ,full Adder and Subtractor
Design half ,full Adder and SubtractorDesign half ,full Adder and Subtractor
Design half ,full Adder and SubtractorJaimin@prt.ltd.
 
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic Circuits
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic CircuitsFYBSC IT Digital Electronics Unit III Chapter I Combinational Logic Circuits
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic CircuitsArti Parab Academics
 
Boolean Algebra
Boolean AlgebraBoolean Algebra
Boolean AlgebraHau Moy
 
Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparatorSyed Saeed
 

Was ist angesagt? (20)

Logic gates and NAND and NOR univarsal gates
Logic gates and NAND and NOR univarsal gatesLogic gates and NAND and NOR univarsal gates
Logic gates and NAND and NOR univarsal gates
 
Boolean algebra & logic gates
Boolean algebra & logic gatesBoolean algebra & logic gates
Boolean algebra & logic gates
 
Subtractor (1)
Subtractor (1)Subtractor (1)
Subtractor (1)
 
Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparator
 
BOOLEAN ALGEBRA & LOGIC GATE
BOOLEAN ALGEBRA & LOGIC GATEBOOLEAN ALGEBRA & LOGIC GATE
BOOLEAN ALGEBRA & LOGIC GATE
 
Sop and pos
Sop and posSop and pos
Sop and pos
 
Combinational circuit
Combinational circuitCombinational circuit
Combinational circuit
 
Logic gates presentation
Logic gates presentationLogic gates presentation
Logic gates presentation
 
13 Boolean Algebra
13 Boolean Algebra13 Boolean Algebra
13 Boolean Algebra
 
BOOLEAN ALGEBRA AND LOGIC GATE
BOOLEAN ALGEBRA AND LOGIC GATE BOOLEAN ALGEBRA AND LOGIC GATE
BOOLEAN ALGEBRA AND LOGIC GATE
 
NAND and NOR implementation and Other two level implementation
NAND and NOR implementation and  Other two level implementationNAND and NOR implementation and  Other two level implementation
NAND and NOR implementation and Other two level implementation
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adder
 
Subtractor
SubtractorSubtractor
Subtractor
 
Digital Logic & Design (DLD) presentation
Digital Logic & Design (DLD) presentationDigital Logic & Design (DLD) presentation
Digital Logic & Design (DLD) presentation
 
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
 
Magnitude Comparator and types of MC
Magnitude Comparator and types of MCMagnitude Comparator and types of MC
Magnitude Comparator and types of MC
 
Design half ,full Adder and Subtractor
Design half ,full Adder and SubtractorDesign half ,full Adder and Subtractor
Design half ,full Adder and Subtractor
 
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic Circuits
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic CircuitsFYBSC IT Digital Electronics Unit III Chapter I Combinational Logic Circuits
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic Circuits
 
Boolean Algebra
Boolean AlgebraBoolean Algebra
Boolean Algebra
 
Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparator
 

Andere mochten auch

Admissions in india 2015
Admissions in india 2015Admissions in india 2015
Admissions in india 2015Edhole.com
 
Multiplexer design based on majority gate with quantum cellular automata
Multiplexer design based on majority gate with quantum cellular automataMultiplexer design based on majority gate with quantum cellular automata
Multiplexer design based on majority gate with quantum cellular automataNeelabh Tiwari
 
4-bit camparator
4-bit camparator4-bit camparator
4-bit camparatorBilal Amjad
 
Combinational Circuits
Combinational CircuitsCombinational Circuits
Combinational CircuitsDilum Bandara
 
ALU arithmetic logic unit
ALU  arithmetic logic unitALU  arithmetic logic unit
ALU arithmetic logic unitKarthik Prof.
 
Digital logic circuits important question and answers for 5 units
Digital logic circuits important question and answers for 5 unitsDigital logic circuits important question and answers for 5 units
Digital logic circuits important question and answers for 5 unitsLekashri Subramanian
 

Andere mochten auch (10)

Lab1
Lab1Lab1
Lab1
 
Information system
Information systemInformation system
Information system
 
Admissions in india 2015
Admissions in india 2015Admissions in india 2015
Admissions in india 2015
 
Multiplexer design based on majority gate with quantum cellular automata
Multiplexer design based on majority gate with quantum cellular automataMultiplexer design based on majority gate with quantum cellular automata
Multiplexer design based on majority gate with quantum cellular automata
 
Digital Basics
Digital BasicsDigital Basics
Digital Basics
 
4-bit camparator
4-bit camparator4-bit camparator
4-bit camparator
 
Combinational Circuits
Combinational CircuitsCombinational Circuits
Combinational Circuits
 
ALU arithmetic logic unit
ALU  arithmetic logic unitALU  arithmetic logic unit
ALU arithmetic logic unit
 
STLD-Combinational logic design
STLD-Combinational  logic design STLD-Combinational  logic design
STLD-Combinational logic design
 
Digital logic circuits important question and answers for 5 units
Digital logic circuits important question and answers for 5 unitsDigital logic circuits important question and answers for 5 units
Digital logic circuits important question and answers for 5 units
 

Ähnlich wie Lec 2 digital basics

unit-2_logic_gates_functions.ppt
unit-2_logic_gates_functions.pptunit-2_logic_gates_functions.ppt
unit-2_logic_gates_functions.pptSATHYARAJECE
 
logic gates functions.pptx
logic gates functions.pptxlogic gates functions.pptx
logic gates functions.pptxLalithats2
 
Principles of Combinational Logic-1
Principles of Combinational Logic-1Principles of Combinational Logic-1
Principles of Combinational Logic-1Supanna Shirguppe
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusumakusuma11
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusumakusuma11
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusumakusuma11
 
f37-book-intarch-pres-pt1.ppt
f37-book-intarch-pres-pt1.pptf37-book-intarch-pres-pt1.ppt
f37-book-intarch-pres-pt1.pptTimothy Paul
 
f37-book-intarch-pres-pt1.ppt
f37-book-intarch-pres-pt1.pptf37-book-intarch-pres-pt1.ppt
f37-book-intarch-pres-pt1.pptrickjones250264
 
Digital systems logicgates-booleanalgebra
Digital systems logicgates-booleanalgebraDigital systems logicgates-booleanalgebra
Digital systems logicgates-booleanalgebraelfeds916
 
Lcdf4 chap 03_p2
Lcdf4 chap 03_p2Lcdf4 chap 03_p2
Lcdf4 chap 03_p2ozgur_can
 
decoder and encoder
 decoder and encoder decoder and encoder
decoder and encoderUnsa Shakir
 
vhdl.ppt Verilog Hardware Description Language
vhdl.ppt Verilog Hardware Description Languagevhdl.ppt Verilog Hardware Description Language
vhdl.ppt Verilog Hardware Description Languageshreenathji26
 
chapter 3 Boolean algebra (2).pptx
chapter 3 Boolean algebra (2).pptxchapter 3 Boolean algebra (2).pptx
chapter 3 Boolean algebra (2).pptxRithinA1
 
combinational _logic_circuit_digital.pptx
combinational _logic_circuit_digital.pptxcombinational _logic_circuit_digital.pptx
combinational _logic_circuit_digital.pptxNadzlinIbrahim3
 
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.organnaunivedu
 

Ähnlich wie Lec 2 digital basics (20)

Boolean Logic
Boolean LogicBoolean Logic
Boolean Logic
 
Boolean Logic
Boolean LogicBoolean Logic
Boolean Logic
 
Boolean Logic
Boolean LogicBoolean Logic
Boolean Logic
 
unit-2_logic_gates_functions.ppt
unit-2_logic_gates_functions.pptunit-2_logic_gates_functions.ppt
unit-2_logic_gates_functions.ppt
 
logic gates functions.pptx
logic gates functions.pptxlogic gates functions.pptx
logic gates functions.pptx
 
Principles of Combinational Logic-1
Principles of Combinational Logic-1Principles of Combinational Logic-1
Principles of Combinational Logic-1
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusuma
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusuma
 
Digital electronics nandhini kusuma
Digital electronics nandhini kusumaDigital electronics nandhini kusuma
Digital electronics nandhini kusuma
 
f37-book-intarch-pres-pt1.ppt
f37-book-intarch-pres-pt1.pptf37-book-intarch-pres-pt1.ppt
f37-book-intarch-pres-pt1.ppt
 
f37-book-intarch-pres-pt1.ppt
f37-book-intarch-pres-pt1.pptf37-book-intarch-pres-pt1.ppt
f37-book-intarch-pres-pt1.ppt
 
f37-book-intarch-pres-pt1.ppt
f37-book-intarch-pres-pt1.pptf37-book-intarch-pres-pt1.ppt
f37-book-intarch-pres-pt1.ppt
 
Digital systems logicgates-booleanalgebra
Digital systems logicgates-booleanalgebraDigital systems logicgates-booleanalgebra
Digital systems logicgates-booleanalgebra
 
Lcdf4 chap 03_p2
Lcdf4 chap 03_p2Lcdf4 chap 03_p2
Lcdf4 chap 03_p2
 
9. logic gates._rr
9. logic gates._rr9. logic gates._rr
9. logic gates._rr
 
decoder and encoder
 decoder and encoder decoder and encoder
decoder and encoder
 
vhdl.ppt Verilog Hardware Description Language
vhdl.ppt Verilog Hardware Description Languagevhdl.ppt Verilog Hardware Description Language
vhdl.ppt Verilog Hardware Description Language
 
chapter 3 Boolean algebra (2).pptx
chapter 3 Boolean algebra (2).pptxchapter 3 Boolean algebra (2).pptx
chapter 3 Boolean algebra (2).pptx
 
combinational _logic_circuit_digital.pptx
combinational _logic_circuit_digital.pptxcombinational _logic_circuit_digital.pptx
combinational _logic_circuit_digital.pptx
 
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
 

Mehr von university of education,Lahore

Mehr von university of education,Lahore (20)

Activites and Time Planning
 Activites and Time Planning Activites and Time Planning
Activites and Time Planning
 
Steganography
SteganographySteganography
Steganography
 
Classical Encryption Techniques
Classical Encryption TechniquesClassical Encryption Techniques
Classical Encryption Techniques
 
Activites and Time Planning
Activites and Time PlanningActivites and Time Planning
Activites and Time Planning
 
OSI Security Architecture
OSI Security ArchitectureOSI Security Architecture
OSI Security Architecture
 
Network Security Terminologies
Network Security TerminologiesNetwork Security Terminologies
Network Security Terminologies
 
Project Scheduling, Planning and Risk Management
Project Scheduling, Planning and Risk ManagementProject Scheduling, Planning and Risk Management
Project Scheduling, Planning and Risk Management
 
Software Testing and Debugging
Software Testing and DebuggingSoftware Testing and Debugging
Software Testing and Debugging
 
ePayment Methods
ePayment MethodsePayment Methods
ePayment Methods
 
SEO
SEOSEO
SEO
 
A Star Search
A Star SearchA Star Search
A Star Search
 
Enterprise Application Integration
Enterprise Application IntegrationEnterprise Application Integration
Enterprise Application Integration
 
Uml Diagrams
Uml DiagramsUml Diagrams
Uml Diagrams
 
eDras Max
eDras MaxeDras Max
eDras Max
 
RAD Model
RAD ModelRAD Model
RAD Model
 
Microsoft Project
Microsoft ProjectMicrosoft Project
Microsoft Project
 
Itertaive Process Development
Itertaive Process DevelopmentItertaive Process Development
Itertaive Process Development
 
Computer Aided Software Engineering Nayab Awan
Computer Aided Software Engineering Nayab AwanComputer Aided Software Engineering Nayab Awan
Computer Aided Software Engineering Nayab Awan
 
Lect 2 assessing the technology landscape
Lect 2 assessing the technology landscapeLect 2 assessing the technology landscape
Lect 2 assessing the technology landscape
 
system level requirements gathering and analysis
system level requirements gathering and analysissystem level requirements gathering and analysis
system level requirements gathering and analysis
 

Lec 2 digital basics

  • 1. Lecture 2 Digital Logic Design  Basics  Combinational Circuits  Sequential Circuits Thanks to Adapted from the slides prepared by S. Dandamudi for the book, Fundamentals of Computer Organization and Design. Inam Ul-Haq Senior Lecturer in Computer Science University of Education Okara Campus Inam.bth@gmail.com Member at IEEE & ACM
  • 2. Introduction to Digital Logic Basics  Hardware consists of a few simple building blocks  These are called logic gates  AND, OR, NOT, …  NAND, NOR, XOR, …  Logic gates are built using transistors  NOT gate can be implemented by a single transistor  AND gate requires 3 transistors  Transistors are the fundamental devices  Pentium consists of 3 million transistors  Compaq Alpha consists of 9 million transistors  Now we can build chips with more than 100 million transistors
  • 3. Basic Concepts  Simple gates  AND  OR  NOT  Functionality can be expressed by a truth table  A truth table lists output for each possible input combination  Precedence  NOT > AND > OR  F = A B + A B = (A (B)) + ((A) B)
  • 4. Basic Concepts (cont.)  Additional useful gates  NAND  NOR  XOR  NAND = AND + NOT  NOR = OR + NOT  XOR implements exclusive-OR function  NAND and NOR gates require only 2 transistors  AND and OR need 3 transistors!
  • 5. Basic Concepts (cont.)  Number of functions  With N logical variables, we can define 22 N functions  Some of them are useful  AND, NAND, NOR, XOR, …  Some are not useful:  Output is always 1  Output is always 0  “Number of functions” definition is useful in proving completeness property
  • 6. Basic Concepts (cont.)  Complete sets  A set of gates is complete  If we can implement any logical function using only the type of gates in the set  You can uses as many gates as you want  Some example complete sets  {AND, OR, NOT} Not a minimal complete set  {AND, NOT}  {OR, NOT}  {NAND}  {NOR}  Minimal complete set  A complete set with no redundant elements.
  • 7. Basic Concepts (cont.)  Proving NOR gate is universal • Proving NAND gate is universal
  • 9. Logic Chips (cont.)  Integration levels  SSI (small scale integration)  Introduced in late 1960s  1-10 gates (previous examples)  MSI (medium scale integration)  Introduced in late 1960s  10-100 gates  LSI (large scale integration)  Introduced in early 1970s  100-10,000 gates  VLSI (very large scale integration)  Introduced in late 1970s  More than 10,000 gates Explore how many transistors in SSI? Explore how many transistors in MSI? Explore how many transistors in LSI? Explore how many transistors in VLSI?
  • 10. Logic Functions  Logical functions can be expressed in several ways:  Truth table  Logical expressions  Graphical form  Example:  Majority function  Output is one whenever majority of inputs is 1  We use 3-input majority function
  • 11. Logic Functions (cont.) Truth Table A B C F 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1  Logical expression form F = A B + B C + A C Graphical Form
  • 12. Logical Equivalence  All three circuits implement F = A B function
  • 13. Logical Equivalence (cont.)  Proving logical equivalence of two circuits  Derive the logical expression for the output of each circuit  Show that these two expressions are equivalent  Two ways: 1. You can use the truth table method  For every combination of inputs, if both expressions yield the same output, they are equivalent  Good for logical expressions with small number of variables 1. You can also use algebraic manipulation  Need Boolean identities
  • 14. Logical Equivalence (cont.)  Derivation of logical expression from a circuit(graphical form)  Trace from the input to output  Write down intermediate logical expressions along the path  (write down truth table of expression F3)
  • 15. Logical Equivalence (cont.)  Proving logical equivalence: Truth table method  (write down graphical form from below truth table) A B F1 = A B F3 = (A + B) (A + B) (A + B) 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1
  • 16. Boolean Algebra (2nd method) (Prove each property through truth table)
  • 17. Boolean Algebra (cont.) (Prove each property through truth table)
  • 18. Boolean Algebra (cont.)  Proving logical equivalence: Boolean algebra method  To prove that two logical functions F1 and F2 are equivalent  Start with one function and apply Boolean laws to derive the other function  Needs intuition as to which laws should be applied and when  Practice helps  Sometimes it may be convenient to reduce both functions to the same expression  Example: F1= A B and F3 are equivalent
  • 19. Logic Circuit Design Process  A simple logic design process involves 1. Problem specification 2. Truth table derivation 3. Derivation of logical expression 4. Simplification of logical expression 5. Implementation
  • 20. Deriving Logical Expressions  Derivation of logical expressions from truth tables  sum-of-products (SOP) form  product-of-sums (POS) form  SOP form  Write an AND term for each input combination that produces a 1 output  Write the variable if its value is 1; complement otherwise  OR the AND terms to get the final expression  POS form  Dual of the SOP form
  • 21. Deriving Logical Expressions (cont.)  3-input majority function A B C F 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1  SOP logical expression  Four product terms  Because there are 4 rows with a 1 output F = A B C + A B C + A B C + A B C
  • 22. Deriving Logical Expressions (cont.)  3-input majority function A B C F 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1  POS logical expression  Four sum terms  Because there are 4 rows with a 0 output F = (A + B + C) (A + B + C) (A + B + C) (A + B + C)
  • 23. Logical Expression Simplification  Algebraic manipulation  Use Boolean laws to simplify the expression  Difficult to use  Don’t know if you have the simplified form
  • 24. Algebraic Manipulation  Majority function example A B C + A B C + A B C + A B C = A B C + A B C + A B C + A B C + A B C + A B C  We can now simplify this expression as B C + A C + A B  A difficult method to use for complex expressions Added extra
  • 25. Implementation Using NAND Gates  Using NAND gates  Get an equivalent expression A B + C D = A B + C D  Using de Morgan’s law A B + C D = A B . C D  Can be generalized  Majority function A B + B C + AC = A B . BC . AC Idea: NAND Gates: Sum-of-Products, NOR Gates: Product-of-Sums
  • 26. Implementation Using NAND Gates (cont.)  Majority function
  • 27. Introduction to Combinational Circuits  Combinational circuits  Output depends only on the current inputs  Combinational circuits provide a higher level of abstraction  Help in reducing design complexity  Reduce chip count  We look at some useful combinational circuits
  • 28. Multiplexers  Multiplexer  2n data inputs  n selection inputs  a single output  Selection input determines the input that should be connected to the output 4-data input MUX
  • 29. Multiplexers (cont.) 4-data input MUX implementation
  • 34. Decoders  Decoder selects one-out-of-N inputs
  • 35. Decoders (cont.) Logic function implementation (Full Adder)
  • 36. Comparator  Used to implement comparison operators (= , > , < , ≥ , ≤)
  • 37. Comparator (cont.) 4-bit magnitude comparator chip A=B: Ox = Ix (x=A<B, A=B, & A>B)
  • 38. Comparator (cont.) Serial construction of an 8-bit comparator
  • 41. Adders  Half-adder  Adds two bits  Produces a sum and carry  Problem: Cannot use it to build larger inputs  Full-adder  Adds three 1-bit values  Like half-adder, produces a sum and carry  Allows building N-bit adders  Simple technique  Connect Cout of one adder to Cin of the next  These are called ripple-carry adders
  • 43. Adders (cont.) A 16-bit ripple-carry adder
  • 44. Adders (cont.)  Ripple-carry adders can be slow  Delay proportional to number of bits  Carry lookahead adders  Eliminate the delay of ripple-carry adders  Carry-ins are generated independently  C0 = A0 B0  C1 = A0 B0 A1 + A0 B0 B1 + A1 B1  . . .  Requires complex circuits  Usually, a combination carry lookahead and ripple-carry techniques are used
  • 45. 1-bit Arithmetic and Logic Unit Preliminary ALU design 2’s complement Required 1 is added via Cin
  • 46. 1-bit Arithmetic and Logic Unit (cont.) Final design
  • 47. Arithmetic and Logic Unit (cont.) 16-bit ALU
  • 48. Arithmetic and Logic Unit (cont’d) 4-bit ALU