Number Systems.pptx

Embed Size (px)

Citation preview

  • 8/20/2019 Number Systems.pptx

    1/52

    Number Systems

  • 8/20/2019 Number Systems.pptx

    2/52

    Common Number Systems

     System Base Symbols

    Used byhumans?

    Used in PLC?

    Decimal 10 0, 1, … 9 Yes No

    Binary 2 0, 1 No Yes

    Octal 8 0, 1, … 7 No No

    Hea!

    "ecimal

    1# 0, 1, … 9,

    $, B, … %

     No No

  • 8/20/2019 Number Systems.pptx

    3/52

    &uantities'Countin( )1 o* +

     Decimal Binary Octal Hexa-decimal 

    0 0 0 0

    1 1 1 1

    2 10 2 2

    + 11 + +

    - 100 - -

    . 101 . .# 110 # #

    7 111 7 7

  • 8/20/2019 Number Systems.pptx

    4/52

    &uantities'Countin( )2 o* +

     Decimal Binary Octal Hexa-decimal 

    8 1000 10 8

    9 1001 11 9

    10 1010 12 $

    11 1011 1+ B

    12 1100 1- C

    1+ 1101 1. D1- 1110 1# /

    1. 1111 17 %

  • 8/20/2019 Number Systems.pptx

    5/52

    &uantities'Countin( )+ o* +

     Decimal Binary Octal Hexa-decimal 

    1# 10000 20 10

    17 10001 21 11

    18 10010 22 12

    19 10011 2+ 1+

    20 10100 2- 1-

    21 10101 2. 1.22 10110 2# 1#

    2+ 10111 27 17

    /tc

  • 8/20/2019 Number Systems.pptx

    6/52

    Conersion $mon( Bases

    • 3e 4ossibilities5

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    7/52

    Conersion $mon( Bases

    • 3e 4ossibilities5

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    8/52

    Binary to Decimal

    • ec3ni6ue – ulti4ly eac3 bit by 2n, 3ere n is t3e ei(3t:

    o* t3e bit

     –

    3e ei(3t is t3e 4osition o* t3e bit, startin(*rom 0 on t3e ri(3t

     – $"" t3e results

  • 8/20/2019 Number Systems.pptx

    9/52

    /am4le

    1010112 => 1 x 20 = 1

    1 x 21 = 2

    0 x 22 = 0

    1 x 23 = 8

    0 x 24 = 0

    1 x 25 = 32

    4310

    Bit 0:

  • 8/20/2019 Number Systems.pptx

    10/52

    Octal to Decimal

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    11/52

    Octal to Decimal

    •ec3ni6ue – ulti4ly eac3 bit by 8n, 3ere n is t3e ei(3t:

    o* t3e bit

     –

    3e ei(3t is t3e 4osition o* t3e bit, startin(*rom 0 on t3e ri(3t

     – $"" t3e results

  • 8/20/2019 Number Systems.pptx

    12/52

    /am4le

    7248 => 4 x 80 = 4

    2 x 81 = 16

    7 x 82 = 448

    46810

    Bit 0:

  • 8/20/2019 Number Systems.pptx

    13/52

    Hea"ecimal to Decimal

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    14/52

    Hea"ecimal to Decimal

    •ec3ni6ue – ulti4ly eac3 bit by 1#n, 3ere n is t3e

    ei(3t: o* t3e bit

     –

    3e ei(3t is t3e 4osition o* t3e bit, startin(*rom 0 on t3e ri(3t

     – $"" t3e results

  • 8/20/2019 Number Systems.pptx

    15/52

    /am4le

     ABC16 =>C x 160 = 12 x 1 = 12

      B x 161 = 11 x 16 = 176

      A x 162 = 10 x 256 = 2560

      274810

  • 8/20/2019 Number Systems.pptx

    16/52

    Decimal to Binary

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    17/52

    Decimal to Binary

    •ec3ni6ue – Dii"e by to, ;ee4 trac; o* t3e remain"er 

     – %irst remain"er is bit 0 )

  • 8/20/2019 Number Systems.pptx

    18/52

    /am4le

    12510 = ?2 2 125  62 12

    31 02

    15 12

    7 12

    3 12

    1 12

    0 1

    12510 = 1111101

    2

  • 8/20/2019 Number Systems.pptx

    19/52

    Octal to Binary

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    20/52

    Octal to Binary

    •ec3ni6ue – Conert eac3 octal "i(it to a +!bit e6uialent

     binary re4resentation

  • 8/20/2019 Number Systems.pptx

    21/52

    /am4le

    7058 = ?2

     7 0 5

    111 000 101

    7058 = 111000101

    2

  • 8/20/2019 Number Systems.pptx

    22/52

    Hea"ecimal to Binary

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    23/52

    Hea"ecimal to Binary

    •ec3ni6ue – Conert eac3 3ea"ecimal "i(it to a -!bit

    e6uialent binary re4resentation

  • 8/20/2019 Number Systems.pptx

    24/52

    /am4le

    10AF16 = ?2

     1 0 A F

    0001 0000 1010 1111

    10AF16 = 0001000010101111

    2

  • 8/20/2019 Number Systems.pptx

    25/52

    Decimal to Octal

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    26/52

    Decimal to Octal

    •ec3ni6ue – Dii"e by 8

     – =ee4 trac; o* t3e remain"er 

  • 8/20/2019 Number Systems.pptx

    27/52

    /am4le

    123410 = ?8

    8 1234

      154 28

      19 28

      2 38

      0 2

    123410 = 2322

    8

  • 8/20/2019 Number Systems.pptx

    28/52

    Decimal to Hea"ecimal

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    29/52

    Decimal to Hea"ecimal

    •ec3ni6ue – Dii"e by 1#

     – =ee4 trac; o* t3e remain"er 

  • 8/20/2019 Number Systems.pptx

    30/52

    /am4le

    123410 = ?16

    123410 = 4D2

    16

    16 1234

      77 216

      4 13 = D16

      0 4

  • 8/20/2019 Number Systems.pptx

    31/52

    Binary to Octal

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    32/52

    Binary to Octal

    •ec3ni6ue – >rou4 bits in t3rees, startin( on ri(3t

     – Conert to octal "i(its

  • 8/20/2019 Number Systems.pptx

    33/52

    /am4le

    10110101112 = ?8

    1 011 010 111

    1 3 2 7 

    10110101112 = 1327

    8

  • 8/20/2019 Number Systems.pptx

    34/52

    Binary to Hea"ecimal

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    35/52

    Binary to Hea"ecimal

    •ec3ni6ue – >rou4 bits in *ours, startin( on ri(3t

     – Conert to 3ea"ecimal "i(its

  • 8/20/2019 Number Systems.pptx

    36/52

    /am4le

    10101110112 = ?16

    10 1011 1011

    2 B B 

    10101110112 = 2BB

    16

  • 8/20/2019 Number Systems.pptx

    37/52

    Octal to Hea"ecimal

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    38/52

    Octal to Hea"ecimal

    ec3ni6ue – ?se binary as an interme"iary

  • 8/20/2019 Number Systems.pptx

    39/52

    /am4le

    10768 = ?16

     1 0 7 6

    001 000 111 110

    2 3 E

    10768 = 23E

    16

  • 8/20/2019 Number Systems.pptx

    40/52

    Hea"ecimal to Octal

    Hea"ecimal

    Decimal Octal

    Binary

  • 8/20/2019 Number Systems.pptx

    41/52

    Hea"ecimal to Octal

    ec3ni6ue – ?se binary as an interme"iary

  • 8/20/2019 Number Systems.pptx

    42/52

    /am4le

    1F0C16 = ?8

      1 F 0 C

    0001 1111 0000 1100

    1 7 4 1 4

    1F0C16 = 17414

    8

  • 8/20/2019 Number Systems.pptx

    43/52

    Binary $""ition )1 o* 2

    o 1!bit alues

     44 +#!+8

    $ B $ @ B

    0 0 00 1 1

    1 0 1

    1 1 10to:

  • 8/20/2019 Number Systems.pptx

    44/52

    Binary $""ition )2 o* 2

    o n!bit alues – $"" in"ii"ual bits

     – Aro4a(ate carries

     –

    /(,

      10101 21

    + 11001 + 25

     101110 46

    11

  • 8/20/2019 Number Systems.pptx

    45/52

    ulti4lication )1 o* +

    Decimal )ust *or *un

      35

    x 105  175

     000

     35

     3675

    l i li i ) *

  • 8/20/2019 Number Systems.pptx

    46/52

    ulti4lication )2 o* +

    Binary, to 1!bit alues

    $ B $ × B

    0 0 0

    0 1 0

    1 0 0

    1 1 1

    l i li i )+ * +

  • 8/20/2019 Number Systems.pptx

    47/52

    ulti4lication )+ o* +

    Binary, to n!bit alues – $s it3 "ecimal alues

     – /(,

    1110

      x 1011

      1110

      1110

      0000 1110

    10011010

    % i

  • 8/20/2019 Number Systems.pptx

    48/52

    %ractions

    Binary to "ecimal

    10.1011 => 1 x 2-4 = 0.0625

    1 x 2-3 = 0.125

    0 x 2-2 = 0.0

    1 x 2-1 = 0.5

    0 x 20 = 0.0

    1 x 21 = 2.0

      2.6875

    % i

  • 8/20/2019 Number Systems.pptx

    49/52

    %ractions

    Decimal to binary

    3.14579

     .14579

    x 2

    0.29158

    x 2

    0.58316

    x 2

    1.16632

    x 2

    0.33264

    x 2

    0.66528

    x 2

    1.33056

    etc.11.001001...

    / i C

  • 8/20/2019 Number Systems.pptx

    50/52

    /ercise Conert

    Dont use a calculatorE

    Decimal Binary Octal

    Hea!"ecimal

    298

    1011101

    +07

    C82

    S;i4 anser  $nser 

    / i C

  • 8/20/2019 Number Systems.pptx

    51/52

    /ercise Conert …

    Decimal Binary Octal

    Hea!"ecimal

    298 11101110011… +.#+… 1DCC…

    .812. 1011101 .#- .D

    +109+7. 11000111 +07 +1C

    12.07812. 110010000010 1--0- C82

    $nser 

  • 8/20/2019 Number Systems.pptx

    52/52

    Thank you