Topic 5: Input and Output

  • Lecture 23 (3/23)
  • Links to Unified Modeling Language (UML) material:

    A Sequence Diagram From Rational Software Corporation: http://www.rational.com/images/uml/resources/quick/uml_inter1.gif
     What is UML? http://www.omg.org/gettingstarted/specintro.htm#UML
     UML 1.3 Specifictation  http://www.omg.org/cgi-bin/doc?formal/2000-03-01
     Local gzipped pdf copy
     The Object Management Group http://www.omg.org
     OMG's Specifications  http://www.omg.org/gettingstarted/specintro.htm
     Common Object Request Broker Architecture (CORBA)  http://www.omg.org/gettingstarted/corbafaq.htm
     Rational Software Corporation's UML page: http://www.rational.com/uml
  • Registers used for I/O in  Mano's basic computer: Mano's figure 5-12 plus IEN and R (ignore IEN and R for next 2 lectures).
  • Need to signal printer to print the character from OUTR in addition to copying the new character there.
  • Sequence diagram for printing a character drawn on blackboard.
  • Time to print a character on an inkject printer (0.001 sec. = 10^-3 sec.) compared to clock cycle times of computers

  • (Late 60's: < 10^-6 sec, 2001: 10^-9 sec).  Mano computer could execute 500 instruction or so between printing two characters.
  • Mano assembly code seq (Table 6-19) to output one character.
  • RTL description for output instructions:  OUT and SKO; related to the registers.
  • Lecture 24 (3/26)
  • Registers used for I/O in Mano's Basic Computer

     
    Register Name and Size Description How set and used
    IEN (1 bit) Interrupt Enable Set by ION instruction 
    Unset by IOFF instruction and interrupt taking action.
    FGI (1 bit) Input Ready Flag Input device sets FGI to indicate data is "ready" 
    CPU unsets FGI to activate the device to start 
    getting new input data.  The INP instruction unsets FGI. 
    The CPU tests FGI with the SKI instruction. 
    When IEN=1, setting FGI causes an interrupt.
    FGO (1 bit) Output Ready Flag Output device sets FGO to indicate it is "ready" to accept data from the CPU. 
    CPU resets FGO to activate the device to accept the output data.  The OUT instruction unsets FGO. 
    The CPU tests FGO with the SKO instruction. 
    When IEN=1, setting FGO causes an interrupt.
    INPR (8 bit) Buffer for input characters. Written by input device when FGI goes to 0. 
    Read (copied to AC) by INP instruction
    OUTR (8 bit) Buffer for output characters. Read by output device when FGO goes to 0 
    Written by OUT instruction.
    R (1 bit ) InteRrupt pending Set when (IEN)(FGI+FGO)=1 
    If it is set, the CPU will take an interrupt cycle after the current instructon cycle completes.  Part of the interrupt cycle will 
    set R<-0.

    Steps of an output transfer:

    1. Initially, FGO=1
    2. Computer checks FGO with SKO instruction, (see b on page 203)

    3.         LDA   CHAR  /AC now contains the character to output
         COF, SKO         /Test FGO flag
              BUN   COF   /Loop if output device isn't ready.
              OUT         /Transmit character to output device.
    4. Computer finds FGO=1
    5. Computer executes OUT instruction, this sets FGO<-0
    6. Output device starts to output the character

    7. A VERY LONG TIME PASSES....(if the computer has another char, it will run the above loop)
    8. Output device is ready to accept a new character; it sets FGO<-1 to indicate this.

    Steps of an input transfer:

    Lecture 25 (3/28) Lecture 26 (3/30)
  • Example of a race explained:  One process runs

  • LOOP, INP
          STA  PCH  I
          ISZ  PCH
          BUN  LOOP
          BUN  LOOP
    PCH,  HEX  100
    The other process has a person (or monkey) pressing keys, which make new data go into the INP register.
    (Review of how this is assembled)
    Run of these processes explained with a 2 rail sequence diagram:  It is indeterminate how many copies of each input character are stored in memory.
    (direct and indirect addressing compared)
  • Some vocabulary:
  • Tri-state buffer devices explained:  When the control input C=0, the output is disconnected (high impedance).  Whe C=1, the output is connected to ground when data input D=0, and to the (high voltage) power source when D=1.
  • Role of tri-state buffers in computer busses.  Slots for plugging in peripheral cards mentioned.
  • Lecture 27 (4/2)

    to be supplied..

    Lecture 28 (4/4)

    Lecture 29 (4/6) Lecture 30 (4/18)
    Exam 2.
    Lecture 31 (4/20) Lecture 32 (4/23)
     

    Copyright (C) 2001 S.Chaiken, all rights reserved.
    $Id: Topic05.html,v 1.2 2001/03/26 22:46:34 sdc Exp sdc $