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

From dftwiki3
Jump to: navigation, search
Line 172: Line 172:
 
====Evaluating Binary Numbers====
 
====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:
+
What is the decimal equivalent of the binary number 11001 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
 
     1247
Line 187: Line 187:
  
 
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.
 
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.
 +
 +
Let's try that for the binary number 11001.  The base is 2 in this case, so the value is computed as:
 +
 +
    1 x 2<sup>4</sup> + 1 x 2<sup>3</sup> + 0 x 2<sup>2</sup> + 0 x 2<sup>1</sup> + 1 x 2<sup>0</sup>
 +
 +
  = 1 x 16 + 1 x 8 + 0 x 4 + 0 x 2 + 1 x 1
 +
 
 +
  = 16 + 8 + 0 + 0 + 1
 +
 
 +
  = 25 in decimal
  
  

Revision as of 09:27, 31 January 2012

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


This section is only visible to computers located at Smith College