{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

How_Computers_Represent_Numbers

# How_Computers_Represent_Numbers - HOW COMPUTERS REPRESENT...

This preview shows pages 1–2. Sign up to view the full content.

HOW COMPUTERS REPRESENT NUMBERS EGM 3344 Chapra “Applied Numerical Methods” Chapter 4 I. Integer Representation Illustration: How do we teach children to count? Using their fingers. Counting by 10’s is easy because we learn to count using our 10 fingers. If we want to count to 20, we just count to 10 2x, that is we count be 10’s. So whether you realize it not, every time you use a number, you are representing it as some combination of powers of 10. For example, 2 1 0 173 1 10 7 10 3 10 = × + × + × Note that every time one of our digits gets to 9, we flow over into the next group of 10. So if we went from 179 to 180, the 0 10 slot would go back to 0 and the 1 10 slot would move up to 8. This is what we call a base-10 system. Easy, right? But let’s say I wasn’t a human being but rather a space alien with only one finger on each hand. I would want to count using a base-2 system. How in the world does that work? Well, instead of re-setting to zero every time a digit went from 9 to 10, we would re-set to zero every time a digit went from 1 to 2. So in base-10, 0123456789 then reset to 0, while in base-2, 01 then reset to 0. How would we represent the number 173 in base-2? Let’s write the base-10 representation of 173 in a slightly different way to see how we would do it in base 2: k k 10 Number Value Difference 173 2 100 1 100 73 1 10 7 70 3 0 1 3 3 0 (Number must be 012345678 or 9) So the base-10 representation of 173 is 173. Question: Using the same methodology, what is the base-2 representation of 173?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ 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