lec03zczc

Upload: pecmurugan

Post on 03-Jun-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Lec03zczc

    1/26

    OperationsinNumberSystem&

    BooleanAlgebraDr.A.Sahu

    De t of Com . Sc. & En .

    IndianInstituteofTechnologyGuwahati

    1

  • 8/12/2019 Lec03zczc

    2/26

    NumberSystem&Conversion

    Decimal,

    Binary,

    Octal,

    Hex Otherrepresentation: Signed,Complement

    OperationsinNumberSystem

    , u , u , v, o

    Howtohandlerealnumberefficientl Float,Double

    oo ean ge ra: a es eorem2

  • 8/12/2019 Lec03zczc

    3/26

    Addition

    Subtraction

    Division

    Modulus

    3

  • 8/12/2019 Lec03zczc

    4/26

    0nebit

    0

    + 0=

    01 + 0= 1

    0 + 1= 1

    1

    + 1=

    01

    (Carrybit)

    u cons ercarry

    1 1 0 1

    = 1 0 1 1

  • 8/12/2019 Lec03zczc

    5/26

    0nebit

    0

    0=

    01 0= 1

    0 1= 1 1 (Carrybit)

    1

    1=

    0

    Multibit (considercarry)

    1 1 1 0

    1

    0 0

    1

    = 0 1 0 1

  • 8/12/2019 Lec03zczc

    6/26

    BinarySubtraction Multibit (considercarry)

    1 1 1 0

    1

    0 0

    1

    = 0 1 0 1

    add2s

    com lement=

    (1001)+1=

    0110+1=0111

    Otherway (add2scomplement&discardcarry)

    1 1 1 0

    + 0 1 1 1= 1 0 1 0 1

  • 8/12/2019 Lec03zczc

    7/26

  • 8/12/2019 Lec03zczc

    8/26

  • 8/12/2019 Lec03zczc

    9/26

  • 8/12/2019 Lec03zczc

    10/26

    ,

    Oct:Add,

    Sub,

    Multiplication,

    Division

    &

    Mod

    Rea yourse

    10

  • 8/12/2019 Lec03zczc

    11/26

    Floatingformat:

    2.03455x103

    7 .

    Realnumbersmustbenormalizedusing

    0.12n wherenisaninteger

    andthemostsignificantdigitofthefractionisa 1 ALWAYS!

  • 8/12/2019 Lec03zczc

    12/26

    complex

    rational

    5/8 real

    rea 3

    complex

    2

    3i

    rational

    inte er

    Extremelylargeandsmallvalues:

    distanceplutosun=5.91012 m

    28 .

  • 8/12/2019 Lec03zczc

    13/26

    5 8 =5/8

    r ngsw exp c ec ma po n

    2 4 7 . 0 9 Implicitpointatafixedposition

    010011010110001011

    Floatingpoint

    fraction x base power

    implicitpoint

  • 8/12/2019 Lec03zczc

    14/26

    = 2 1 0 1 2. .

    =4+1+.+

    0.5

    +0.25

    =5.7510

    0.6=0.10011001100110011001.....

    .6x2=1+.2

    .2x2=0+.4

    =. .

    .8x2=1+.6

  • 8/12/2019 Lec03zczc

    15/26

    1

    8

    23

    S E F

    1 11 20+32

    110101101011000101100

    S E F

    10110001011011001011010111010110

  • 8/12/2019 Lec03zczc

    16/26

    ,

    Makesame

    power,

    operate,

    normalize

    . .

    2x106 3X104 =2x106 0.03x106 =1.97x106

    u , v

    Dooperation,normalize

    2.0x106 x3.0x103 =

    2x3

    x10

    (6+3) =6.0x109

    2x106 3x103 = 2/3x10(63) =0.666x103 =6.66x102

    16

  • 8/12/2019 Lec03zczc

    17/26

    BooleanAlgebra

    Computer hardware using binary circuit

    grea y s mp y es gn

    Binary circuits: To have a conceptual

    framework to manipulate the circuits

    George Boole (1813-1864): developed a

    ma ema ca s ruc ureTo deal with binary operations with just two

    values.

  • 8/12/2019 Lec03zczc

    18/26

    Element 0 : FALSE. Element 1 : TRUE.

    + operation OR,* operation AND and operation NOT.

    OROR 00 11 ANDAND 00 11 NOTNOT

    00 00 11 00 00 00 00 11

    18

    11 11 11 11 00 11 11 00

  • 8/12/2019 Lec03zczc

    19/26

    + operation OR

    X Y R=XORY=

    0 0 0X

    Y

    R=X+Y

    0 1 1

    1 0 1

    00 00 11 1 1 1

    19

    11 11 11

    1+

    Y

    =

    1

  • 8/12/2019 Lec03zczc

    20/26

    * operation AND

    X Y R=XAND

    Y

    R=X*Y0 0 0

    X

    Y

    R=X*Y

    1 0 0ANDAND 00 11

    1 1 100 00 00

    20

    11 00 11

    0*Y=0

  • 8/12/2019 Lec03zczc

    21/26

    operation NOT

    X R=X=

    0 1XR=X

    1 0

    21

  • 8/12/2019 Lec03zczc

    22/26

    BooleanAlgebraDefined

    Boolean Algebra B : 5-tuple, +, , , ,

    nary ,

    u .

  • 8/12/2019 Lec03zczc

    23/26

    BooleanAlgebraDefined Axiom #1: Closure

    (a + b) and (a * b) are Boolean.

    Axiom #2: Cardinality

    if a is Boolean then a is Boolean

    (a + b) = (b + a)

    (a * b) = (b * a)

  • 8/12/2019 Lec03zczc

    24/26

    BooleanAlgebraDefined x om : ssoc at ve : a an are oo ean

    a + b + c = a + b + c

    (a * b) * c = a * (b * c)

    Axiom #6: Distributive

    a * (b + c) = (a * b) + (a * c)

    * *2nd oneisNotTrueforDecimalnumbersSystem

  • 8/12/2019 Lec03zczc

    25/26

    B has identity to + and *

    0 is identity element for + : a + = a

    * * =

    a + a' = 1

    a * a' = 0

  • 8/12/2019 Lec03zczc

    26/26

    Thanks

    26