SlideShare a Scribd company logo
Recall . . .

•   The definition of a computer
•   Analog/Digital
•   Electric/Mechanical
•   General Purpose/Special Purpose
•   The General Purpose Electronic Computer
•   General Purpose  Binary
•   Binary?

                                              2-1
2-2
Binary Circuitry

• Binary circuitry:
   – cheap
   – reliable
   – able to be extended to very complicated logic
       • built on only two states
               » ON (1)
               » OFF (0)



                                                     2-3
Computers work in Binary

   • Computers are not only powered by electricity they
     “compute” with electricity
          – they shift voltage pulses around internally
          – circuits allow for electricity to flow or to be blocked depending on the
            type of circuit




Closed                                             Open
circuit                                            circuit



ON or 1                                       OFF or 0                             2-4
Representation of Data

• So, our binary computer can represent:
  – 0s and 1s. . .


  – We need to represent considerably more than that:
      • Numbers
      • Characters
      • Visual Data
      • Audio Data
      • Instructions
  … and we need to do it with only 0’s and 1’s

                                                        2-5
Representation of Numbers

• Representing numbers is considerably more than
  something that looks like the symbol “1” or “2” or “430”
   – We’re trying to represent numbers; which have
     conceptual meaning



  9 = 3+3+3 = 4+5 = 10-1 = 3*3 = 3^3 = 9




                                                             2-6
Representation of Numbers

• Decimal numeration system: (aka base 10)
    – Uses 10 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
    – The place values of each position are increasing powers of ten.

• A number such as 1428 literally means:
    –   Eight Ones
    –   Two Tens                     104   103           102    101     100
    –   Four Hundreds
    –   One (A single) Thousand
                                   10000 1000           100    10        1


        = (1 x 1000) + (4 x 100) + (2 x 10) + (8 x 1)
                                                                              2-7
Combinations

• Imagine we have three light-bulbs in a row, and each bulb
  can be on (1) or off (0).
• How many unique combinations of lights can we have?
   – (Hint, start with all lights off)




                                                              2-8
Combinations
• The number of unique combinations we can have of one light with two
  states per lights is two:
                                           0
                                           1

• The number of unique combinations we can have of two lights with two
  states per light is four:              00
                                           01
                                           10
                                           11
• The number of unique combinations we can have of three lights with two
  states per lights is eight:            000     100
                                           001     101
                                           010     110
                                           011     111                     2-9
Representation of Numbers
• Our three-light system
   – has eight possible
     combinations of on and off.

• With eight unique
  combinations, we could
  represent the numbers
     0, 1, 2, 3, 4, 5, 6, 7

     0 = 000    4 = 100
     1 = 001    5 = 101
     2 = 010    6 = 110
     3 = 011    7 = 111            2-10
Representation of Numbers
• Binary numeration system (aka base 2):
   – Will use 2 symbols: 0, and 1.
      (Each is called a bit for binary digit)
   – The place values of each position are powers of two.

   – A binary number such as 10110two will be expanded as:
      • Zero Ones
      • One Two                    24       23      22              21   20
      • One Four                  16        8       4              2     1
      • Zero Eights
      • One Sixteen
                                   1        0       1              1     0

   = (1 x 16) + (0 x 8) + (1 x 4) + (1 x 2) + (0 x 1) = 22 in decimal    2-11
Binary-to-Decimal Conversion

• Convert the following binary number (base two) in decimal
  (base ten)
               1 0 0 0 0 0 1 1




                                                              2-12
Binary Conversion

1 0 0 0 0 0 1 1

     • Step 1: Make a table with the same number of columns as places
       in the binary string and copy the string into the table




                 1      0      0      0       0      0      1      1



                                                                        2-13
Binary Conversion

• Step 2: Write out the powers of two corresponding to each
  position in the binary number:




            27     26      25     24     23      22     21    20

             1      0      0       0      0      0       1    1



                                                               2-14
Binary Conversion

• Step 3: Write out the powers of two corresponding to each
  position in the binary number in decimal:




                     5
             27 26 2              24     23     22     21     20
            128 64 32             16     8      4      2      1
              1      0     0       0      0      0      1     1


                                                                  2-15
