CSE20_Lect4(1).pdf

# CSE20_Lect4(1).pdf - CSE 20 DISCRETE MATH Yeonkyung Kim...

• 102

This preview shows page 1 - 19 out of 102 pages.

CSE 20 DISCRETE MATH Yeonkyung Kim Wednesday, April 8, 15 Subscribe to view the full document.

Yeonkyung’s office hour Only in this week Thursday 2:30pm-4:30pm at CSE 2116 2 Wednesday, April 8, 15 Number system : Binary the base is 2 it uses only 0 and 1 every positive number can be expressed as a sum of distinct powers of 2 3 Wednesday, April 8, 15 Subscribe to view the full document.

1101 . 01 { 2 } = 1 · 2 3 + 1 · 2 2 + 0 · 2 1 + 1 · 2 0 + 0 · 2 - 1 + 1 · 2 - 2 { 10 } = 8 + 4 + 1 + 0 . 25 { 10 } = 13 . 25 { 10 } 4 Binary to Decimal conversion Wednesday, April 8, 15 1101 . 01 { 2 } = 1 · 2 3 + 1 · 2 2 + 0 · 2 1 + 1 · 2 0 + 0 · 2 - 1 + 1 · 2 - 2 { 10 } = 8 + 4 + 1 + 0 . 25 { 10 } = 13 . 25 { 10 } 4 2 0 Binary to Decimal conversion Wednesday, April 8, 15 Subscribe to view the full document.

1101 . 01 { 2 } = 1 · 2 3 + 1 · 2 2 + 0 · 2 1 + 1 · 2 0 + 0 · 2 - 1 + 1 · 2 - 2 { 10 } = 8 + 4 + 1 + 0 . 25 { 10 } = 13 . 25 { 10 } 4 2 1 2 0 Binary to Decimal conversion Wednesday, April 8, 15 1101 . 01 { 2 } = 1 · 2 3 + 1 · 2 2 + 0 · 2 1 + 1 · 2 0 + 0 · 2 - 1 + 1 · 2 - 2 { 10 } = 8 + 4 + 1 + 0 . 25 { 10 } = 13 . 25 { 10 } 4 2 1 2 2 2 0 Binary to Decimal conversion Wednesday, April 8, 15 Subscribe to view the full document.

1101 . 01 { 2 } = 1 · 2 3 + 1 · 2 2 + 0 · 2 1 + 1 · 2 0 + 0 · 2 - 1 + 1 · 2 - 2 { 10 } = 8 + 4 + 1 + 0 . 25 { 10 } = 13 . 25 { 10 } 4 2 3 2 1 2 2 2 0 Binary to Decimal conversion Wednesday, April 8, 15 1101 . 01 { 2 } = 1 · 2 3 + 1 · 2 2 + 0 · 2 1 + 1 · 2 0 + 0 · 2 - 1 + 1 · 2 - 2 { 10 } = 8 + 4 + 1 + 0 . 25 { 10 } = 13 . 25 { 10 } 4 2 3 2 1 2 2 2 - 1 2 0 Binary to Decimal conversion Wednesday, April 8, 15 Subscribe to view the full document.

1101 . 01 { 2 } = 1 · 2 3 + 1 · 2 2 + 0 · 2 1 + 1 · 2 0 + 0 · 2 - 1 + 1 · 2 - 2 { 10 } = 8 + 4 + 1 + 0 . 25 { 10 } = 13 . 25 { 10 } 4 2 3 2 1 2 2 2 - 2 2 - 1 2 0 Binary to Decimal conversion Wednesday, April 8, 15 1101 . 01 { 2 } = 1 · 2 3 + 1 · 2 2 + 0 · 2 1 + 1 · 2 0 + 0 · 2 - 1 + 1 · 2 - 2 { 10 } = 8 + 4 + 1 + 0 . 25 { 10 } = 13 . 25 { 10 } 4 1101.01{2}=13.25{10} 2 3 2 1 2 2 2 - 2 2 - 1 2 0 Binary to Decimal conversion Wednesday, April 8, 15 Subscribe to view the full document.

1101 . 01 { 2 } = 1 · 2 3 + 1 · 2 2 + 0 · 2 1 + 1 · 2 0 + 0 · 2 - 1 + 1 · 2 - 2 { 10 } = 8 + 4 + 1 + 0 . 25 { 10 } = 13 . 25 { 10 } 1101 . 01 2 = 13 . 25 10 4 1101.01{2}=13.25{10} 2 3 2 1 2 2 2 - 2 2 - 1 2 0 Binary to Decimal conversion Wednesday, April 8, 15 Decimal to Binary conversion Left to right At each stage, choose the biggest power of 2 that is smaller than or equal to what you want 2^0 1 2^1 2 2^2 4 2^3 8 2^4 16 2^5 32 2^6 64 2^7 128 2^8 256 2^9 512 2^10 1024 EX) convert 322{10} to binary number 1) 2^8 = 256 < 322 < 2^9 = 512 2) choose 2^8 = 256 3) 322 - 256 = 66 4) 2^6 = 64 < 66 < 2^7 = 128 5) choose 2^6 = 64 6) 66 - 64 = 2 7) 2^1 = 2 <= 2 < 2^2 = 4 8) choose 2^1 = 2 9) 2 - 2 = 0 10) 322{10} = 101000010{2} Wednesday, April 8, 15 Subscribe to view the full document.

Decimal to Binary conversion Right to left At each step, divide by 2 until the quotient is 0. 322{10} = 101000010{2} Wednesday, April 8, 15 Shifts Multiplying by the base: shift the base point one space to the right Wednesday, April 8, 15 Subscribe to view the full document.

Shifts Multiplying by the base: shift the base point one space to the right 1101 . 01 { 2 } = 1 · 2 3 + 1 · 2 2 + 0 · 2 1 + 1 · 2 0 + 0 · 2 - 1 + 1 · 2 - 2 { 10 } = 8 + 4 + 1 + 0 . 25 { 10 } = 13 . 25 { 10 } 2 3 2 1 2 2 2 - 2 2 - 1 2 0 Wednesday, April 8, 15 Shifts Multiplying by the base: shift the base point one space to the right 1101 . 01 { 2 } = 1 · 2 3 + 1 · 2 2 + 0 · 2 1 + 1 · 2 0 + 0 · 2 - 1 + 1 · 2 - 2 { 10 } = 8 + 4 + 1 + 0 . 25 { 10 } = 13 . 25 { 10 } 2 3 2 1 2 2 2 - 2 2 - 1 2 0 2 1 2 2 2 - 1 2 0 11010 . 1 { 2 } = 1 · 2 4 + 1 · 2 3 + 0 · 2 2 + 1 · 2 1 + 0 · 2 0 + 1 · 2 - 1 { 10 } 2 3 2 4 = 16 + 8 + 2 + 0 . 5 { 10 } = 26 . 5 { 10 } Wednesday, April 8, 15 Subscribe to view the full document.

Shifts Dividing by the base: shift the base point one space to the left Wednesday, April 8, 15 Shifts Dividing by the base: shift the base point one space to the left You've reached the end of this preview.
• Spring '08
• Foster

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern