Difference between revisions of "CSC103: DT's Notes 1"

From dftwiki3
Jump to: navigation, search
Line 165: Line 165:
 
  0001
 
  0001
 
  0002
 
  0002
  0010
+
  0010     ''(2 rolls over to 0, therefore we increment its left neighbor by 1)''
 
  ...
 
  ...
  
 
Does that make sense?  Continue and write all the numbers until you reach 1000, in base 3.
 
Does that make sense?  Continue and write all the numbers until you reach 1000, in base 3.
  
Write the first 10 numbers starting at 0 base 3.   Use as many leading 0s as makes the process easier.
+
====Evaluating Binary Numbers====
 +
 
 +
What is the decimal equivalent of the binary number 10001 in decimal?  To find out, we return to the decimal system and see how we evaluate, or find the value represented by a decimal number.  For example:
 +
 
 +
    1247
 +
 
 +
represents one thousand two hundred forty seven, and we are very good at imagining how large a quantity that is.  For example, if you were told that you were to carry 1247 pennies in a bag, you get a sense of how heavy that bag would be.
 +
 
 +
The value of 1247 is 1 x 1000 + 2 * 100 + 4 * 10 + 7 * 1.  The 1000, 100, 10, and 1 factors represent different powers of the base, 10. We can also rewrite it as  
 +
 
 +
    1247 = 1 x 10<sup>3</sup> + 2 x 10<sup>2</sup> + 4 x 10<sup>1</sup> + 7 x 10<sup>0</sup>
 +
 
 +
            = 1 x 1000 + 2 x 100 + 4 x 10 + 7 x 1
 +
            = 1247
 +
 
 +
 
 +
So the rule here is that to find the value or weight of a number written in a particular base is to multiply each digit by the base raised to increasing powers, starting with the power 0 for the rightmost digit.
 +
 
  
  

Revision as of 09:24, 31 January 2012

--© D. Thiebaut 08:10, 30 January 2012 (EST)


This section is only visible to computers located at Smith College