SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
Digital Electronics Basics:
  Combinational Logic

                 for
          Basic Electronics

 http://cktse.eie.polyu.edu.hk/eie209


                 by
          Prof. Michael Tse



            January 2005
Digital versus analog
So far, our discussion about electronics has been predominantly “analog”,
which is concerned with continuously changing signals—signals whose values
at different times are useful information.

There is another form of signals which is nowadays very important and is
being used in an overwhelming number of applications—DIGITAL.

A digital signal assumes just a few analog values. For example, binary signals
have two values, e.g., 0V and 5V. They transmit information in the form of a
sequence of 0V and 5V segments.

                     5V


                0V


                     0 1 0 1 0 0 1 0 1 1 0


                          C.K. Tse: Digital Electronics:                         2
                              Combinational Logic
Digital signals
Of course, in practical generation and detection of digital signals, exact values of
the assumed voltage levels are not possible.

Noise Margins:
                      5V
              VOH                                                                           VIH
                VOL
                 0V                                                                         VIL

                      0 1 0 1 0 0 1 0 1 1 0

Generation:           Any voltage higher than VOH is HIGH. (VOH = 2.4V*)
                      Any voltage lower than VOL is LOW. (VOL = 0.4V)

Detection:            Any voltage higher than VIH is HIGH. (VIH = 2.0V)
                      Any voltage lower than VIL is LOW. (VIL = 0.8V)

                      * for TTL logic which is a particular kind of logic circuit family.


                                C.K. Tse: Digital Electronics:                                    3
                                    Combinational Logic
Logic
What can a digital circuit do?

The simplest task we can think of is a combinational type of logic decision.

For example, we can design a digital electronic circuit to make an instant decision
based on some information. Here we emphasize “instant” in the decision making
process. That means, the process has no time delay.

                   X = today’s weather is good
                   Y = today is a holiday
          decision Z = go to picnic

          Suppose our rule is Z = X and Y                  X
                                                                       Z
          The circuit is a simple AND gate.                Y



     This kind of logic, involving no time delay, is combinational logic.

                          C.K. Tse: Digital Electronics:                        4
                              Combinational Logic
Truth tables
A easy way to represent a combinational logic result is to tabulate all possible inputs.

 X     Y     Z                     X     Y     Z                      X           Z
 0     0     0                     0     0     0                      0           1
 0     1     0                     0     1     1                      1           0
 1     0     0                     1     0     1
 1     1     1                     1     1     1
Truth table of AND                Truth table of OR                 Truth table of NOT
 X                                 X
                  Z                                 Z                X                Z
 Y                                 Y


 X     Y     Z                     X     Y     Z                      X     Y     Z
 0     0     1                     0     0     1                      0     0     0
 0     1     1                     0     1     0                      0     1     1
 1     0     1                     1     0     0                      1     0     1
 1     1     0                     1     1     0                      1     1     0
Truth table of NAND               Truth table of NOR           Truth table of XOR (Exclusive OR)
 X                                 X                                 X
                  Z                                 Z                                Z
 Y                                 Y                                 Y
                              C.K. Tse: Digital Electronics:                               5
                                  Combinational Logic
Boolean algebra
Logic can also be expressed in algebraic form.


     X     Y     Z
     0     0     0                                         X
     0     1     0              Z = X.Y                    Y
                                                                           Z
     1     0     0                                             AND gate
     1     1     1
    Truth table of AND


     X     Y     Z                                         X
     0     0     1                                         Y                   Z
     0     1     1
                               Z = X.Y
     1     0     1                                         X
                                                                           Z
                                                           Y
     1     1     0
    Truth table of NAND                                        NAND gate




                          C.K. Tse: Digital Electronics:                           6
                              Combinational Logic
Boolean algebra
Logic can also be expressed in algebraic form.


      X     Y     Z
      0     0     0                                       X
      0     1     1            Z = X+Y                    Y
                                                                         Z
      1     0     1                                           OR gate
      1     1     1
    Truth table of OR


      X     Y     Z                                       X
      0     0     1                                       Y                  Z
      0     1     0
                              Z = X+Y
      1     0     0                                       X
                                                                         Z
                                                          Y
      1     1     0
    Truth table of NOR                                        NOR gate




                         C.K. Tse: Digital Electronics:                          7
                             Combinational Logic