Binary Conversion

• Step 4: multiply the second and third rows and put the result in
  the fourth row:




         27 26           25      24       23      22      21         20
        128 64           32      16       8       4       2          1
          1       0       0       0       0       0        1         1
        128       0       0       0       0       0        2         1

                                                                      2-16
Binary Conversion

• Step 5: (final step) – Add up all the numbers in the fourth row




        27       26      25      24     23      22      21      20
       128       64     32      16      8       4       2       1
        1         0      0       0       0       0       1          1
       128        0      0       0       0       0       2          1

             128+0+0+0+0+0+2+1 = 131

                                                                        2-17
2-18
Decimal to Binary

2(number of places) = number of unique combinations we can achieve with
   some number of places in binary; but we have to use one of the
   mappings for zero so. . .


2(number of places) - 1 = largest binary number we can store with that
   many places

    1  21 – 1 = 1  with 1 place we can store numbers from 0 to 1
    5  25 – 1 = 31  with 5 places we can store numbers from 0 to 31
    7  27 – 1 = 127  with 7 places we can store numbers from 0 to 127
    8  28 – 1 = 255  with 8 places we can store numbers between 0 and 255
                                                                              2-19
Binary Conversion

Step 2: Write out a binary conversion table with n many places, and fill in
   the values of the first two rows:


              27       26      25      24      23      22      21     20
             128       64     32      16       8       4       2      1




                                                                              2-20
Binary Conversion
      • Step 3: Subtract out the decimal powers of two from left
        to right.
         – If you can subtract that amount and the result is non-negative, write a 1
           in the binary string and continue with the result
         – If the subtraction results in a negative number, write a 0 and continue
           with the last positive number


        27        26        25         24        23         22         21        20
       128       64         32         16         8          4         2          1
245
      245- 117 -          53 -       21 -      5 - 8 5 - 4 1 - 2 1 - 1
      128 = 64 =          32 =       16 =       = -3  = 1   = -1  = 0
       117   53            21         5        error       error
         1        1          1         1          0          1         0          1
                                                                                       2-21
Addition/Subtraction
• Addition in any number system. . .
   – We add in the places from right to left
   – If the sum of the two numbers exceeds the symbols we have at our
     disposal we “carry” some amount. . .

        4 + 8 = “twelve” ; in base ten, we have no single numeric symbol
          that equals twelve

        • We don’t need to express “twelve” in a single symbol, because we
          can do so by breaking the number down and incrementing the base

        • Instead we write 12 which is: One Ten and Two Ones.

        • Logically, we subtract 10 (the base amount) from our sum, and
          write the result in that place, and we carry a one into the next
          place, which represents One additional ten (our base number)
                                                                             2-22
Binary Addition

• Addition of binary numbers:
     0 + 0 = 0
     0 + 1 = 1
     1 + 0 = 1
     1 + 1 = 2ten  How do we write this?


So we’ll carry the symbol 1 into the next place (which represents two in
   decimal), and we’ll write down the sum minus our base amount (2)
                          1 + 1 = 10two
Example: adding two binary numbers
                                                                           2-23
Binary Subtraction

• Subtraction of binary numbers:
  0 - 0 = 0
  0 - 1 = -1  problem! We need to borrow …
  1 - 0 = 1
  1 - 1 = 0

Remember when borrowing in base 10:
   – We decrease the symbol to the left by one
   – Remember when we borrow 1 from the symbol to our
     left, it has a value that’s “ten more” (or the base amount)
                                                                   2-24
Binary Subtraction

• Let’s subtract the following numbers:



   1 0 0 0 0 0 1 1
 - 0 1 0 0 0 1 0 0
------------------




                                          2-25
Binary Subtraction

• We need to borrow for the third term, but the eighth is the closest
  term with something to borrow from!



   1 0 0 0 0 0 1 1
 - 0 1 0 0 0 1 0 0
------------------
               1 1 




                                                                        2-26
Binary Subtraction

