CS225,  Fall 2006,  Monday Nov. 27, Day 38 After class Hit reload!


HW Day 38, Due Wednesday Day 39   (4 class days after today) 

A) Continue with programming. 
Presentation to the world, Friday, Dec. 8, (in Study Week.) Time??? Monday, Dec. 4, 12-1 in computer lab 100 (2nd to last class).  We will NOT be reworking any more code in class.
Post on the Wiki ASAP,  what you have working (however simple); or if not, something whose bugs you can't solve.
Have ready to hand in, Last class or at Presentation, printed out: your code, cover pages (Sub documentation. Algorithm if not obvious), Self-evaluation

 
B) YES (See Day 29 for notes) Fancier Addressing modes: 
Investigate n (indirect),  sf, sx, sfx, "cold" using RTL (p. A4)
   a) Tell in words what each one does.  Use as the operand specifier 0003, tell what is done to compute the operand.
    b)  Use an imaginary set of microcode operations, on registers B, C, D (and A and X and SP), with our usual operations and more operations which can, for example
         Move B, D  Copy contents of D to B
         AddB, A   Add contents of register A to B
         AddB, Mem[A]   Treat the contents of register A as an address.  Go to that address and add the value at that address to register B.
        (make up any  more you need, using the registers more freely than we actually can.)
      Now write  "microcode" which will calculate the Operand from the OprndSpec, for each of n, sf, sx, sfx addressing modes.
   Note, for each,  how many times  you have to go get something from a memory location.

Amnesty extended again:  Any  old "Programs" handed in  by last day of classes will be only 1 day late.

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

Notes: 
I will happily debug code posted on the Wiki, turnaround time 4-12 hours, or less if you catch me.  You should debug each other's also, but in discussion, not in the code itself! (too confusing)

The Source page now has a working main, with some quirks. 

This week I will spend class time discussing various aspects of computer architecture.
 (Things you will be responsible for on the take-home final)

More about addressing modes  Day 29

"Microcode"  translates and executes assembly language instructions, inside the microprocessor "chip"
     
More complicated instructions take longer: 
"Clock" period or cycle, like metronome. 
   -- Synchronizes everything.  Small things happen in each cycle. Equally long. 
         click do something, relax & wait, click do something relax, click.... 
   -- Can't make cycle shorter than the longest thing that needs to be done in a cycle.   Pushing too fast may cause physical problems (signals don't die out, etc.)

Null & Lobur  pp. 151-2:  "Speed " = clock frequency:  MHz = million cycles per second. 
     800MHz machine:  one clock cycle is 1/800,000,000 sec. long = 1.25 nanoseconds.

A Real (somewhat oldfashioned)  chip
<>MC68000 chip (Macintosh "Classic"~ 1989)  (user's manual ch. 8)  8 registers for data, 8 for holding addresses!
Move a (16-bit word)  from one register to another : 4 clock cycles
     What we call direct addressing (operand is at the address given by the opspec.)  : 8 for one, 12 for two (memory to memory)
     indexed (add an index)  : 10 cycles
     add  from memory : 8
      add from a register  : 4
      not :4
      multiply : 70!!!
    ASR n bits:  6+2n
    Branch on condition:  If branching <16 addresses away: 10 if taken (2 memory accesses)  , 8 (1 memory access) if not taken 
                                      But if branching > 16 away, 10 if taken, 12 (2 memory access) if not taken.   (curious!!)
  Complicated instructions, e.g.
Move contents of a sequence of n registers to/from memory. (used to preserve or pass registers, before/after procedure call)
   to:  12 + 4n,   From 8+4n

Moral:  all different lengths.  More complicated microcode = longer.
Every one has to at least read the instruction from memory (min. 4) but then stuff in/between registers is usually fast. 
In and out of memory is min. 4 per load/store.

How will this develop as physical capabilities increase?



To Sievers Home Page
CS225-Fall06/Daya38.htm 
9:30 pm, 11/26/06
This page belongs to Sally Sievers who is solely responsible for its content. Please see our statement of responsibility.