Finding expression from truth table
Once we have the truth table, we can find the output expression by adding up
all min-terms.

    Min-term corresponds to the product term that give a 1 in the output.
    For example, here the min-terms are X .Y , X.Y , and X.Y


      X    Y   Z          The expression for Z is
      0    0   0
      0    1   1           Z = X .Y + X.Y + X.Y
      1    0   1
      1    1   1




 Question: This is an OR gate! Can it be simplified down to Z = X + Y ? How
 can we do it?

                         C.K. Tse: Digital Electronics:                       8
                             Combinational Logic
More examples
      X     Y     Z           The expression for Z is
      0     0     1
      0     1     1            Z = X .Y + X .Y + X.Y
      1     0     1
      1     1     0


      X     Y     Z
                               The expression for Z is
      0     0     1
      0     1     0
      1     0     0
                                     Z = X .Y
      1     1     0
     Truth table of NOR



Question: These are NAND and NOR gates! Can they be simplified or
converted back to the originally derived forms? How can we do it?

                          C.K. Tse: Digital Electronics:            9
                              Combinational Logic
Circuit realization
                                     X

 Z = X .Y + X .Y + X.Y
                                     Y
                                                                         Z




Note: This is same as a NAND gate (see the truth table), and hence should be the
same as
                                X
                                                 Z
                                Y



The question is HOW TO SIMPLIFY A MIN-TERM EXPRESSION!

                           C.K. Tse: Digital Electronics:                     10
                               Combinational Logic
Example: binary code to Gray code conversion
 Binary         Gray code                   What are the expressions for x, y
 a b      c     x y z                       and z? Then, can we design a
 0 0      0     0 0 0                       circuit to converter binary code
 0 0      1     0 0 1                       to Gray code?
 0 1      0     0 1 1
 0 1      1     0 1 0                       x = ab c + ab c + abc + abc
 1 0      0     1 1 0
 1 0      1     1 1 1                       y = a bc + a bc + ab c + ab c
 1 1      0     1 0 1                      z = a b c + a bc + ab c + abc
 1 1      1     1 0 0

So, for each of x, y and z, we need a number of inverters,
plus 4 AND gates and a multi-input OR gates.


                   C.K. Tse: Digital Electronics:                           11
                       Combinational Logic
Boolean algebra simplification

Basic Laws:

Commutative: X+Y = Y+X
             X.Y = Y.X

Associative:   X+Y+Z = (X+Y)+Z = X+(Y+Z)
               X.Y.Z = (X.Y).Z = X.(Y.Z)

Distributive: X.(Y+Z) = X.Y + X.Z

De Morgan’s: X+Y = X . Y
              X.Y = X + Y

                   C.K. Tse: Digital Electronics:   12
                       Combinational Logic
Example:
   Z = X .Y + X .Y + X.Y
     = X .(Y + Y ) + X.Y
     = X .1+ X.Y                                       Y +Y =1
     = X + X.Y                                         X .1 = X
     = (X.(X + Y ))                                    De Morgan’ law

     = (X.X + X.Y )                                    Distributive

     = X.Y                                             X .X = 0



  That’s right! It’s a NAND gate!


                      C.K. Tse: Digital Electronics:                    13
                          Combinational Logic
Example:

     Z = X .Y + X.Y + X.Y
      = (X + X).Y + X.Y
      = Y + X.Y

      = Y .(X.Y )                                      De Morgan’ law

      = Y .(X + Y )                                    De Morgan’ law

      = X .Y + 0                                       Y .Y = 0
      = X .Y
      = X +Y                                           De Morgan’ law



 That’s right! It’s a OR gate!
                      C.K. Tse: Digital Electronics:                    14
                          Combinational Logic
Boolean algebra can be tedious.

Is there any easier method to simplify the min-term
expression?




                C.K. Tse: Digital Electronics:        15
                    Combinational Logic
Karnaugh Maps

A very useful design tool for simplifying combinational logic.

 X    Y       Z           The expression for Z is
 0    0       1
 0    1       1               Z = X .Y + X .Y + X.Y
 1    0       1
 1    1       0
                      Y                        Y    Y                          Y   Y
                  0       1
              0   1       1              X     1     1           X        X   1    1
          X
              1   1       0              X     1     0                    X   1    0

                                                                                   X.Y
                                               Y

                                 Therefore Z = X + Y                 or       Z = X.Y
                                C.K. Tse: Digital Electronics:                           16
                                    Combinational Logic
