User Tools

Site Tools


haas:spring2014:cprog:common:moarlogic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
haas:spring2014:cprog:common:moarlogic [2014/02/11 10:09] – created wedgehaas:spring2014:cprog:common:moarlogic [2014/02/13 16:15] (current) wedge
Line 25: Line 25:
 </code> </code>
  
-The answer is '2'. 1 bit gives us 2 distinct states (which is why binary is used on the computer-- on/off, true/false, 1/0). This is akin to a single manual lightswitch on the wall... it can be set to give light, or turn on the dark.+The answer is '2'. 1 bit gives us 2 distinct states (which is why binary is used on the computer-- on/off, true/false, 1/0). This is akin to a single manual lightswitch on the wall... it can be set to be light, or turn on the dark.
  
 However, having many bits together representing a value can be problematic for us, because if we make a typo, the whole value can be thrown off (and with computers being such precise instruments, will cause them problems). However, having many bits together representing a value can be problematic for us, because if we make a typo, the whole value can be thrown off (and with computers being such precise instruments, will cause them problems).
Line 72: Line 72:
 And what about that stray 0 in front? Ignore it. WHO CARES. 0 in front doesn't modify the value. And what about that stray 0 in front? Ignore it. WHO CARES. 0 in front doesn't modify the value.
  
-If you were getting $4, would it be any more advantageous to get $0004?+If you were getting <nowiki>$</nowiki>4, would it be any more advantageous to get <nowiki>$</nowiki>0004?
  
 See how much shorter it is? MUCH easier to write. LESS opportunity for error. See how much shorter it is? MUCH easier to write. LESS opportunity for error.
haas/spring2014/cprog/common/moarlogic.1392113343.txt.gz · Last modified: 2014/02/11 10:09 by wedge