• So, we borrow 2ten from the first place we can

   0 2 
   1 0 0 0 0 0 1 1
 - 0 1 0 0 0 1 0 0
------------------




                                                   2-27
Binary Subtraction

• Keep borrowing two
     1
   0 2 2 
   1 0 0 0 0 0 1 1
 - 0 1 0 0 0 1 0 0
------------------
                  1 1




                                2-28
Binary Subtraction

• Keep borrowing 2 . . .
     1 1
   0 2 2 2
   1 0 0 0 0 0 1 1
 - 0 1 0 0 0 1 0 0
------------------
                   1 1




                                  2-29
Binary Subtraction

• Keep borrowing 2 . . .
     1 1 1
   0 2 2 2 2
   1 0 0 0 0 0 1 1
 - 0 1 0 0 0 1 0 0
------------------
                   1 1




                                  2-30
Binary Subtraction

     1 1 1 1
   0 2 2 2 2 2  now, we’re able to subtract here
   1 0 0 0 0 0 1 1
 - 0 1 0 0 0 1 0 0
------------------
             1 1 1




                                                    2-31
Binary Subtraction

• The rest of the subtractions are easy . . .
      1 1 1 1
   0 2 2 2 2 2
   1 0 0 0 0 0 1 1
 - 0 1 0 0 0 1 0 0
------------------
   0 0 1 1 1 1 1 1

So our answer is -> 00111111
Let’s convert to decimal to check our work
                                                2-32
Binary Subtraction

• converting binary to decimal we get. . .

   1 0 0 0 0 0 1 1 -> 128+2+1 = 131
 - 0 1 0 0 0 1 0 0 -> 64+4 = 68
------------------
   0 0 1 1 1 1 1 1 -> 32+16+8+4+2+1 = 67

       131 – 68 = 67


                                             2-33
Binary Numbers

• Binary numbers actually have some other neat properties
  as well . . .

   – QUESTION: Can you multiply a binary number by two (decimal)
     and give the result in binary quickly?
      • Multiply the number 00110 by two (and give the answer in
         binary)
           – Why does this work?

           25      24     23      22     21     20
          32      16      8       4      2      1
           0       0      0       1      1      0                  2-34

More Related Content

PDF
Binary reference guide csit vn1202
PDF
Number systems tutorial
PPTX
Number System | Types of Number System | Binary Number System | Octal Number ...
PDF
Day02
PPT
Cmp104 lec 2 number system
PPTX
Ch1.number systems
PDF
Number system
PPTX
Introduction to digital electornics
Binary reference guide csit vn1202
Number systems tutorial
Number System | Types of Number System | Binary Number System | Octal Number ...
Day02
Cmp104 lec 2 number system
Ch1.number systems
Number system
Introduction to digital electornics

What's hot (20)

PPT
Number system
PDF
Slide03 Number System and Operations Part 1
PPT
01.number systems
PPTX
PPT ON NUMBER SYSTEM
PPT
01.number systems
PPTX
Lecture4 binary-numbers-logic-operations
DOCX
Binary Number into Decimal Numbers
PPT
PPTX
Number system
PPTX
Number System
PPTX
Computer Number system
PPTX
Binary number ppt
PPTX
Number+system (1)
PDF
Number systems
PPSX
Number system
PDF
Binary Mathematics Classwork and Hw
PPTX
The binary number system
PPTX
Representation Of Numbers and Characters
DOCX
Converting denary binary
PDF
Math1003 1.8 - Converting from Binary and Hex to Decimal
Number system
Slide03 Number System and Operations Part 1
01.number systems
PPT ON NUMBER SYSTEM
01.number systems
Lecture4 binary-numbers-logic-operations
Binary Number into Decimal Numbers
Number system
Number System
Computer Number system
Binary number ppt
Number+system (1)
Number systems
Number system
Binary Mathematics Classwork and Hw
The binary number system
Representation Of Numbers and Characters
Converting denary binary
Math1003 1.8 - Converting from Binary and Hex to Decimal
Ad

Similar to Binary Numbers (20)

