Lecture03-w02-LIN-09092019-Printf-BinaryConversion.pdf - Computing I COMP.1010 COMP.1010,Spring Fall 2019 2019 Lecture 3 Basics in C — Decimal to

# Lecture03-w02-LIN-09092019-Printf-BinaryConversion.pdf -...

• 29

This preview shows page 1 - 9 out of 29 pages.

Computing I By: Sirong Lin, PhD COMP.1010, Spring 2019 University of Massachusetts Lowell COMP.1010, Fall 2019 Lecture 3: Basics in C — Decimal to Binary & Printf
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Take a worksheet packet Form group of 3 (or 2, 4), each group better has one computer 2
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Upcoming Due Dates 3 Due Date Daily 01 09-09-2019 (M), 9:00pm Week 01-Reading & Practice 09-10-2019 (Tu), 9:00pm Daily 02 09-11-2019 (W), 9:00pm Daily 03 09-13-2019 (F), 9:00pm Week 02 Reading 1-3 MWF, 9:00am Week 02 Practice 09-15-2019 (Su), 9:00pm
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin 5 Represent (unsigned) numbers in Binary Binary System Binary->Decimal Decimal->Binary
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Decimal —> Binary (Method 1) 6 Short Division by Two with Remainder Idea: start from the least power of 2, find how many 1s, 2s, 4s… 27, 16, 156 in binary? 1024 512 256 128 64 32 16 8 4 2 1 2 3 2 2 2 1 2 0 2 10 2 4 2 9 2 5 2 6 2 7 2 8 Place Value
Work Ready Life Ready World Ready Computing I, F2019, By Dr. Sirong Lin Decimal —> Binary (Method 1) (Cont’d) 8 Repeat dividing the number by 2 until the quotient is zero Translated number is read bottom up, recording the bits from left to right.

#### You've reached the end of your free preview.

Want to read all 29 pages?

• Fall '15

### 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