Karnaugh map (with 3 inputs)

      Suppose we have three inputs a, b and c.

      Output x is
                                                                          Procedure:
             x = a.b.c + a.b .c + a .b.c + a.b.c                          1.   Circle clusters of “1”.
                                                                          2.   Determine the logic
                                                 b       110
                               b                                               expressions for each cluster.
                          }                                    011



                                            }
                     bc                                                   3.   Add them up.
                 a        00       01       11       10

111           a{     0    0 0 1 1
                                                                     ab
              a{     1
                          1 0 1 0
                          }



                                                     }
                                   }


                100
                          c             c            c                    Hence, we get
                                                                          x = a.b.c + b.c + a .b
                                                     bc
                               abc
                                        C.K. Tse: Digital Electronics:                                17
                                            Combinational Logic
Example: Gray code                                                                 b                 b




                                                                                  }
                                                                                                    }
                                                                             bc
        Binary                     Gray code                           a          00       01       11       10
    a     b      c                 x y z
    0     0      0                 0 0 0                            a{       0    0 0 1 1
    0     0      1                 0 0 1                    y
    0
    0
          1
          1
                 0
                 1
                                   0 1 1
                                   0 1 0
                                                                    a{       1
                                                                                  1 1 0 0




                                                                                  }
                                                                                           }
                                                                                                             }
    1     0      0                 1 1 0
    1     0      1                 1 1 1                                          c             c            c
    1
    1
          1
          1
                 0
                 1
                                   1 0 1
                                   1 0 0
                                                                                  y = ab + a b
                                        b                                              b                 b
                      b




                                                                                  }
                                                                                                    }
                                   }
                 }

            bc                                                               bc
        a                                                              a          00       01       11       10
                 00       01       11       10

     a{     0    0 0 0 0                                            a{       0    0 1 0 1
x                                                           z
     a{     1
                 1 1 1 1                                            a{       1
                                                                                  0 1 0 1


                                                                                  }



                                                                                                             }
                                                                                           }
                 }



                                            }
                          }




                 c                          c                                     c             c            c
                               c
                          x=a                                                         z = b c + bc
                                            C.K. Tse: Digital Electronics:                                        18
                                                Combinational Logic
Example: Gray code
a
    Binary
      b      c
                 Gray code
                 x y z
                                                         x=a
0     0      0   0 0 0
0     0      1   0 0 1                                y = ab + a b
0     1      0   0 1 1
0
1
      1
      0
             1
             0
                 0 1 0
                 1 1 0
                                                      z = b c + bc
1     0      1   1 1 1
1     1      0   1 0 1
1     1      1   1 0 0         a                                     x

                                                                     y
                               b

                               c

                                                                     z



                     C.K. Tse: Digital Electronics:                  19
                         Combinational Logic