PDF
4 technology
PDF
01 number systems-students
PPT
Binary numbers
PPT
Binary numbers w/video links
PDF
silo.tips_-chapter-1-the-binary-number-system-11-why-binary.pdf
PPT
1. basic theories of information
PDF
Binary overview
PPT
Binary numbers videos
PPTX
09 binary number systems
PDF
Binary octal
PPTX
LCDF3_Chap_01x.pptx
PPT
Sistem bilangan
PPT
digital systems and information
PPTX
Digital Logic Design.pptx
PPT
IS 139 Lecture 4 - 2015
PPT
IS 139 Lecture 4
PPTX
Lesson4.1 u4 l1 binary representation
PPT
Ch3
DOCX
There are 10 kinds of people in the world—those who understand.docx
PDF
Number Systems CPSC125
4 technology
01 number systems-students
Binary numbers
Binary numbers w/video links
silo.tips_-chapter-1-the-binary-number-system-11-why-binary.pdf
1. basic theories of information
Binary overview
Binary numbers videos
09 binary number systems
Binary octal
LCDF3_Chap_01x.pptx
Sistem bilangan
digital systems and information
Digital Logic Design.pptx
IS 139 Lecture 4 - 2015
IS 139 Lecture 4
Lesson4.1 u4 l1 binary representation
Ch3
There are 10 kinds of people in the world—those who understand.docx
Number Systems CPSC125
Ad

More from ikjsamuel (8)

PPT
Database system
PPT
Database system
PPS
Database system
PPS
Database system-DBMS
PPSX
Reconciliation statement
PPS
Truth table1
PPS
Staisticsii
PPS
Fund&Cash Flow
Database system
Database system
Database system
Database system-DBMS
Reconciliation statement
Truth table1
Staisticsii
Fund&Cash Flow

Recently uploaded (20)

PDF
01-Introduction-to-Information-Management.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Complications of Minimal Access Surgery at WLH
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Pre independence Education in Inndia.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Pharma ospi slides which help in ospi learning
01-Introduction-to-Information-Management.pdf
Anesthesia in Laparoscopic Surgery in India
O7-L3 Supply Chain Operations - ICLT Program
Complications of Minimal Access Surgery at WLH
human mycosis Human fungal infections are called human mycosis..pptx
PPH.pptx obstetrics and gynecology in nursing
O5-L3 Freight Transport Ops (International) V1.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
RMMM.pdf make it easy to upload and study
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Sports Quiz easy sports quiz sports quiz
Module 4: Burden of Disease Tutorial Slides S2 2025
Pre independence Education in Inndia.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Microbial diseases, their pathogenesis and prophylaxis
Pharma ospi slides which help in ospi learning

