1. 20CS307 - COMPUTER ARCHITECTURE
UNIT – I
BASIC STRUCTURE OF COMPUTERS
Basic I/O operations
2. Outcome
Data transfer takes place between the Processor
and I/O Devices using a method Program-
Controlled I/O.
3. Introduction
• Basic Input Output Operations : Read in character input from
a keyboard and produce character output on a display screen
• Problem : Speed variations ( Keyboard, display, processor)
• To synchronize the transfer of data.
• Solution : on output, the processor sends the first character
and then waits for a signal from the display that the character
has been received. It then sends the second character. Input it
sent from the keyboard in a similar way.
5. Program Controlled – I / O
READ Operation:
READWAIT Branch to READWAIT if SIN = 0
Input from DATAIN to R1
WRITE Operation:
WRITEWAIT Branch to WRITEWAIT if SOUT = 0
output from R1 to DATAOUT
6. Memory-Mapped I/O
• Generally It has two types
1. Memory-Mapped I/O (Same space allocated for
I/O)
2. Isolated I/O (Separated space allocated for I/O)
• Memory-Mapped I/O used for this instruction
• MoveByte DATAIN, R1
• MoveByte R1, DATAOUT
8. Example: Program to read a line of characters typed at a keyboard and send
them out to a display device using a method of Program-Controlled I/O
MOVE #LOC, R0
READ Testbit #3,INSTATUS
Branch=0 READ
MoveByte DATAIN, (R1)
ECHO Testbit #3, OUTSTATUS
Branch=0 ECHO
MoveByte (R1), DATAOUT
Compare #CR, (R0)+
Branch #0 READ