Karnaugh map (with 4 inputs)

                               c                 c




                             {
                                            {
                  cd
             ab          00        01       11       10

                  00                                      }b
         a   {    01


                  11
                                                          }    b

         a   {    10
                        {
                                   }                      }b


                                                     {
                         d              d            d


                       C.K. Tse: Digital Electronics:              20
                           Combinational Logic
c                 c
Example




                                                         {
                                                                        {
                                               cd
Procedure:                                ab         00        01       11       10
1.    Circle clusters of “1”.
                                               00    1         1        0        0    }b
2.

3.
      Determine the logic
      expressions for each cluster.
      Add them up.
                                      a   {    01    1         1        1        1

         ac                                    11    1         1        1        1
                                                                                      }    b

                                      a   {    10    0         0        1        1    }b




                                                               }
                                                    {




                                                                                 {
                                                     d              d            d
                          b
                                                                    ac
     x = a c + b + ac
                              C.K. Tse: Digital Electronics:                           21
                                  Combinational Logic
Example
Derive the circuit for this combinational logic.

               x = a c + b + ac

               a
               c
               b                                     x




                    C.K. Tse: Digital Electronics:       22
                        Combinational Logic

Más contenido relacionado

La actualidad más candente

Number systems presentation
Number systems presentationNumber systems presentation
Number systems presentationJiian Francisco
 
A Review of Proximal Methods, with a New One
A Review of Proximal Methods, with a New OneA Review of Proximal Methods, with a New One
A Review of Proximal Methods, with a New OneGabriel Peyré
 
On Foundations of Parameter Estimation for Generalized Partial Linear Models ...
On Foundations of Parameter Estimation for Generalized Partial Linear Models ...On Foundations of Parameter Estimation for Generalized Partial Linear Models ...
On Foundations of Parameter Estimation for Generalized Partial Linear Models ...SSA KPI
 
Tele3113 wk1wed
Tele3113 wk1wedTele3113 wk1wed
Tele3113 wk1wedVin Voro
 
Regression Theory
Regression TheoryRegression Theory
Regression TheorySSA KPI
 
Numerical solution of boundary value problems by piecewise analysis method
Numerical solution of boundary value problems by piecewise analysis methodNumerical solution of boundary value problems by piecewise analysis method
Numerical solution of boundary value problems by piecewise analysis methodAlexander Decker
 
Lesson 2: A Catalog of Essential Functions
Lesson 2: A Catalog of Essential FunctionsLesson 2: A Catalog of Essential Functions
Lesson 2: A Catalog of Essential FunctionsMatthew Leingang
 
Scatter diagrams and correlation and simple linear regresssion
Scatter diagrams and correlation and simple linear regresssionScatter diagrams and correlation and simple linear regresssion
Scatter diagrams and correlation and simple linear regresssionAnkit Katiyar
 
كتيب ملخصات دروس للرياضيات السنة الثانية ثانوي 2
كتيب   ملخصات دروس للرياضيات السنة الثانية ثانوي 2كتيب   ملخصات دروس للرياضيات السنة الثانية ثانوي 2
كتيب ملخصات دروس للرياضيات السنة الثانية ثانوي 2math44
 

La actualidad más candente (16)

Topic1
Topic1Topic1
Topic1
 
Number systems presentation
Number systems presentationNumber systems presentation
Number systems presentation
 
A Review of Proximal Methods, with a New One
A Review of Proximal Methods, with a New OneA Review of Proximal Methods, with a New One
A Review of Proximal Methods, with a New One
 
On Foundations of Parameter Estimation for Generalized Partial Linear Models ...
On Foundations of Parameter Estimation for Generalized Partial Linear Models ...On Foundations of Parameter Estimation for Generalized Partial Linear Models ...
On Foundations of Parameter Estimation for Generalized Partial Linear Models ...
 
Tele3113 wk1wed
Tele3113 wk1wedTele3113 wk1wed
Tele3113 wk1wed
 
Regression Theory
Regression TheoryRegression Theory
Regression Theory
 
Numerical solution of boundary value problems by piecewise analysis method
Numerical solution of boundary value problems by piecewise analysis methodNumerical solution of boundary value problems by piecewise analysis method
Numerical solution of boundary value problems by piecewise analysis method
 
Lesson 2: A Catalog of Essential Functions
Lesson 2: A Catalog of Essential FunctionsLesson 2: A Catalog of Essential Functions
Lesson 2: A Catalog of Essential Functions
 
Day 01
Day 01Day 01
Day 01
 
Scatter diagrams and correlation and simple linear regresssion
Scatter diagrams and correlation and simple linear regresssionScatter diagrams and correlation and simple linear regresssion
Scatter diagrams and correlation and simple linear regresssion
 
كتيب ملخصات دروس للرياضيات السنة الثانية ثانوي 2
كتيب   ملخصات دروس للرياضيات السنة الثانية ثانوي 2كتيب   ملخصات دروس للرياضيات السنة الثانية ثانوي 2
كتيب ملخصات دروس للرياضيات السنة الثانية ثانوي 2
 
Gene network inference
Gene network inferenceGene network inference
Gene network inference
 
Review for final exam
Review for final examReview for final exam
Review for final exam
 
Fdtd
FdtdFdtd
Fdtd
 
Differential equation
Differential equationDifferential equation
Differential equation
 
Bitwise
BitwiseBitwise
Bitwise
 

Similar a 7.digital basicsa

Dateof birthdesignproblem 1_
Dateof birthdesignproblem 1_Dateof birthdesignproblem 1_
Dateof birthdesignproblem 1_rofldork
 
Electronic Circuits
Electronic  CircuitsElectronic  Circuits
Electronic Circuitsgavhays
 
Mux decod pld2_vs2
Mux decod pld2_vs2Mux decod pld2_vs2
Mux decod pld2_vs2WanNurdiana
 
Neural networks
Neural networksNeural networks
Neural networksSlideshare
 
EASA Part 66 Module 5.5 : Logic Circuit
EASA Part 66 Module 5.5 : Logic CircuitEASA Part 66 Module 5.5 : Logic Circuit
EASA Part 66 Module 5.5 : Logic Circuitsoulstalker
 
Half adder and full adder
Half adder and full adderHalf adder and full adder
Half adder and full adderKamil Hussain
 
Basic logic gates
Basic logic gatesBasic logic gates
Basic logic gatesKumar
 
Report on-the-logic-gates
Report on-the-logic-gatesReport on-the-logic-gates
Report on-the-logic-gatesbhardubhai
 
Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan
Digital Logic & Computer Architecture Practical Book by Yasir Ahmed KhanDigital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan
Digital Logic & Computer Architecture Practical Book by Yasir Ahmed KhanYasir Khan
 
2009-2 기말고사문제(초고주파공학)
2009-2 기말고사문제(초고주파공학)2009-2 기말고사문제(초고주파공학)
2009-2 기말고사문제(초고주파공학)Yong Heui Cho
 
Special Techniques (Teknik Khusus)
Special Techniques (Teknik Khusus)Special Techniques (Teknik Khusus)
Special Techniques (Teknik Khusus)Septiko Aji
 

Similar a 7.digital basicsa (20)

Dateof birthdesignproblem 1_
Dateof birthdesignproblem 1_Dateof birthdesignproblem 1_
Dateof birthdesignproblem 1_
 
Electronic Circuits
Electronic  CircuitsElectronic  Circuits
Electronic Circuits
 
Mux decod pld2_vs2
Mux decod pld2_vs2Mux decod pld2_vs2
Mux decod pld2_vs2
 
16%20 lecture
16%20 lecture16%20 lecture
16%20 lecture
 
Boolean alebra
Boolean alebraBoolean alebra
Boolean alebra
 
Logic gates
 Logic gates Logic gates
Logic gates
 
Neural networks
Neural networksNeural networks
Neural networks
 
EASA Part 66 Module 5.5 : Logic Circuit
EASA Part 66 Module 5.5 : Logic CircuitEASA Part 66 Module 5.5 : Logic Circuit
EASA Part 66 Module 5.5 : Logic Circuit
 
Half adder and full adder
Half adder and full adderHalf adder and full adder
Half adder and full adder
 
Basic logic gates
Basic logic gatesBasic logic gates
Basic logic gates
 
boolean.pdf
boolean.pdfboolean.pdf
boolean.pdf
 
Report on-the-logic-gates
Report on-the-logic-gatesReport on-the-logic-gates
Report on-the-logic-gates
 
Digital 1
Digital 1Digital 1
Digital 1
 
Lect21 Engin112
Lect21 Engin112Lect21 Engin112
Lect21 Engin112
 
Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan
Digital Logic & Computer Architecture Practical Book by Yasir Ahmed KhanDigital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan
Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan
 
Logic gates
Logic gatesLogic gates
Logic gates
 
Ann ics320 part4
Ann ics320 part4Ann ics320 part4
Ann ics320 part4
 
Bca i sem de lab
Bca i sem  de labBca i sem  de lab
Bca i sem de lab
 
2009-2 기말고사문제(초고주파공학)
2009-2 기말고사문제(초고주파공학)2009-2 기말고사문제(초고주파공학)
2009-2 기말고사문제(초고주파공학)
 
Special Techniques (Teknik Khusus)
Special Techniques (Teknik Khusus)Special Techniques (Teknik Khusus)
Special Techniques (Teknik Khusus)
 

Más de Chethan Nt

Dec ''too simple'' digital electronics demystified (mc graw
Dec   ''too simple'' digital electronics demystified (mc grawDec   ''too simple'' digital electronics demystified (mc graw
Dec ''too simple'' digital electronics demystified (mc grawChethan Nt
 
Data structures and algorithms alfred v. aho, john e. hopcroft and jeffrey ...
Data structures and algorithms   alfred v. aho, john e. hopcroft and jeffrey ...Data structures and algorithms   alfred v. aho, john e. hopcroft and jeffrey ...
Data structures and algorithms alfred v. aho, john e. hopcroft and jeffrey ...Chethan Nt
 
Copy of chapter 10
Copy of chapter 10Copy of chapter 10
Copy of chapter 10Chethan Nt
 
Copy of chapter 03
Copy of chapter 03Copy of chapter 03
Copy of chapter 03Chethan Nt
 
Copy of chapter 01
Copy of chapter 01Copy of chapter 01
Copy of chapter 01Chethan Nt
 
Copy of appendices
Copy of appendicesCopy of appendices
Copy of appendicesChethan Nt
 
Copy of 7.digital basicsa
Copy of 7.digital basicsaCopy of 7.digital basicsa
Copy of 7.digital basicsaChethan Nt
 

Más de Chethan Nt (16)

Dec ''too simple'' digital electronics demystified (mc graw
Dec   ''too simple'' digital electronics demystified (mc grawDec   ''too simple'' digital electronics demystified (mc graw
Dec ''too simple'' digital electronics demystified (mc graw
 
Data structures and algorithms alfred v. aho, john e. hopcroft and jeffrey ...
Data structures and algorithms   alfred v. aho, john e. hopcroft and jeffrey ...Data structures and algorithms   alfred v. aho, john e. hopcroft and jeffrey ...
Data structures and algorithms alfred v. aho, john e. hopcroft and jeffrey ...
 
Copy of chapter 10
Copy of chapter 10Copy of chapter 10
Copy of chapter 10
 
Copy of chapter 03
Copy of chapter 03Copy of chapter 03
Copy of chapter 03
 
Copy of chapter 01
Copy of chapter 01Copy of chapter 01
Copy of chapter 01
 
Copy of appendices
Copy of appendicesCopy of appendices
Copy of appendices
 
Copy of 7.digital basicsa
Copy of 7.digital basicsaCopy of 7.digital basicsa
Copy of 7.digital basicsa
 
Chapter 07
Chapter 07Chapter 07
Chapter 07
 
Chapter 05
Chapter 05Chapter 05
Chapter 05
 
Chapter 04
Chapter 04Chapter 04
Chapter 04
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
Assni
AssniAssni
Assni
 
Assn2
Assn2Assn2
Assn2
 
Ass5
Ass5Ass5
Ass5
 
Ass4
Ass4Ass4
Ass4
 
Appendices
AppendicesAppendices
Appendices
 

7.digital basicsa

  • 1. Digital Electronics Basics: Combinational Logic for Basic Electronics http://cktse.eie.polyu.edu.hk/eie209 by Prof. Michael Tse January 2005
  • 2. Digital versus analog So far, our discussion about electronics has been predominantly “analog”, which is concerned with continuously changing signals—signals whose values at different times are useful information. There is another form of signals which is nowadays very important and is being used in an overwhelming number of applications—DIGITAL. A digital signal assumes just a few analog values. For example, binary signals have two values, e.g., 0V and 5V. They transmit information in the form of a sequence of 0V and 5V segments. 5V 0V 0 1 0 1 0 0 1 0 1 1 0 C.K. Tse: Digital Electronics: 2 Combinational Logic
  • 3. Digital signals Of course, in practical generation and detection of digital signals, exact values of the assumed voltage levels are not possible. Noise Margins: 5V VOH VIH VOL 0V VIL 0 1 0 1 0 0 1 0 1 1 0 Generation: Any voltage higher than VOH is HIGH. (VOH = 2.4V*) Any voltage lower than VOL is LOW. (VOL = 0.4V) Detection: Any voltage higher than VIH is HIGH. (VIH = 2.0V) Any voltage lower than VIL is LOW. (VIL = 0.8V) * for TTL logic which is a particular kind of logic circuit family. C.K. Tse: Digital Electronics: 3 Combinational Logic
  • 4. Logic What can a digital circuit do? The simplest task we can think of is a combinational type of logic decision. For example, we can design a digital electronic circuit to make an instant decision based on some information. Here we emphasize “instant” in the decision making process. That means, the process has no time delay. X = today’s weather is good Y = today is a holiday decision Z = go to picnic Suppose our rule is Z = X and Y X Z The circuit is a simple AND gate. Y This kind of logic, involving no time delay, is combinational logic. C.K. Tse: Digital Electronics: 4 Combinational Logic
  • 5. Truth tables A easy way to represent a combinational logic result is to tabulate all possible inputs. X Y Z X Y Z X Z 0 0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 1 Truth table of AND Truth table of OR Truth table of NOT X X Z Z X Z Y Y X Y Z X Y Z X Y Z 0 0 1 0 0 1 0 0 0 0 1 1 0 1 0 0 1 1 1 0 1 1 0 0 1 0 1 1 1 0 1 1 0 1 1 0 Truth table of NAND Truth table of NOR Truth table of XOR (Exclusive OR) X X X Z Z Z Y Y Y C.K. Tse: Digital Electronics: 5 Combinational Logic
  • 6. Boolean algebra Logic can also be expressed in algebraic form. X Y Z 0 0 0 X 0 1 0 Z = X.Y Y Z 1 0 0 AND gate 1 1 1 Truth table of AND X Y Z X 0 0 1 Y Z 0 1 1 Z = X.Y 1 0 1 X Z Y 1 1 0 Truth table of NAND NAND gate C.K. Tse: Digital Electronics: 6 Combinational Logic
  • 7. Boolean algebra Logic can also be expressed in algebraic form. X Y Z 0 0 0 X 0 1 1 Z = X+Y Y Z 1 0 1 OR gate 1 1 1 Truth table of OR X Y Z X 0 0 1 Y Z 0 1 0 Z = X+Y 1 0 0 X Z Y 1 1 0 Truth table of NOR NOR gate C.K. Tse: Digital Electronics: 7 Combinational Logic
  • 8. Finding expression from truth table Once we have the truth table, we can find the output expression by adding up all min-terms. Min-term corresponds to the product term that give a 1 in the output. For example, here the min-terms are X .Y , X.Y , and X.Y X Y Z The expression for Z is 0 0 0 0 1 1 Z = X .Y + X.Y + X.Y 1 0 1 1 1 1 Question: This is an OR gate! Can it be simplified down to Z = X + Y ? How can we do it? C.K. Tse: Digital Electronics: 8 Combinational Logic
  • 9. More examples X Y Z The expression for Z is 0 0 1 0 1 1 Z = X .Y + X .Y + X.Y 1 0 1 1 1 0 X Y Z The expression for Z is 0 0 1 0 1 0 1 0 0 Z = X .Y 1 1 0 Truth table of NOR Question: These are NAND and NOR gates! Can they be simplified or converted back to the originally derived forms? How can we do it? C.K. Tse: Digital Electronics: 9 Combinational Logic
  • 10. Circuit realization X Z = X .Y + X .Y + X.Y Y Z Note: This is same as a NAND gate (see the truth table), and hence should be the same as X Z Y The question is HOW TO SIMPLIFY A MIN-TERM EXPRESSION! C.K. Tse: Digital Electronics: 10 Combinational Logic
  • 11. Example: binary code to Gray code conversion Binary Gray code What are the expressions for x, y a b c x y z and z? Then, can we design a 0 0 0 0 0 0 circuit to converter binary code 0 0 1 0 0 1 to Gray code? 0 1 0 0 1 1 0 1 1 0 1 0 x = ab c + ab c + abc + abc 1 0 0 1 1 0 1 0 1 1 1 1 y = a bc + a bc + ab c + ab c 1 1 0 1 0 1 z = a b c + a bc + ab c + abc 1 1 1 1 0 0 So, for each of x, y and z, we need a number of inverters, plus 4 AND gates and a multi-input OR gates. C.K. Tse: Digital Electronics: 11 Combinational Logic
  • 12. Boolean algebra simplification Basic Laws: Commutative: X+Y = Y+X X.Y = Y.X Associative: X+Y+Z = (X+Y)+Z = X+(Y+Z) X.Y.Z = (X.Y).Z = X.(Y.Z) Distributive: X.(Y+Z) = X.Y + X.Z De Morgan’s: X+Y = X . Y X.Y = X + Y C.K. Tse: Digital Electronics: 12 Combinational Logic
  • 13. Example: Z = X .Y + X .Y + X.Y = X .(Y + Y ) + X.Y = X .1+ X.Y Y +Y =1 = X + X.Y X .1 = X = (X.(X + Y )) De Morgan’ law = (X.X + X.Y ) Distributive = X.Y X .X = 0 That’s right! It’s a NAND gate! C.K. Tse: Digital Electronics: 13 Combinational Logic
  • 14. Example: Z = X .Y + X.Y + X.Y = (X + X).Y + X.Y = Y + X.Y = Y .(X.Y ) De Morgan’ law = Y .(X + Y ) De Morgan’ law = X .Y + 0 Y .Y = 0 = X .Y = X +Y De Morgan’ law That’s right! It’s a OR gate! C.K. Tse: Digital Electronics: 14 Combinational Logic
  • 15. Boolean algebra can be tedious. Is there any easier method to simplify the min-term expression? C.K. Tse: Digital Electronics: 15 Combinational Logic
  • 16. Karnaugh Maps A very useful design tool for simplifying combinational logic. X Y Z The expression for Z is 0 0 1 0 1 1 Z = X .Y + X .Y + X.Y 1 0 1 1 1 0 Y Y Y Y Y 0 1 0 1 1 X 1 1 X X 1 1 X 1 1 0 X 1 0 X 1 0 X.Y Y Therefore Z = X + Y or Z = X.Y C.K. Tse: Digital Electronics: 16 Combinational Logic
  • 17. Karnaugh map (with 3 inputs) Suppose we have three inputs a, b and c. Output x is Procedure: x = a.b.c + a.b .c + a .b.c + a.b.c 1. Circle clusters of “1”. 2. Determine the logic b 110 b expressions for each cluster. } 011 } bc 3. Add them up. a 00 01 11 10 111 a{ 0 0 0 1 1 ab a{ 1 1 0 1 0 } } } 100 c c c Hence, we get x = a.b.c + b.c + a .b bc abc C.K. Tse: Digital Electronics: 17 Combinational Logic
  • 18. Example: Gray code b b } } bc Binary Gray code a 00 01 11 10 a b c x y z 0 0 0 0 0 0 a{ 0 0 0 1 1 0 0 1 0 0 1 y 0 0 1 1 0 1 0 1 1 0 1 0 a{ 1 1 1 0 0 } } } 1 0 0 1 1 0 1 0 1 1 1 1 c c c 1 1 1 1 0 1 1 0 1 1 0 0 y = ab + a b b b b b } } } } bc bc a a 00 01 11 10 00 01 11 10 a{ 0 0 0 0 0 a{ 0 0 1 0 1 x z a{ 1 1 1 1 1 a{ 1 0 1 0 1 } } } } } } c c c c c c x=a z = b c + bc C.K. Tse: Digital Electronics: 18 Combinational Logic
  • 19. Example: Gray code a Binary b c Gray code x y z x=a 0 0 0 0 0 0 0 0 1 0 0 1 y = ab + a b 0 1 0 0 1 1 0 1 1 0 1 0 0 1 0 1 1 0 z = b c + bc 1 0 1 1 1 1 1 1 0 1 0 1 1 1 1 1 0 0 a x y b c z C.K. Tse: Digital Electronics: 19 Combinational Logic
  • 20. Karnaugh map (with 4 inputs) c c { { cd ab 00 01 11 10 00 }b a { 01 11 } b a { 10 { } }b { d d d C.K. Tse: Digital Electronics: 20 Combinational Logic
  • 21. c c Example { { cd Procedure: ab 00 01 11 10 1. Circle clusters of “1”. 00 1 1 0 0 }b 2. 3. Determine the logic expressions for each cluster. Add them up. a { 01 1 1 1 1 ac 11 1 1 1 1 } b a { 10 0 0 1 1 }b } { { d d d b ac x = a c + b + ac C.K. Tse: Digital Electronics: 21 Combinational Logic
  • 22. Example Derive the circuit for this combinational logic. x = a c + b + ac a c b x C.K. Tse: Digital Electronics: 22 Combinational Logic