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.
| 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. |
Lecture 27 (4/2)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:
- blocking (I/O operation); operation expressed by a function call that DOES NOT RETURN until the data transfer is complete. (The I/O facilities taught in beginning programming courses are all blocking.)
- To Busy Wait: to repeatedly test a variable to determine when an operation can proceed.
- (true) Parallelism: 2 or more processes doing computations or data transfer AT THE SAME TIME. (A job with several tasks will be finished faster if it can be parallelize. Example: 100 people with shovels compared to 1)
- Processes: the computations that might run in parallel. A process is one "flow of control and data"
- Race: situation where the outcome DEPENDS on the relative timing of the operations done by several processes.
- Concurrency: 2 or more processes proceed "as if" they were parallel. Concurrency without parallelism can be implemented by interleaving (also called time sharing) the processing on one processor.
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.
to be supplied..
Lecture 28 (4/4)
Exam 2.Lecture 31 (4/20)
Copyright (C) 2001 S.Chaiken, all rights reserved.
$Id: Topic05.html,v 1.2 2001/03/26 22:46:34 sdc Exp
sdc $