SlideShare uma empresa Scribd logo
1 de 36
Sistem Bilangan

   Oleh :
   Moch Nur Purnama
Analogue vs Digital

  Analogue

   * Continuous range of value
   * Precision limited by Noise
  Digital

   * Discrete range of values
   * Precision limited by number of “Bit”
Analogue vs Digital




    Analogue          Digital
Analogue vs Digital

  The   real world is analogue ( by because
   all signal in world be shape analogue)
  But in controlling, Digital one had using
   for process.
  Both of signal had been converter each
   other
Analoge vs Digital


                                  Digital           D to A        Analogue
  Analogue         A to D       Processing




    Why Digital Only by using in Processing?
    ^ Adventure in integrated Circuit has made the complex processing of
      digital data.
    ^ Digital Control processing has made easier than analogue
    ^ Digital circuits are inherently more noise resistant
Digital and Boolean

  Digital represented by boolean logic
  Boolean is the name of mathematician’s
   expert
  Now boolean is called by conventional
   logic because there is new logic that
   called by fuzzy logic
  But all electronic still using boolean logic
   to processing the controlling system
Why Boolean
    It is convenient in electrical system to use a two-value
     system to represent value true/false, on/off, yes/no
     and 1/0
     * Two voltage or current levels can be used
     * Easier to process and distribute reliably
     (diandalakan)
     * Don’t think of them as numbers (even though we
     often represent them as 0/1 for brevity(ketangkasan))
    The need for binary numbers
     * Multi-value quantities need to be represented in the
     digital system. Therefore need numbers made up from
     the simple two value system
Positional Number System
    Decimal point
                                            7x10-1
                                            7x10-2
                                            8x10-3

                       3578.778


                                            8 x 100
                                            7 x 101
      Base 10, weigthing are powers of 10   5 x 102
                                            3 x 103
Unsigned binary numbers
     Binary point
                                                1 x 2-1 = 0.500
                                                0 x 2-2 = 0.000
                                                1 x 2-3 = 0.125

                         1100.101
   Each bit of the
   Number may be
   Representaed by
   A Boolean value                               0 x 20= 0.000
                                                 0 x 21= 0.000
                                                 1 x 22= 4.000
               Binary, weightings are powers of 21 x 2 = 8.000
                                                      3
Multi-precision Arithmatic

 Additional of A and B


                      A1                       B1



                      A2                       B2

                                                        +

                      A2                           B3

     Carry                         Carry
      Flag    Carry        Carry
                                    Flag   Carry
               Out          In
                                            Out
Multi-precision Arithmatic
                       Carry
               Carry    Flag   Carry
                Out             In



          A1                       B1



          A2                       B2

                                            -

          A2                           B3
Hexadecimal Numbers
                           660                0    0
                 4                   : 16     1    1
                                              2    2
                           41                 3    3
                 9                   : 16
                                              4    4
                          2                   5    5
                                              6    6
 Hexadecimal :       294 Hex                  7    7
                                              8    8
                               215            9    9
                     13                : 16   10   A
                                              11   B
                                7
                                              12   C
                                              13   D
                                              14   E
  Hexadecimal :       7D Hex
                                              15   F
Hexadecimal Numbers
                           0   0000
 660     0010 1001 0100    1   0001
                           2   0010
                           3   0011
                           4   0100
          2     9    4     5   0101
                           6   0110
                           7   0111
                           8   1000
 215      0000 1101 0111   9   1001
                           A   1010
                           B   1011
                           C   1100
          0     D    7     D   1101
                           E   1110
                           F   1111
Decimal to Binary
 Number =   36.37                        Generetee each digit by successive division
            5                            Or multiplication.
 Base =     2

                                         There is no guarantee the fraction will be
 Decimal    Binary   Converter Number    finite
 Number     Digits
     0          0     0100100.0110
    0.5         1      0100100.011       Fractional part – Multiplication by base
    0.75        1      0100100.01
   0.375        0       0100100.0
     36         0        0100100
     18         0        010010
     9          1         01001
                                        Whole part – divition by base
     4          0         0100
     2          0          010
     1          1          01
     0          0           0
Binary Additional


            0 + 0 = 0
            0 + 1 = 1
            1 + 0 = 1
             1 + 1 = 0 carry 1

     Easy Layaou ?
