Lec1Binary

Lec1Binary - CS30 Lecture 1 How high can you count on your...

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

View Full Document Right Arrow Icon
CS30 Lecture 1 How high can you count on your fingers? 10? I can count to 1023. This is because the representation you learn as a child is very inefficient. Ten show the two different ways of saying the number 2. Then show the number 505. How much is the right-most 5 worth? 5 How much is the left-most 5 worth? 500 Why are they worth different amounts? Because they are in different positions. So – the key is that even if you see the same number, if you give the different digits different values, you have different numbers. For decimal numbers, we have 10 choices of what to put in each digit. That makes the first digit the 1’s, the next the 10’s, then the 100’s, etc. What is the equation that specifies the value of the nth bit from the right? 10^n. Okay, for our fingers (and for binary), we have two position – up or down. So that means that each position must be worth twice as much as the one to the right of it. The value of the nth bit from the right is? 2^n. Computers use binary because of the physical storage. When computers started out, they used vacuum tubes that were on or off. Now, values are stored on hard drives magnetically to have a positive or negative charge, DRAM stores values in a capacitor that is either charged up or drained, and chips store values that flow electricity to 5V or ground. All of these physical devices store only two choices of values in each space. If we had some physical structure that could be easily read that stored more values in the
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

Lec1Binary - CS30 Lecture 1 How high can you count on your...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online