csc3011 – discrete structures

Upload: bensonmwamba

Post on 02-Mar-2018

232 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/26/2019 CSC3011 Discrete Structures

    1/41

    CSC3011 Discrete

    StructuresBoolean Algebra

  • 7/26/2019 CSC3011 Discrete Structures

    2/41

    OutlineO Introduction

    O Boolean Functions and expressions

    O Logic Netor!s and "arnaug# $apsO Structure o% Boolean Algebra

    O Application& Se'en seg$ent displa(

  • 7/26/2019 CSC3011 Discrete Structures

    3/41

    IntroductionO Boolean algebra as %or$ulated b(

    )eorge Boole

    O It is an essential tool %or designingnetor!s to sol'e input and outputproble$s

    O It is t#e basic $at#e$atics re*uired

    %or t#e stud( o% t#e logic design o%digital s(ste$s

    O Digital co$puters use to+statede'ices t#at produce to distinctoutput signals

  • 7/26/2019 CSC3011 Discrete Structures

    4/41

    IntroductionO De,nition

    O A Boolean Algebra -B./...0.12 consists o%operations / and on B. a unar( operation on

    B. and speci,ed ele$ents 0 and 1 in B suc#t#at t#e %olloing axio$s %or Boolean algebra#old %or all x. (. and 4 in B

    O Boolean Axio$sO x/( 5 (/x x( 5 (x

    O -x/(24 5 -x4/(42 -x(24 5 x-(42

    O x/-(42 5 -x/(2-x/42 x-(/42 5 x( / x4

    O x/0 5 x x0 5 0

    O x/x 5 1 xx 5 0

  • 7/26/2019 CSC3011 Discrete Structures

    5/41

    Boolean Las %or Set 6#eor(O 78 5 87 7 8 5 8 7

    O -7829 5 7-892 -782 9 5 7 -8 92

    O 7-892 5 -7 82-7 92 7 -8 92 5 -7 82 -7 92

    O 75 7 7: 5 7

    O 7 7 5 : 77 5 O6#e s(ste$ -;-:2. . .. .:2 is an exa$ple o% a

    Boolean Algebra

  • 7/26/2019 CSC3011 Discrete Structures

    6/41

  • 7/26/2019 CSC3011 Discrete Structures

    7/41

  • 7/26/2019 CSC3011 Discrete Structures

    8/41

  • 7/26/2019 CSC3011 Discrete Structures

    9/41

    Boolean AlgebraO6#eore$

    O x( / x( 5 x

    O -x/(2-x/(25x

    O ;roo%

    O x( / x( 5 x-(/(2 5 x1 5 x

    O6#eore$& :ni*ue co$ple$ent la

    O For eac# ele$ent x B. x is t#e uni*ue

    ele$ent in B satis%(ing x/x51 and xx50O ;roo%

    O S#o t#at x/(51 and x(50 i$plies (5x

  • 7/26/2019 CSC3011 Discrete Structures

    10/41

    Boolean AlgebraO ;roo% ctd

    O Let x / ( 5 1 and x(50 t#en

    ( 5 (1

    5(-x / x2

    5(x / (x

    5x( / x(

    50 / x(

    5xx / x(

    5x-x / (2

    5x1

    5x

  • 7/26/2019 CSC3011 Discrete Structures

    11/41

    Boolean AlgebraO6#eore$& In'olution Las

    O -x2 5 x

    O 150 and 051O ;roo%

    O

  • 7/26/2019 CSC3011 Discrete Structures

    12/41

    Boolean AlgebraO ;roo% ctd

    x( /-x / (2 5 -x( / x2 / (

    5 -x / x(2 / ( 5-x / x2-x / (2 / (

    51-x / (2 / (

    5x / -( / (2

    5x / 1 5 1 51

    So -x / (2 5 -x(2

  • 7/26/2019 CSC3011 Discrete Structures

    13/41

    Boolean FunctionsO De,nition& Boolean Function

    O Let =0. 1>ndenote t#e set o% all n+tuples o% 0sand 1s A Boolean Function is a %unction o% n

    'ariables %&=0.1>n=0.1> #ere n1O ie

    O %-x1.x..xn2 5 0 or

    O %-x1.x..xn2 5 1 %or an( Boolean %unction %

    O =0.1> de,ned

    b(O %-02 5 1 and %-12 5 0 % can be represented as

  • 7/26/2019 CSC3011 Discrete Structures

    14/41

    Boolean FunctionO Boolean %unctions are usuall(

    represented b( tables called trut#

    tablesO A trut# table speci,es t#e 'alues o% a

    Boolean %unction %or e'er( possibleco$bination o% 'alues in =0.1> o% t#e'ariables

    O 3=0.1> de,ned b( g-1.0.125 g-1.1.12 5 1 and g is 0 ot#erise

  • 7/26/2019 CSC3011 Discrete Structures

    15/41

    Boolean Functions

    I Find Card-B2 and Card-B32II Find t#e nu$ber o% Boolean %unctions %ro$ B3

    to B

  • 7/26/2019 CSC3011 Discrete Structures

    16/41

    Boolean

  • 7/26/2019 CSC3011 Discrete Structures

    17/41

    Boolean

  • 7/26/2019 CSC3011 Discrete Structures

    18/41

    Boolean

  • 7/26/2019 CSC3011 Discrete Structures

    19/41

    Boolean

  • 7/26/2019 CSC3011 Discrete Structures

    20/41

    Boolean nto =0. 1> b( %or$ula%-x1..xn2 5 0 %or all -x1..xn2 =0.1>n

    O 1 de,nes t#e constant Boolean %unction%ro$ =0. 1>nto =0. 1> b( %or$ula%-x1..xn2 5 1 %or all -x1..xn2 =0.1>n

    O Boolean expression in $ 'ariables cande,ne a Boolean %unction %& =0. 1>n=0.1> %or n$

  • 7/26/2019 CSC3011 Discrete Structures

    21/41

    Boolean

  • 7/26/2019 CSC3011 Discrete Structures

    22/41

    Boolean

  • 7/26/2019 CSC3011 Discrete Structures

    23/41

    Boolean

  • 7/26/2019 CSC3011 Discrete Structures

    24/41

    Boolean

  • 7/26/2019 CSC3011 Discrete Structures

    25/41

    Booleans

  • 7/26/2019 CSC3011 Discrete Structures

    26/41

    Boolean

  • 7/26/2019 CSC3011 Discrete Structures

    27/41

    Boolean

  • 7/26/2019 CSC3011 Discrete Structures

    28/41

    Logic netor!sO De,nition

    O A logic gate is a binar( electronicde'ice it# one or $ore input signalsto produce one output signal

    O6#ere are t#ree basic logic gatescalled t#e OH gate. t#e AND gate.and t#e NO6 gate -in'erter2

  • 7/26/2019 CSC3011 Discrete Structures

    29/41

    Logic Netor!sO6#e AND

    gate

    O6#e OH gate

    O6#e NO6

    gate

  • 7/26/2019 CSC3011 Discrete Structures

    30/41

    Logic Netor!sO6#e OH gate represents t#e Boolean

    addition in =0.1>O

    6#e output o% t#e OH gate is 1 i% oneor bot# input 'alues are 1 it is 0ot#erise

    O6#e AND gate represents Boolean$ultiplication in =0.1>O6#e output o% t#e AND gate is 1 i% and

    onl( #en bot# input 'alues are 1 itis 0 ot#erise

  • 7/26/2019 CSC3011 Discrete Structures

    31/41

    Logic Netor!sO A logic netor! -also called

    sitc#ing. gating. co$binatorialnetor! or logic circuit etc2 is so$eco$bination o% t#e OH. AND and NO6gates

    O E#en e use single 'ariables %orinputs. t#e output o% t#e logic

    netor! is represented b( a Booleanexpression o% t#e input 'ariables

    O

  • 7/26/2019 CSC3011 Discrete Structures

    32/41

    Logic Netor!sO6#e logic netor!s in t#e exa$ple

    de,ne t#e sa$e Boolean %unction %&=0.1>=0.1>

    O E#en to output Booleanexpressions are e*ui'alent. e sa(t#at t#e to corresponding logicnetor!s are e*ui'alent. and 'ice

    'ersa

    O )i'en a logic netor!. it is possibleto deri'e t#e Boolean expression itde,nes

  • 7/26/2019 CSC3011 Discrete Structures

    33/41

    Logic Netor!sO

  • 7/26/2019 CSC3011 Discrete Structures

    34/41

    Logic Netor!sO Since e'er( Boolean expression

    de,nes a Boolean %unction. e'er(Logic netor! also de,nes a Boolean%unction

    O Alt#oug# $an( e*ui'alent Booleanexpressions -#ence. logic netor!s2can correspond to t#e sa$e Boolean

    %unction g. t#eres onl( one standardsu$ o% products %or$ t#atcorresponds to g

  • 7/26/2019 CSC3011 Discrete Structures

    35/41

    Logic Netor!sO

  • 7/26/2019 CSC3011 Discrete Structures

    36/41

    Logic Netor!sO Soln

    O De,ne 'aribles x and ( de,ned

    Ox %or $aster not ansering t#etelep#one a%ter rings

    O ( %or t#e sitc# being on

    O Ee ant t#e robot to anser i% andonl( i% ( 5 1 or -(50 and x512

    O %-x.(2 5 ( / (x

  • 7/26/2019 CSC3011 Discrete Structures

    37/41

    Logic Netor!sO6#e #al%+adder netor! #as to

    output. s and c as described in t#etableO s is t#e binar( su$ o% t#e to inputs

    O c is t#e carr( resulting #en to inputdigits are added

    O s 5 x(/x(

    O c 5 x(

  • 7/26/2019 CSC3011 Discrete Structures

    38/41

    Logic Netor!sO6#e designing o% logic netor!s can

    be 'ieed as a t#ree+step process&O

    Speci%( t#e input and output tas! it#a Boolean %unction %

    O Find t#e Boolean expression

  • 7/26/2019 CSC3011 Discrete Structures

    39/41

    Logic Netor!sO De,nition

    O A $ini$al su$ o% products F %or a Booleanexpression < #as t#e %olloing properties

    O F 5