Binary Addition
  190 + 141 =331
                                       Carry out of
                                       Each column
                 1    1 1 1 1

                 1 0 1 1 1 1 1 0
                 1 0 0 0 1 1 0 1

                 1   0 1 0 0 1 0 1 1



  Carry out of
  8-bit number
Binary Subtraction
                            A borrow-out of 1 from
                            This column becomes a borrow in
  229 – 46 = 183                    of 2 in this column

                        2   2   2 2     2
               1   1    1   0   0   1   0    1                Borrow in from
                                                              Left column
               0   0    1   0   1   1    1   0

                   1    1   1   1   1
                                                              Borrow out
               1    0   1   1   0   1   1    1



                   Both rows subtracted
Exercise

  Convert  to 8-bit binary and do the
   arithmetic operation
   * 120 + 54          * 110 + 100
   * 224 – 134         * 200 + 20
   * 112 – 89          * 111 – 25
  Convert back to decimal and check the
   result
Binary Number Circle
 In real hardware there is a fixed number
 Of bits available. We often ignore leading zeros
 But they are still there!

 Examlpe :
 If we only use 4 bits then the binary
 Counting sequence “wraps around”
 At 15 ↔ 0
                                                       4 – bit
                                                       Binary
 11 - 1 = 10
                                                    Number Circle

11        1110
-1           1

     10     1010
Binary Number Circle
 Subtracting across the boundary
 Still “works” if you think of result
 As the distance on the number
 Circle.

   (Module arithmetic – ignore
   The borrow /carry)

                                           4 – bit
    8          1000                        Binary
 - 14        - 1110                     Number Circle

        10      (-1)1010
Representing –ve Number

  Several choices for natation
  * sign + magnitude notation
  * 1’s complement
  * 2’s complement notation
  * various ‘excess codes ‘
Sign Number – sign + magnitude
Notation

    Sign Bit             Magnitude

    0  +ve          Simple binary number
    1  - ve
               How about Null or Zero

               Problem      ?
               + 0  0000
               - 0  1000
Signed Numbers – Sign +
magnitude Notation
 Arithmetic
  Difficult to do – have to work out that operation to
    perform
  5 + -6 actually calculate –(6-5) i.e. exchange the
    operands and do subtraction!
  -5+ -6 actually calculate –(5+6) i.e. negate the addition
    of the negated numbers !
  Required action depends the signs of the numbers
    and on which has the large magnitude. Natural for us
    –a bit hard for the computer since the only way it can
    work out the bigger number is to do a subtraction!
Sign + Magnitude Examples
           4-bit sign +
   Value                  8-bit sign + magnitude
           magnitude
    +7        0111              00000111
    +6        0110              00000110
    ……        ……                   ……
    +1        0001              00000001
    +0        0000              00000000
    -0        1000              10000000
    -1        1001              10000001
    -2        1010              10000010
    ……        ……                   ……
    -7        1111              10000111
Sign Numbers – 2’s
Complement
  As  for straight binary numbers but with the
   weighting of the most significant bit being
   negative
  Example

   * 4 bit – weights are -8, 4,2,1
   * 8 bit – weights are -128, 64,32,16,8,4,2,1
  Need to know how many bits are being used
   to work out the value of the number – don’t
   omit leading zeroes
Sign Numbers – 2’s
Complement
     Binary point
                                               1 x 2-1 = 0.500
                                               0 x 2-2 = 0.000
                                                1 x 2-3 = 0.125

                        1100.101
   Sign Bit


                                                0 x 20= 0.000
                                                0 x 21= 0.000
                                                1 x 22= -4.375
                                                         4.000
              Binary, weightings are powers of 21 x 2 = -8.000
                                                     3
2’s Complement Examples
           4-bit sign 2’s
   Value                    8-bit sign complement
           complement
    +7         0111               00000111
    +6         0110               00000110
    ……         ……                   ……
    +1         0001               00000001
    +0         0000               00000000
    -1         1111               11111111
    -2         1110               11111110
    ……         ……                   ……
    -7         1001               11111001
    -8         1000               11111000
2’s Complement Examples
 Example : -4 (decimal)

 Become 4 = 0100 ( binary)
            = 1x22 = 4
 2’s Complement
         -4= 1100 (binary)
           = -(23) + 22
      = -8 + 4
           = -4
Exercise

 Converse decimal number above into
    negative (2’s complement) :
 1. -7 ( 4 digit )   6. 6 (4 digit)
 2. -7 (8 digit)     7. 10 (8 digit)
 3. -12 (8 digit)    8. 30 (8 digit)
 4. -20 (8 digit)    9. 98 (digit)
 5. -100 (8 digit)  10. 126 (digit)
Addition 2’s Complement

 For 4 digit :
     4            0100
     3     +      0011   +
     7            0111

         22+21+20 = 4+2+1 =7
Addition 2’s Complement

 For 4 digit

      -1                   1111
      -2       +           1110     +
      -3                  11101
                                        Carry out

               -(8)+4 +0 + 1 = -3
Exercise

 For 4 Digit :
 1. 7 + (-5)
 2. -6 + -1
 3. 3 + 4
 4. 2 + 3
 5. -4 + 7
 Converse all item to digital and addition.
    And then Converse to decimal again
Subtraction 2’s Complement


    +7                 0111
    + 3 (0011)-        1101 +
    +4                10100




            Discard
Subtraction 2’s Complement


  (-8)            1000
  (-3) = 1101 -   0011 +
  -5              1011
Exercise

   for 4 digit . Converse decimal above to
     digit and subtraction. After that
     converse to decimal again :
 1. (+3) – (-3)
 2. (-4) – (+2)
 3. (-8)- (+4)
 4. (-3) – (-4)
 5. (7) – (5)
2’s Complement ALU
   Addition and subtraction use the same rules as
    unsigned binary.
   Same hardware may be used for both
   Carry (C) is used for unsigned, overflow (v) for signed
              Signed Numbers                     Signed Numbers

                                 The same
                                 hardware
                 OP                                 OP
    C=Carry
 V=overflow                                                         C=Carry
              Signed Numbers                      Signed Numbers   V=overflow



                            Arithmetic Flags in
                        Condition code register (CCR)

Mais conteúdo relacionado

Mais procurados

Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in indiaEdhole.com
 
Digital and Logic Design Chapter 1 binary_systems
Digital and Logic Design Chapter 1 binary_systemsDigital and Logic Design Chapter 1 binary_systems
Digital and Logic Design Chapter 1 binary_systemsImran Waris
 
Cmp104 lec 2 number system
Cmp104 lec 2 number systemCmp104 lec 2 number system
Cmp104 lec 2 number systemkapil078
 
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Logic Circuits Design - "Chapter 1: Digital Systems and Information"Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Logic Circuits Design - "Chapter 1: Digital Systems and Information"Ra'Fat Al-Msie'deen
 
Number systems presentation
Number systems presentationNumber systems presentation
Number systems presentationJiian Francisco
 
comp.org Chapter 2
comp.org Chapter 2comp.org Chapter 2
comp.org Chapter 2Rajat Sharma
 
Computer arthtmetic,,,
Computer arthtmetic,,,Computer arthtmetic,,,
Computer arthtmetic,,,Ahsan Mehmood
 
Logic Design - Chapter 1: Number Systems and Codes
Logic Design - Chapter 1: Number Systems and CodesLogic Design - Chapter 1: Number Systems and Codes
Logic Design - Chapter 1: Number Systems and CodesGouda Mando
 
Bca 2nd sem-u-1.8 digital logic circuits, digital component floting and fixed...
Bca 2nd sem-u-1.8 digital logic circuits, digital component floting and fixed...Bca 2nd sem-u-1.8 digital logic circuits, digital component floting and fixed...
Bca 2nd sem-u-1.8 digital logic circuits, digital component floting and fixed...Rai University
 
Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)Frankie Jones
 
Logic Design 2009
Logic Design 2009Logic Design 2009
Logic Design 2009lionking
 
Digital notes
Digital notesDigital notes
Digital notesstivengo2
 
Number System | Types of Number System | Binary Number System | Octal Number ...
Number System | Types of Number System | Binary Number System | Octal Number ...Number System | Types of Number System | Binary Number System | Octal Number ...
Number System | Types of Number System | Binary Number System | Octal Number ...Get & Spread Knowledge
 
B.sc cs-ii-u-1.8 digital logic circuits, digital component floting and fixed ...
B.sc cs-ii-u-1.8 digital logic circuits, digital component floting and fixed ...B.sc cs-ii-u-1.8 digital logic circuits, digital component floting and fixed ...
B.sc cs-ii-u-1.8 digital logic circuits, digital component floting and fixed ...Rai University
 
Binary reference guide csit vn1202
Binary reference guide csit vn1202Binary reference guide csit vn1202
Binary reference guide csit vn1202jrwalker2012
 

