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

From dftwiki3
Jump to: navigation, search
Line 1,147: Line 1,147:
 
In summary, the processor is designed to quickly access all the memory words in series, and absorbs the numbers that they contain.  And it does this very fast and automatically.  But what does it do with the numbers, and what do the numbers mean to the processor?
 
In summary, the processor is designed to quickly access all the memory words in series, and absorbs the numbers that they contain.  And it does this very fast and automatically.  But what does it do with the numbers, and what do the numbers mean to the processor?
  
These numbers form a code.  The same type of code we used in the silly game we introduced earlier.  Just as we could have numbers coding sentences of a conversation, different numbers will mean different actions to take for the processor.  We are going to refer to these actions as ''instructions''.  The collection of instructions as a ''program''.  A program implements an ''algorithm'', which is a description of how a result should be computed without specifying the actual nitty gritty details. The set of all the instructions and the rules for how to use them is a called ''assembly language.''
+
These numbers form a code.  The same type of code we used in the silly game we introduced earlier.  Just as we could have numbers coding sentences of a conversation, different numbers will mean different actions for the processor to take .  We are going to refer to these actions as ''instructions''.   
 +
<br />
 +
<bluebox>
 +
;Definitions
 +
:The collection of instructions as a ''program''.  A program implements an ''algorithm'', which is a description of how a result should be computed without specifying the actual nitty gritty details.  
 +
:The set of all the instructions and the rules for how to use them is a called ''assembly language.''
 +
</bluebox>
 +
<br />
  
But there is another subtlety here.  Not all numbers are instructions.  Just as in our games some numbers corresponded to sentences and others words that needed to be added at end of sentences ("did you like", "homework" for example), some numbers represent actions, while others are just regular numbers.  When the processor starts absorbing the contents of memory cells, it assumes that the first number it's going to get is an instruction.  When it analyzes this number internally
+
But there is another subtlety here.  Not all numbers are instructions.  Just as in our games some numbers corresponded to sentences and others words that needed to be added at end of sentences ("did you like", "homework" for example), some numbers represent actions, while others are just regular numbers.  When the processor starts absorbing the contents of memory cells, it assumes that the first number it's going to get is an ''instruction''.  An instruction is usually followed by a ''datum''.  A program is thus a collection of instructions and data. 
 +
 
 +
Thinking of the memory as holding binary numbers that can be instructions or data, and that are organized in a logical way so that the processor always knows which is which was first conceived by '''John von Neumann''' in a famous report he wrote in 1945 titled "[http://cs.smith.edu/dftwiki/images/f/f8/VonNewmannEdvac.pdf First Draft of a Report on the EDVAC]" <ref name="edvac">John von Neumann.  First Draft of a Report on the EDVAC. IEEE Ann. Hist. Comput. 15, 4 (October 1993), 27-75.</ref>This report was not officially published until 1993, but circulated among the engineers of the time and his recommendations for how to design a computing machines are still the base of today's computer design.  In his report he suggested that computers should store the code and the data in the same medium, which he called ''store'' at the time, but which we refer to as ''memory'' now.  He suggested that the computer should have a unit dealing with understanding the instructions and executing them (the ''control unit'') and a unit dedicated to perform operations (today's ''arithmetic and logic unit'').  He also suggested the idea that such a machine needed to be connected to peripherals for inputting programs and outputting results.  This is the way modern computers are designed.
  
 
{| style="width:100%; background:#FFD373"
 
{| style="width:100%; background:#FFD373"
 
|-
 
|-
 
|
 
|
===The Cookie Monster===
+
===The Cookie Monster Analogy===
 
|}
 
|}
 
[[File:CookieMonsterPacMan.png|right|150px]]
 
[[File:CookieMonsterPacMan.png|right|150px]]
Line 1,176: Line 1,185:
 
time will go fetch the contents of Memory Location 1.
 
time will go fetch the contents of Memory Location 1.
  
This means that the numbers that are stored in memory will represent some action to be performed by the
+
This means that the numbers that are stored in memory represent some action to be performed by the
processor.  They represent a ''code''.  That code defines a language.  We call it ''Assembly Language''.
+
processor.  They implement a ''code''.  That code defines a ''language''.  We call it ''Assembly Language''.
 
Instead of trying to remember the number associated with an action, we use a short word, a ''mnemonic''
 
Instead of trying to remember the number associated with an action, we use a short word, a ''mnemonic''
 
that is much easier to remember than the number.  Writing a series of mnemonics to instruct the processor
 
that is much easier to remember than the number.  Writing a series of mnemonics to instruct the processor
Line 1,197: Line 1,206:
 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOD-C  11
 
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOD-C  11
  
The instruction above would mean load the number 11 into AC.
+
The instruction above means load the number 11 into AC.
  
 
Before we write a small program we need to learn a couple more instructions.
 
Before we write a small program we need to learn a couple more instructions.

Revision as of 19:13, 28 September 2013

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



This section is only visible to computers located at Smith College













.