binary!( - courses.cs.washington.edu...

39
Binary! 0010100100110010010101

Upload: others

Post on 07-Sep-2019

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Binary!  0010100100110010010101  

Page 2: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Why  do  computers  use  binary?  

•  Easy  to  detect  the  state  of  a  switch  –  they’re  either  on  or  off!  

• Using  another  base  makes  computers  more  prone  to  error.  

Page 3: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

CounCng  

In  decimal  (base  10),  we  have  digits  0-­‐9.  In  binary,  we  only  have  digits  0  and  1.  

   

         0  

Page 4: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

CounCng  

In  decimal  (base  10),  we  have  digits  0-­‐9.  In  binary,  we  only  have  digits  0  and  1.  

   

         1  

Page 5: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

CounCng  

In  decimal  (base  10),  we  have  digits  0-­‐9.  In  binary,  we  only  have  digits  0  and  1.  

   

       10  

Page 6: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

CounCng  

In  decimal  (base  10),  we  have  digits  0-­‐9.  In  binary,  we  only  have  digits  0  and  1.  

   

       11  

Page 7: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

CounCng  

In  decimal  (base  10),  we  have  digits  0-­‐9.  In  binary,  we  only  have  digits  0  and  1.  

   

     100  

Page 8: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

CounCng  

In  decimal  (base  10),  we  have  digits  0-­‐9.  In  binary,  we  only  have  digits  0  and  1.  

   

     101  

Page 9: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

CounCng  

In  decimal  (base  10),  we  have  digits  0-­‐9.  In  binary,  we  only  have  digits  0  and  1.  

   

     110  

Page 10: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

CounCng  

In  decimal  (base  10),  we  have  digits  0-­‐9.  In  binary,  we  only  have  digits  0  and  1.  

   

     111  

Page 11: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

CounCng  

In  decimal  (base  10),  we  have  digits  0-­‐9.  In  binary,  we  only  have  digits  0  and  1.  

   

   1000  

Page 12: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Places  

    1011  

1’s  

Page 13: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Places  

    1011  

2’s  

Page 14: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Places  

    1011  

4’s  

Page 15: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Places  

    1011  

8’s  

Page 16: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Places  

   

1011  20  

4853  100  

Page 17: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Places  

   

1011  21  

4853  101  

Page 18: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Places  

   

1011  22  

4853  102  

Page 19: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Places  

   

1011  23  

4853  103  

Page 20: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

TranslaCng  Binary  to  Decimal  

    1011  

 1  

Page 21: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

TranslaCng  Binary  to  Decimal  

    1011  

 1  2  +  

Page 22: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

TranslaCng  Binary  to  Decimal  

    1011  

 1  2  +  0  +  

Page 23: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

TranslaCng  Binary  to  Decimal  

    1011  

 1  2  +  0  +  8  +  

Page 24: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

TranslaCng  Binary  to  Decimal  

    101100  

Answer:  44  

Page 25: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

TranslaCng  Binary  to  Decimal  

    10001110  

Answer:  142  

Page 26: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary  

Adding  is  the  easiest.  EVER.    

                100101                   110110  

            1  

Page 27: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary  

Adding  is  the  easiest.  EVER.    

                100101                   110110  

          11  

Page 28: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary  

Adding  is  the  easiest.  EVER.    

                100101                   110110  

     011  

Page 29: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary  

Adding  is  the  easiest.  EVER.    

                100101                   110110  

     1011  

Page 30: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary  

Adding  is  the  easiest.  EVER.    

                100101                   110110  

   11011  

Page 31: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary  

Adding  is  the  easiest.  EVER.    

                100101                   110110  

 011011  

Page 32: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary  

Adding  is  the  easiest.  EVER.    

                100101     37                   110110     54  

1011011       91  

Page 33: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary  

Dividing  by  2  is  neat-­‐o    

                101100  44  

Page 34: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary  

Dividing  by  2  is  neat-­‐o    

                010110  22  

Page 35: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary  

Dividing  by  2  is  neat-­‐o    

                001011  11  

Page 36: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary  

Dividing  by  2  is  neat-­‐o    

000101 .1  5 .5  

Page 37: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary  

Dividing  by  2  is  neat-­‐o    

00010 .11  2 .75  

Page 38: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

Zorah’s  favorite  things  about  Binary    

You  can  count  to,  like,  a  bajillion  on  your  fingers  in  binary.  

 

Try  it.  I  know  you  want  to.    

Page 39: Binary!( - courses.cs.washington.edu fileCounng(In(decimal((base(10),(we(have(digits(0J9.(In(binary,(we(only(have(digits(0(and(1.(((((0

“There  are  10  types  of  people  in  the  world:  those  who  understand  binary  and  those  who  don’t.”