Mais procurados (18)

Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
Digital and Logic Design Chapter 1 binary_systems
Digital and Logic Design Chapter 1 binary_systemsDigital and Logic Design Chapter 1 binary_systems
Digital and Logic Design Chapter 1 binary_systems
 
Cmp104 lec 2 number system
Cmp104 lec 2 number systemCmp104 lec 2 number system
Cmp104 lec 2 number system
 
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Logic Circuits Design - "Chapter 1: Digital Systems and Information"Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
 
Mba ebooks
Mba ebooksMba ebooks
Mba ebooks
 
Number systems presentation
Number systems presentationNumber systems presentation
Number systems presentation
 
Number systems
Number systemsNumber systems
Number systems
 
comp.org Chapter 2
comp.org Chapter 2comp.org Chapter 2
comp.org Chapter 2
 
Number systems tutorial
Number systems tutorialNumber systems tutorial
Number systems tutorial
 
Computer arthtmetic,,,
Computer arthtmetic,,,Computer arthtmetic,,,
Computer arthtmetic,,,
 
Logic Design - Chapter 1: Number Systems and Codes
Logic Design - Chapter 1: Number Systems and CodesLogic Design - Chapter 1: Number Systems and Codes
Logic Design - Chapter 1: Number Systems and Codes
 
Bca 2nd sem-u-1.8 digital logic circuits, digital component floting and fixed...
Bca 2nd sem-u-1.8 digital logic circuits, digital component floting and fixed...Bca 2nd sem-u-1.8 digital logic circuits, digital component floting and fixed...
Bca 2nd sem-u-1.8 digital logic circuits, digital component floting and fixed...
 
Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)
 
Logic Design 2009
Logic Design 2009Logic Design 2009
Logic Design 2009
 
Digital notes
Digital notesDigital notes
Digital notes
 
Number System | Types of Number System | Binary Number System | Octal Number ...
Number System | Types of Number System | Binary Number System | Octal Number ...Number System | Types of Number System | Binary Number System | Octal Number ...
Number System | Types of Number System | Binary Number System | Octal Number ...
 
B.sc cs-ii-u-1.8 digital logic circuits, digital component floting and fixed ...
B.sc cs-ii-u-1.8 digital logic circuits, digital component floting and fixed ...B.sc cs-ii-u-1.8 digital logic circuits, digital component floting and fixed ...
B.sc cs-ii-u-1.8 digital logic circuits, digital component floting and fixed ...
 
Binary reference guide csit vn1202
Binary reference guide csit vn1202Binary reference guide csit vn1202
Binary reference guide csit vn1202
 

Semelhante a Sistem bilangan

Semelhante a Sistem bilangan (20)

Pertemuan 2 - Sistem Bilangan
Pertemuan 2 - Sistem BilanganPertemuan 2 - Sistem Bilangan
Pertemuan 2 - Sistem Bilangan
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
Lecture.1
Lecture.1Lecture.1
Lecture.1
 
Number system
Number systemNumber system
Number system
 
Binary octal
Binary octalBinary octal
Binary octal
 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptx
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
unit-i-number-systems.pdf
unit-i-number-systems.pdfunit-i-number-systems.pdf
unit-i-number-systems.pdf
 
Lec 02
Lec 02Lec 02
Lec 02
 
Unit 1 PDF.pptx
Unit 1 PDF.pptxUnit 1 PDF.pptx
Unit 1 PDF.pptx
 
2.1 data represent on cpu
2.1 data represent on cpu2.1 data represent on cpu
2.1 data represent on cpu
 
Meghna ppt.
Meghna ppt.Meghna ppt.
Meghna ppt.
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
Codes r005
Codes  r005Codes  r005
Codes r005
 
digital-electronics.pptx
digital-electronics.pptxdigital-electronics.pptx
digital-electronics.pptx
 
Digital notes
Digital notesDigital notes
Digital notes
 
CA Unit ii
CA Unit iiCA Unit ii
CA Unit ii
 
NumberSystemsAnnotated.pdf
NumberSystemsAnnotated.pdfNumberSystemsAnnotated.pdf
NumberSystemsAnnotated.pdf
 
Number systems
Number systemsNumber systems
Number systems
 

Último

MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 

Último (20)

MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 