Binary Numbers

  • 1. Recall . . . • The definition of a computer • Analog/Digital • Electric/Mechanical • General Purpose/Special Purpose • The General Purpose Electronic Computer • General Purpose  Binary • Binary? 2-1
  • 2. 2-2
  • 3. Binary Circuitry • Binary circuitry: – cheap – reliable – able to be extended to very complicated logic • built on only two states » ON (1) » OFF (0) 2-3
  • 4. Computers work in Binary • Computers are not only powered by electricity they “compute” with electricity – they shift voltage pulses around internally – circuits allow for electricity to flow or to be blocked depending on the type of circuit Closed Open circuit circuit ON or 1 OFF or 0 2-4
  • 5. Representation of Data • So, our binary computer can represent: – 0s and 1s. . . – We need to represent considerably more than that: • Numbers • Characters • Visual Data • Audio Data • Instructions … and we need to do it with only 0’s and 1’s 2-5
  • 6. Representation of Numbers • Representing numbers is considerably more than something that looks like the symbol “1” or “2” or “430” – We’re trying to represent numbers; which have conceptual meaning 9 = 3+3+3 = 4+5 = 10-1 = 3*3 = 3^3 = 9 2-6
  • 7. Representation of Numbers • Decimal numeration system: (aka base 10) – Uses 10 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. – The place values of each position are increasing powers of ten. • A number such as 1428 literally means: – Eight Ones – Two Tens 104 103 102 101 100 – Four Hundreds – One (A single) Thousand 10000 1000 100 10 1 = (1 x 1000) + (4 x 100) + (2 x 10) + (8 x 1) 2-7
  • 8. Combinations • Imagine we have three light-bulbs in a row, and each bulb can be on (1) or off (0). • How many unique combinations of lights can we have? – (Hint, start with all lights off) 2-8
  • 9. Combinations • The number of unique combinations we can have of one light with two states per lights is two: 0 1 • The number of unique combinations we can have of two lights with two states per light is four: 00 01 10 11 • The number of unique combinations we can have of three lights with two states per lights is eight: 000 100 001 101 010 110 011 111 2-9
  • 10. Representation of Numbers • Our three-light system – has eight possible combinations of on and off. • With eight unique combinations, we could represent the numbers 0, 1, 2, 3, 4, 5, 6, 7 0 = 000 4 = 100 1 = 001 5 = 101 2 = 010 6 = 110 3 = 011 7 = 111 2-10
  • 11. Representation of Numbers • Binary numeration system (aka base 2): – Will use 2 symbols: 0, and 1. (Each is called a bit for binary digit) – The place values of each position are powers of two. – A binary number such as 10110two will be expanded as: • Zero Ones • One Two 24 23 22 21 20 • One Four 16 8 4 2 1 • Zero Eights • One Sixteen 1 0 1 1 0 = (1 x 16) + (0 x 8) + (1 x 4) + (1 x 2) + (0 x 1) = 22 in decimal 2-11
  • 12. Binary-to-Decimal Conversion • Convert the following binary number (base two) in decimal (base ten) 1 0 0 0 0 0 1 1 2-12
  • 13. Binary Conversion 1 0 0 0 0 0 1 1 • Step 1: Make a table with the same number of columns as places in the binary string and copy the string into the table 1 0 0 0 0 0 1 1 2-13
  • 14. Binary Conversion • Step 2: Write out the powers of two corresponding to each position in the binary number: 27 26 25 24 23 22 21 20 1 0 0 0 0 0 1 1 2-14
  • 15. Binary Conversion • Step 3: Write out the powers of two corresponding to each position in the binary number in decimal: 5 27 26 2 24 23 22 21 20 128 64 32 16 8 4 2 1 1 0 0 0 0 0 1 1 2-15
  • 16. Binary Conversion • Step 4: multiply the second and third rows and put the result in the fourth row: 27 26 25 24 23 22 21 20 128 64 32 16 8 4 2 1 1 0 0 0 0 0 1 1 128 0 0 0 0 0 2 1 2-16
  • 17. Binary Conversion • Step 5: (final step) – Add up all the numbers in the fourth row 27 26 25 24 23 22 21 20 128 64 32 16 8 4 2 1 1 0 0 0 0 0 1 1 128 0 0 0 0 0 2 1 128+0+0+0+0+0+2+1 = 131 2-17
  • 18. 2-18
  • 19. Decimal to Binary 2(number of places) = number of unique combinations we can achieve with some number of places in binary; but we have to use one of the mappings for zero so. . . 2(number of places) - 1 = largest binary number we can store with that many places 1  21 – 1 = 1  with 1 place we can store numbers from 0 to 1 5  25 – 1 = 31  with 5 places we can store numbers from 0 to 31 7  27 – 1 = 127  with 7 places we can store numbers from 0 to 127 8  28 – 1 = 255  with 8 places we can store numbers between 0 and 255 2-19
  • 20. Binary Conversion Step 2: Write out a binary conversion table with n many places, and fill in the values of the first two rows: 27 26 25 24 23 22 21 20 128 64 32 16 8 4 2 1 2-20
  • 21. Binary Conversion • Step 3: Subtract out the decimal powers of two from left to right. – If you can subtract that amount and the result is non-negative, write a 1 in the binary string and continue with the result – If the subtraction results in a negative number, write a 0 and continue with the last positive number 27 26 25 24 23 22 21 20 128 64 32 16 8 4 2 1 245 245- 117 - 53 - 21 - 5 - 8 5 - 4 1 - 2 1 - 1 128 = 64 = 32 = 16 = = -3 = 1 = -1 = 0 117 53 21 5 error error 1 1 1 1 0 1 0 1 2-21
  • 22. Addition/Subtraction • Addition in any number system. . . – We add in the places from right to left – If the sum of the two numbers exceeds the symbols we have at our disposal we “carry” some amount. . . 4 + 8 = “twelve” ; in base ten, we have no single numeric symbol that equals twelve • We don’t need to express “twelve” in a single symbol, because we can do so by breaking the number down and incrementing the base • Instead we write 12 which is: One Ten and Two Ones. • Logically, we subtract 10 (the base amount) from our sum, and write the result in that place, and we carry a one into the next place, which represents One additional ten (our base number) 2-22
  • 23. Binary Addition • Addition of binary numbers: 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 2ten  How do we write this? So we’ll carry the symbol 1 into the next place (which represents two in decimal), and we’ll write down the sum minus our base amount (2) 1 + 1 = 10two Example: adding two binary numbers 2-23
  • 24. Binary Subtraction • Subtraction of binary numbers: 0 - 0 = 0 0 - 1 = -1  problem! We need to borrow … 1 - 0 = 1 1 - 1 = 0 Remember when borrowing in base 10: – We decrease the symbol to the left by one – Remember when we borrow 1 from the symbol to our left, it has a value that’s “ten more” (or the base amount) 2-24
  • 25. Binary Subtraction • Let’s subtract the following numbers: 1 0 0 0 0 0 1 1 - 0 1 0 0 0 1 0 0 ------------------ 2-25
  • 26. Binary Subtraction • We need to borrow for the third term, but the eighth is the closest term with something to borrow from! 1 0 0 0 0 0 1 1 - 0 1 0 0 0 1 0 0 ------------------ 1 1  2-26
  • 27. Binary Subtraction • So, we borrow 2ten from the first place we can 0 2  1 0 0 0 0 0 1 1 - 0 1 0 0 0 1 0 0 ------------------ 2-27
  • 28. Binary Subtraction • Keep borrowing two 1 0 2 2  1 0 0 0 0 0 1 1 - 0 1 0 0 0 1 0 0 ------------------ 1 1 2-28
  • 29. Binary Subtraction • Keep borrowing 2 . . . 1 1 0 2 2 2 1 0 0 0 0 0 1 1 - 0 1 0 0 0 1 0 0 ------------------ 1 1 2-29
  • 30. Binary Subtraction • Keep borrowing 2 . . . 1 1 1 0 2 2 2 2 1 0 0 0 0 0 1 1 - 0 1 0 0 0 1 0 0 ------------------ 1 1 2-30
  • 31. Binary Subtraction 1 1 1 1 0 2 2 2 2 2  now, we’re able to subtract here 1 0 0 0 0 0 1 1 - 0 1 0 0 0 1 0 0 ------------------ 1 1 1 2-31
  • 32. Binary Subtraction • The rest of the subtractions are easy . . . 1 1 1 1 0 2 2 2 2 2 1 0 0 0 0 0 1 1 - 0 1 0 0 0 1 0 0 ------------------ 0 0 1 1 1 1 1 1 So our answer is -> 00111111 Let’s convert to decimal to check our work 2-32
  • 33. Binary Subtraction • converting binary to decimal we get. . . 1 0 0 0 0 0 1 1 -> 128+2+1 = 131 - 0 1 0 0 0 1 0 0 -> 64+4 = 68 ------------------ 0 0 1 1 1 1 1 1 -> 32+16+8+4+2+1 = 67 131 – 68 = 67 2-33
  • 34. Binary Numbers • Binary numbers actually have some other neat properties as well . . . – QUESTION: Can you multiply a binary number by two (decimal) and give the result in binary quickly? • Multiply the number 00110 by two (and give the answer in binary) – Why does this work? 25 24 23 22 21 20 32 16 8 4 2 1 0 0 0 1 1 0 2-34