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

From dftwiki3
Jump to: navigation, search
Line 859: Line 859:
 
   04: 20 00    ''(Go back to Line 00)''
 
   04: 20 00    ''(Go back to Line 00)''
  
So now, even though this simple game is far from sophisticated or even fully functional, it should illustrate the principle that are at play when a processor executes a program that resides in memory.  We explore this in the next section.
+
So now, even though this simple game is far from sophisticated or even fully functional, it should illustrate the principle that are at play when a processor executes a program that resides in memory.  We explore this in the next section.  By the way, if while reading the last ''algorithm'' shown above you thought to yourself "Hmmm... something strange is going to happen when we reach the last student in the class...", then you have a very logical mind, and Yes, indeed, you are right, our algorithm is not quite correct.  But it's enough to get our point across.
  
  
Line 871: Line 871:
 
We are very close to understanding how the processor runs programs.  We have seen that computers work with electricity, and that information is coded as 0s and 1s.  We refer to an information cell that contains a 0 or a 1 as a ''bit''.    The memory is a collection of boxes that contain bits.  We refer to these boxes as ''words''.  ''Memory words''.
 
We are very close to understanding how the processor runs programs.  We have seen that computers work with electricity, and that information is coded as 0s and 1s.  We refer to an information cell that contains a 0 or a 1 as a ''bit''.    The memory is a collection of boxes that contain bits.  We refer to these boxes as ''words''.  ''Memory words''.
  
 +
The memory is a collection of billions of memory words, each one storing a collection of bits.  We saw earlier that a collection of bits can actually represents a binary number, and each binary number has an equivalent decimal number.  So we can actually say that the memory is a collection of cells that contain numbers.  It's easier for us human to deal with decimal numbers, so that's what we are going to do in the remainder of this section, but actually all the numbers in questions are binary.  Makes sense?
  
 +
So, here's how we can view the memory:
 +
 +
 +
              +-------------+
 +
  1000000000  |    45      |
 +
      +-------------+
 +
            .           .
 +
            .           .
 +
            .           .
 +
      +-------------+
 +
          10  |  1103      |
 +
              +-------------+
 +
          9  |      0      |
 +
              +-------------+
 +
          8  |      7      |
 +
              +-------------+
 +
          7  |      1      |
 +
              +-------------+
 +
          6  |    13      |
 +
              +-------------+
 +
          5  |      7      |
 +
              +-------------+
 +
          4  |      0      |
 +
              +-------------+
 +
          3  |    10      |
 +
              +-------------+
 +
          2  |      5      |
 +
              +-------------+
 +
          1  |    103      |
 +
              +-------------+
 +
          0  |      3      |
 +
              +-------------+
 +
 +
 +
 +
It's a long structure made up of words
 
{| style="width:100%; background:#FFC340"
 
{| style="width:100%; background:#FFC340"
 
|-
 
|-

Revision as of 21:24, 3 October 2012

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



This section is only visible to computers located at Smith College













.