Sistem bilangan

  • 1. Sistem Bilangan Oleh : Moch Nur Purnama
  • 2. Analogue vs Digital  Analogue * Continuous range of value * Precision limited by Noise  Digital * Discrete range of values * Precision limited by number of “Bit”
  • 3. Analogue vs Digital Analogue Digital
  • 4. Analogue vs Digital  The real world is analogue ( by because all signal in world be shape analogue)  But in controlling, Digital one had using for process.  Both of signal had been converter each other
  • 5. Analoge vs Digital Digital D to A Analogue Analogue A to D Processing Why Digital Only by using in Processing? ^ Adventure in integrated Circuit has made the complex processing of digital data. ^ Digital Control processing has made easier than analogue ^ Digital circuits are inherently more noise resistant
  • 6. Digital and Boolean  Digital represented by boolean logic  Boolean is the name of mathematician’s expert  Now boolean is called by conventional logic because there is new logic that called by fuzzy logic  But all electronic still using boolean logic to processing the controlling system
  • 7. Why Boolean  It is convenient in electrical system to use a two-value system to represent value true/false, on/off, yes/no and 1/0 * Two voltage or current levels can be used * Easier to process and distribute reliably (diandalakan) * Don’t think of them as numbers (even though we often represent them as 0/1 for brevity(ketangkasan))  The need for binary numbers * Multi-value quantities need to be represented in the digital system. Therefore need numbers made up from the simple two value system
  • 8. Positional Number System Decimal point 7x10-1 7x10-2 8x10-3 3578.778 8 x 100 7 x 101 Base 10, weigthing are powers of 10 5 x 102 3 x 103
  • 9. Unsigned binary numbers Binary point 1 x 2-1 = 0.500 0 x 2-2 = 0.000 1 x 2-3 = 0.125 1100.101 Each bit of the Number may be Representaed by A Boolean value 0 x 20= 0.000 0 x 21= 0.000 1 x 22= 4.000 Binary, weightings are powers of 21 x 2 = 8.000 3
  • 10. Multi-precision Arithmatic Additional of A and B A1 B1 A2 B2 + A2 B3 Carry Carry Flag Carry Carry Flag Carry Out In Out
  • 11. Multi-precision Arithmatic Carry Carry Flag Carry Out In A1 B1 A2 B2 - A2 B3
  • 12. Hexadecimal Numbers 660 0 0 4 : 16 1 1 2 2 41 3 3 9 : 16 4 4 2 5 5 6 6 Hexadecimal : 294 Hex 7 7 8 8 215 9 9 13 : 16 10 A 11 B 7 12 C 13 D 14 E Hexadecimal : 7D Hex 15 F
  • 13. Hexadecimal Numbers 0 0000 660 0010 1001 0100 1 0001 2 0010 3 0011 4 0100 2 9 4 5 0101 6 0110 7 0111 8 1000 215 0000 1101 0111 9 1001 A 1010 B 1011 C 1100 0 D 7 D 1101 E 1110 F 1111
  • 14. Decimal to Binary Number = 36.37 Generetee each digit by successive division 5 Or multiplication. Base = 2 There is no guarantee the fraction will be Decimal Binary Converter Number finite Number Digits 0 0 0100100.0110 0.5 1 0100100.011 Fractional part – Multiplication by base 0.75 1 0100100.01 0.375 0 0100100.0 36 0 0100100 18 0 010010 9 1 01001 Whole part – divition by base 4 0 0100 2 0 010 1 1 01 0 0 0
  • 15. Binary Additional 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 carry 1 Easy Layaou ?
  • 16. Binary Addition 190 + 141 =331 Carry out of Each column 1 1 1 1 1 1 0 1 1 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 0 0 1 0 1 1 Carry out of 8-bit number
  • 17. Binary Subtraction A borrow-out of 1 from This column becomes a borrow in 229 – 46 = 183 of 2 in this column 2 2 2 2 2 1 1 1 0 0 1 0 1 Borrow in from Left column 0 0 1 0 1 1 1 0 1 1 1 1 1 Borrow out 1 0 1 1 0 1 1 1 Both rows subtracted
  • 18. Exercise  Convert to 8-bit binary and do the arithmetic operation * 120 + 54 * 110 + 100 * 224 – 134 * 200 + 20 * 112 – 89 * 111 – 25  Convert back to decimal and check the result
  • 19. Binary Number Circle In real hardware there is a fixed number Of bits available. We often ignore leading zeros But they are still there! Examlpe : If we only use 4 bits then the binary Counting sequence “wraps around” At 15 ↔ 0 4 – bit Binary 11 - 1 = 10 Number Circle 11 1110 -1 1 10 1010
  • 20. Binary Number Circle Subtracting across the boundary Still “works” if you think of result As the distance on the number Circle. (Module arithmetic – ignore The borrow /carry) 4 – bit 8 1000 Binary - 14 - 1110 Number Circle 10 (-1)1010
  • 21. Representing –ve Number  Several choices for natation * sign + magnitude notation * 1’s complement * 2’s complement notation * various ‘excess codes ‘
  • 22. Sign Number – sign + magnitude Notation Sign Bit Magnitude 0  +ve Simple binary number 1  - ve How about Null or Zero Problem ? + 0  0000 - 0  1000
  • 23. Signed Numbers – Sign + magnitude Notation Arithmetic  Difficult to do – have to work out that operation to perform  5 + -6 actually calculate –(6-5) i.e. exchange the operands and do subtraction!  -5+ -6 actually calculate –(5+6) i.e. negate the addition of the negated numbers !  Required action depends the signs of the numbers and on which has the large magnitude. Natural for us –a bit hard for the computer since the only way it can work out the bigger number is to do a subtraction!
  • 24. Sign + Magnitude Examples 4-bit sign + Value 8-bit sign + magnitude magnitude +7 0111 00000111 +6 0110 00000110 …… …… …… +1 0001 00000001 +0 0000 00000000 -0 1000 10000000 -1 1001 10000001 -2 1010 10000010 …… …… …… -7 1111 10000111
  • 25. Sign Numbers – 2’s Complement  As for straight binary numbers but with the weighting of the most significant bit being negative  Example * 4 bit – weights are -8, 4,2,1 * 8 bit – weights are -128, 64,32,16,8,4,2,1  Need to know how many bits are being used to work out the value of the number – don’t omit leading zeroes
  • 26. Sign Numbers – 2’s Complement Binary point 1 x 2-1 = 0.500 0 x 2-2 = 0.000 1 x 2-3 = 0.125 1100.101 Sign Bit 0 x 20= 0.000 0 x 21= 0.000 1 x 22= -4.375 4.000 Binary, weightings are powers of 21 x 2 = -8.000 3
  • 27. 2’s Complement Examples 4-bit sign 2’s Value 8-bit sign complement complement +7 0111 00000111 +6 0110 00000110 …… …… …… +1 0001 00000001 +0 0000 00000000 -1 1111 11111111 -2 1110 11111110 …… …… …… -7 1001 11111001 -8 1000 11111000
  • 28. 2’s Complement Examples Example : -4 (decimal) Become 4 = 0100 ( binary) = 1x22 = 4 2’s Complement -4= 1100 (binary) = -(23) + 22 = -8 + 4 = -4
  • 29. Exercise Converse decimal number above into negative (2’s complement) : 1. -7 ( 4 digit ) 6. 6 (4 digit) 2. -7 (8 digit) 7. 10 (8 digit) 3. -12 (8 digit) 8. 30 (8 digit) 4. -20 (8 digit) 9. 98 (digit) 5. -100 (8 digit) 10. 126 (digit)
  • 30. Addition 2’s Complement For 4 digit : 4 0100 3 + 0011 + 7 0111 22+21+20 = 4+2+1 =7
  • 31. Addition 2’s Complement For 4 digit -1 1111 -2 + 1110 + -3 11101 Carry out -(8)+4 +0 + 1 = -3
  • 32. Exercise For 4 Digit : 1. 7 + (-5) 2. -6 + -1 3. 3 + 4 4. 2 + 3 5. -4 + 7 Converse all item to digital and addition. And then Converse to decimal again
  • 33. Subtraction 2’s Complement +7 0111 + 3 (0011)- 1101 + +4 10100 Discard
  • 34. Subtraction 2’s Complement (-8) 1000 (-3) = 1101 - 0011 + -5 1011
  • 35. Exercise for 4 digit . Converse decimal above to digit and subtraction. After that converse to decimal again : 1. (+3) – (-3) 2. (-4) – (+2) 3. (-8)- (+4) 4. (-3) – (-4) 5. (7) – (5)
  • 36. 2’s Complement ALU  Addition and subtraction use the same rules as unsigned binary.  Same hardware may be used for both  Carry (C) is used for unsigned, overflow (v) for signed Signed Numbers Signed Numbers The same hardware OP OP C=Carry V=overflow C=Carry Signed Numbers Signed Numbers V=overflow Arithmetic Flags in Condition code register (CCR)