Introduction to Electricl & Electronic Engineering ENGG23 2 nd Semester, 27-8 Dr. Hden Kwok-H So Deprtment of Electricl nd Electronic Engineering Astrction DIGITAL LOGIC 2 Digitl Astrction n Astrct ll signls s TWO discrete vlues Usull denoted TRUE, FALSE, high, low,, We use TRUE, high, snonmousl n The vlue TRUE does not necessril correspond to high phsicl voltge We cn define TRUE nw we wnt s long s it does not overlp with tht of FALSE More in lter lectures n An exmple of strcting low-level detils using well-defined interfce Digitl Astrction - Benefits n Allows es logic mnipultion in the sstem n Binr sstem cn e effectivel nlzed with lger Provides mthemticl sis for modeling the ehvior of the sstem n Fcilitte es uilding of lrge sstem using hierrch n Isolte ll low level detils of electricl signl so engineers cn focus on high-level sstem design issues. E.g. How to count to 3? Wht is the est w to perform smile detection? 3 4
The Primitives Logic Gtes n Logic Gtes: Bsic opertions on inr digitl signls n A simple gte tkes or 2 digitl input nd output single output Complex gtes m tke > 2 inputs, output n Common gtes: NOT, AND, OR sic opertors NAND, NOR, XOR, XNOR comintion AND Gte = expression n The output of n AND gte is HIGH onl when ll inputs re HIGH. n The AND opertion is performed similr to n ordinr multipliction in liner lger Assuming vlues cn e onl of s nd s. Nottion in expression is lso the sme 5 6 OR Gte = + NOT Gte = expression n The output of n OR gte is HIGH if nd onl if one or more inputs re HIGH n The onl cse when the output is LOW is when ll inputs re LOW n nottion is + n NOTE tht it is somewht different from humn s norml lnguge of or John will either go to ed or go to ookstore n The output of NOT gte is lws the complement (opposite) of the input. n Tkes one input nd output its complement è, è n The r nottion in expression denotes NOT opertion 7 8
Other Simple Gtes n All logic functions, no mtter how complex, cn e completel expressed using the 3 sic opertions AND, OR, NOT. NAND, NOR = n However, mn sstems utilize more thn just the 3 sic logic gtes ecuse it mkes the design clener nd esier to understnd (for humn). ule = not = + n The complement of AND nd OR gte n Note the ule equivlent to NOT gte 9 XOR Gte = n The output of n XOR gte is HIGH if nd onl if exctl one input is HIGH n Similr to norml OR gte except in the cse when oth inputs re HIGH Quick Quiz AND OR XOR NAND NOR XNOR 2
the lser is turned on onl fter 3 lls hve pssed through the tunnel AND to cr hs reched the ottom of rmp the lser is turned on onl fter 3 lls hve pssed through the tunnel AND to cr hs reched the ottom of rmp Cr t Rmp Cr t Rmp Bll Rolls Pst Sensor Process 3 times? Output Turns on Lser Bll Rolls Pst Sensor Process 3 times? Output Turns on Lser A sstem tht output TRUE when oth inputs re TRUE A sstem tht output TRUE when oth inputs re TRUE: AND gte 3 4 the lser is turned on onl fter 3 lls hve pssed through the tunnel OR to cr hs reched the ottom of rmp the lser is turned on onl fter 3 lls hve pssed through the tunnel AND to cr hs reched the ottom of rmp ut NOT when the moon is round AND right Cr t Rmp Cr t Rmp Bll Rolls Pst Sensor Process 3 times? Output Turns on Lser Bll Rolls Pst Sensor Process 3 times? Output Turns on Lser A sstem tht output TRUE when either one of the inputs is TRUE: OR gte moon is round moon is right 5 6
Comintionl Functions n Lrge, complex functions cn e composed using simpler functions n A function is comintionl if ll of the following conditions re met: All enclosing functions re comintionl There is no loop in the connection of function is connected onl to ONE output of nother function n A simple logic gte is comintionl Quick Quiz n Which of the following is comintionl function? 2 c 3 4 CL CL 7 8 3 Representtions of Logic Functions n Recll tht n complex logic function cn e expressed in 3 ws:,, n Onl representtion is unique n We cn convert representtion from one form to the other to 9 2
to Exmple 2 n Strightforwrd conversion: lel ll inputs 2 repet until ll nodes leled: 3 forll gtes G with ll input leled: 4 compute nd lel output of G n Exmple: Determine the expression of the following circuit: A B C AB AB + C n Determine the expression of the following circuit: A B A B A A + B A + B A + B Note the r is over the entire expression 2 22 Exmple 3 n Determine the expression of the following circuit: A B A + B C A + (A + B)C BC Precedence n Determines the order of evlution of expression n Order: Opertion Precedence ( ) Highest NOT AND OR Lowest The order of opertion must e preserved. n A r over n expression cn e viewed s one with (), therefore, () tke precedence n E.g. + = ( + ) ( + ) first, then inverse 23 24
Quick Quiz n Wht is the output expression of the following logic-circuit digrm? to 2 3 4 x = ABC ( A + D) x= ABCD x = ABC ( A + D) x= ABCD 25 26 to n Exmple: drw the circuit for = AC + BC + ABC n Done in two steps to 27 28
à n List ll comintions tht give t output n Ech row contriutes to minterm n Sum up ll terms n Sum of products (SOP) to ABC ABC x = ABC + ABC + ABC ABC Schemti 29 cs 3 x = ABC + ABC + A B C X ABC 3 n Convert into stndrd cnonicl SOP form n put in ech row tht corresponds to the minterm to (nd vice vers) through We lerned how to convert representtion from one form to the other 32
n Otin expression from the circuit (in SOP form) nd write the truth tle = AC + BC + ABC AC = ABC + ABC BC = ABC + ABC A B C Cnonicl Form n expression cn e expressed in mn different ws (A + D)(B + C) AB + AC + BD + CD n Two stndrd ws of orgnizing the terms: Sum of Product (SOP) Product of Sum (POS) n A cnonicl form puts rules to llows unique representtion of expression E.g. sort the minterms ccording to order of input signl (write AB, not BA) 33 Schemti 34 cs Cnonicl SOP n expression expressed s sum of product of sic inputs Bsic input m optionll negted Cnonicl POS n expression expressed s product of sum of sic inputs Bsic input m optionll negted AB C + BD + AD (A + B + C)(B + D )(A + D) n E.g. Product A + B(C + D) No prentheses n Ver nturl for humn Sum is not NOT cnonicl: Product Sum n E.g. This is not in cnonicl POS form: A + B(C + D) n Not too nturl for humn, ut equll good for computers. Schemti 35 cs Schemti 36 cs
n n SOP or POS? SOP S = ABC+ ABC Wht out? 2 3 4 ABC + ABC A+ ( B+ C)( B+ C) ( A+ B+ C) ( A+ B+ C) ( A+ B+ C) ( A+ B+ C) A B C S A B C S Hierrch n The grouping of circuit components into sucircuit forms design hierrch Implementtion detils of su-lock is strcted w from the enclosing lock n Ech lock m correspond to suexpression in the expression n Common su-expression m e grouped s function The rguments to function re the inputs The return vlue is the output 37 38 Exmple Forming Hierrch c d = ( + c)(c + d) c F BOOLEAN ALGEBRA d F = F(,,c) F(c,, d) 39 4
Axioms of Alger n The Dul of the Axiom Axiom Tle from DDCA p.57 Replce with +, replce with, nd the xiom still holds true 4 Theorems of one vrile n If oth sides of the eqution results in the sme TT, the must e the sme. 42 Theorems of multiple vriles Prove either vi lgeric mnipultions, or to use 43 B C BC B+BC To Prove: T9 B + BC = B 44
Exmple n Simplif the following expression: = BAD + DAB = ABD + ABD = AB( D + D) = AB = AB n More exmples in the tutoril Originl: 3 inputs, 2 AND gtes, 2 NOT gtes, OR gte Simplified: 2 inputs, AND gte, not gte Quick Quiz n Simplif the following expression: 2 3 4 AB A AB B z = ( A + B) ( A + B) z = AA + AB + BA + BB = + AB + BA + B = AB + BA + B = BA ( + A+ ) = B = B 45 46 DeMorgn s Theorems n Theorem Inversion of Sum = Product of Inversion n Theorem 2 x+ = x x = x+ Inversion of Product = Sum of Inversion n Brek the r, chnge the opertor n It llows ANDs to e exchnged with ORs using invertors Quick Quiz n Simplif AC + 2 3 4 AC AC n Simplif AC 2 AC 3 AC 4 AC BC + BC + BC AC + BC + BD + BD + BD + BD ( AB + C) ( A+ C) ( B+ D) 47 48
Bule Pushing in x+ = x DeMorgn s Theorem llows us to push ules cross gtes to eliminte unnecessr inversions x = x+ And in conclusion n All electronic/electricl sstems cn e divided into three min su-sstems: input, process, output n Digitl Logic is powerful strction ler for uilding lrge sstems Onl 2 vlues: TRUE nd FALSE Opertes with logic n Logic gtes re primitives of of the digitl logic strction n, nd re 3 different ws to represent the sme functionlit Conversion etween the 3 is reltivel stright-forwrd TT is the onl representtion tht is unique Fll Spring 24 28 49 5