Inp. Opt. of Bc, Interrupt Initiated IO Design of Basic Computer&AC
Inp. Opt. of Bc, Interrupt Initiated IO Design of Basic Computer&AC
Receiver
Printer OUTR
Interface
Transmitter
Keyboard INPR
Interface
FGI
Er. Pavitar Singh [email protected] CSE 3 rd Sem CA
3
Input-Output of basic computer
A computer can serve no useful purpose unless it communicates with
the external environment.
To exhibit the most basic requirements for input and output
communication, we will use a terminal unit with a keyboard and
printer.
The terminal sends and receives serial information and each quantity of
information has eight bits of an alphanumeric code.
The serial information from the keyboard is shifted into the input
register INPR.
The serial information for the printer is stored in the output register
OUTR.
These two registers communicate with a communication interface
serially and with the AC in parallel.
- The I/O interface, instead of the CPU, monitors the I/O device.
- When the interface founds that the I/O device is ready for data transfer, it
generates an interrupt request to the CPU
Execute =0
IEN
instructions
=1 Branch to location 1
PC 1
=1
FGI
=0
=1 IEN 0
FGO R0
=0
R1
Main Main
255 Program 255 Program
PC = 256 256
1120 1120
I/O I/O
Program Program
1 BUN 0 1 BUN 0
=0(Instruction =1(Interrupt
R
Cycle) Cycle)
R’T0 RT0
AR PC AR 0, TR PC
R’T1 RT1
IR M[AR], PC PC + 1 M[AR] TR, PC 0
R’T2 RT2
AR IR(0~11), I IR(15) PC PC + 1, IEN 0
D0...D7 Decode IR(12 ~ 14) R 0, SC 0
11
Description
COMPLETE COMPUTER DESCRIPTION
Microoperations
Fetch RT0: AR PC
RT1: IR M[AR], PC PC + 1
Decode RT2: D0, ..., D7 Decode IR(12 ~ 14),
AR IR(0 ~ 11), I IR(15)
Indirect AR M[AR]
D7IT3:
Interrupt
T0T1T2(IEN)(FGI + FGO): R1
AR 0, TR PC
RT0: M[AR] TR, PC 0
RT1: PC PC + 1, IEN 0, R 0, SC 0
Memory-ReferenceRT2:
AND DR M[AR]
D0T4: AC AC DR, SC 0
ADD D0T5: DR M[AR]
D1T4: AC AC + DR, E Cout, SC 0
LDA DR M[AR]
D1T5:
AC DR, SC 0
STA D2T4:
M[AR] AC, SC 0
BUN D2T5: PC AR, SC 0
BSA D3T4: M[AR] PC, AR AR + 1
D4T4: PC AR, SC 0
ISZ D5T4: DR M[AR]
D5T5: DR DR + 1
D6T4: M[AR] DR, if(DR=0) then (PC PC + 1),
D6T5: SC 0
D6T6:
12 Er. Pavitar Singh [email protected] CSE 3 rd Sem CA
Description
COMPLETE COMPUTER DESCRIPTION
Microoperations
Register-Reference
D7IT3 = r (Common to all register-reference instr)
IR(i) = Bi (i = 0,1,2, ..., 11)
r: SC 0
CLA AC 0
rB11:
CLE E0
CMA rB10:
AC AC
CME rB9: E E
CIR rB8: AC shr AC, AC(15) E, E AC(0)
CIL rB7: AC shl AC, AC(0) E, E AC(15)
INC rB6: AC AC + 1
SPA rB5: If(AC(15) =0) then (PC PC + 1)
SNA rB4: If(AC(15) =1) then (PC PC + 1)
SZA If(AC = 0) then (PC PC + 1)
SZE rB3:
If(E=0) then (PC PC + 1)
HLT rB2: S0
rB1:
Input-Output rB0: (Common to all input-output instructions)
(i = 6,7,8,9,10,11)
D7IT3 = p SC 0
INP IR(i) = Bi AC(0-7) INPR, FGI 0
OUT p: OUTR AC(0-7), FGO 0
SKI pB11: If(FGI=1) then (PC PC + 1)
SKO If(FGO=1) then (PC PC + 1)
ION pB10:
IEN 1
IOF pB9: IEN 0
pB8:
13 pB7:
Er. Pavitar Singh [email protected] CSE 3 rd Sem CA
pB6: