Basic Input/Output - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

Basic Input/Output

Description:

Title: Basic I/O Subject: Microprocessor System & Designed Author: Wannachai WANNASAWADE Last modified by: Neung Created Date: 2/8/2000 5:24:43 AM Document ... – PowerPoint PPT presentation

Number of Views:318
Avg rating:3.0/5.0
Slides: 35
Provided by: WannachaiW4
Category:

less

Transcript and Presenter's Notes

Title: Basic Input/Output


1
Basic Input/Output
Wannachai Wannasawade Department of Computer
Education Faculty of Technical Education, KMITNB.
2
Basic Input/Output
  • ?????????????????????????????????????????????????
    ????????????? ??????????????????????????????????-?
    ??????? ??????????????? I/O port
    ??????????????????????????????????????????????????
    ????????????????????????????????????
  • ????????????????????-??????????????????????????
    2 ?????????
  • ?????????? (Parallel)
  • ???????????? (Serial)
  • ?????????????????????????????????????????????????
    ????????? ?????????????????????????
    ???????????????? ?????????????????????????????????
    ??????????? ????????? 8 ??? 16 ??? 32 ??? ???? 64
    ??? ?????? ???????????????????????????????????????
    ???????????????????????????

3
Basic Input/Output
  • ??????????????????????????????? ??????????????
    ??????????????????????????? ??????????????????????
    ?????????????????????? ???????????????????????????
    ???????????????? ?????????????????????????????????
    ???? ???? ????????????????????? (Full-Duplex)
    ??????????????????? 3 ????
  • Transmit Data
  • Receive Data
  • Common Ground between Computer and Peripheral

4
Basic Input/Output
Type of Input/Output
  • Parallel I/O
  • Serial I/O
  • Programmed I/O
  • Interrupt-Driven I/O
  • Direct Memory Access

5
Basic Input/Output
I/O Instructions
?????????????????????????????????????????????????
??-???????????? ? ?????????? 2 ?????????? ?
??? IN ????????????????????????????????????????
???????-???????? OUT ????????????????????????????
?????????????????????????-????????
6
Basic Input/Output
  • Instruction Data Width Function
  • IN AL,p8 8 Read byte from port p8(8 bit) into AL
  • IN AX,p8 16 Read word from port p8(8 bit) into
    AX
  • IN EAX,p8 32 Read doubleword from port p8(8 bit)
    into EAX
  • IN AL,DX 8 Read byte from port address by DX into
    AL
  • IN AX,DX 16 Read word from port address by DX
    into AX
  • IN EAX,DX 32 Read doubleword from port address by
    DX into EAX
  • INSB 8 Read byte from port address by DX into
    Extra Segment by DI DI (,-) 1
  • INSW 16 Read word from port address by DX into
    Extra Segment by DI DI (,-) 2
  • INSD 32 Read doubleword from port address by DX
    into Extra Segment by DI DI (,-) 4

7
Basic Input/Output
Instruction Data Width Function OUT
p8,AL 8 Write byte from AL to port p8(8 bit) OUT
p8,AX 16 Write word from AX to port p8(8
bit) OUT p8,EAX 32 Write double word from EAX to
port p8(8 bit) OUT DX,AL 8 Write byte from AL to
port address by DX OUT DX,AX 16 Write word from
AX to port address by DX OUT DX,EAX 32 Write
double word from EAX to port address by
DX OUTSB 8 Write byte from Data Segment to port
address by DX SI SI(,-)1 OUTSW 16 Write
word from Data Segment to port address by DX
SI SI(,-)2 OUTSD 32 Write double word from
Data Segment to port address by DX SI
SI(,-)4
8
Basic Input/Output
???????????????? 2 ??????????????????????????????
??? Accumulator ??????????????????? (AL, AX, EAX)
??????? I/O Address ????????????? Register DX
????????? 16 ??? ???? 8 ??? ?????????? Opcode ???
Intel ????? port ???? 8 ??? (p8) ???? Fixed
Address ??? 16 ??????????????? DX ???? Variable
Address I/O Address ???????????? Port Number
???? Fixed port number (p8) ??????????????
Address 8 ??????? A0-A7 (0-255 ???? 0000H-00FFH)
???? Variable port number ???????????? Address 16
??????? A0-A15(0-65535 ???? 0000H-FFFFH) ??????
256 ????????????????????????????? Fixed port
number ??? Variable port number
??????????????????????? Variable port number
???????? ????????????????????????????????????????
???????????-?????????????????? 00XXH-03XXH
9
Basic Input/Output
Isolated I/O
???? I/O ????????????????????????????????????????
??????? I/O Address ????????? I/O ????????
Ports ????????????????????? ????????????????????
??????????????????????????????????????? I/O port
??????????????????? ??????????????????????????????
????? ???????????? M/IO ??? W/R ??????? IORC ???
IOWC Isolate I/O ????????????????????????????????
??? port ???? 8 ?????????????????? System Board
???? port ???? 16 ????????????????????????????????
??????
FFFFFH
1M X 8
0FFFFH
64K X 8
00000H
00000H
Isolate I/O
10
Basic Input/Output
Memory Mapped I/O
?????????????????????????????????????????????????
?????????? I/O ?????????????????
???????????????????????????????????? ????????
????????????????????????????? ????????????????????
???????????????????? ???????????????
???????????????????????? I/O (IN, INS, OUT, OUTS)
??????????????????????????????????????????????????
?????????????? ??? I/O ???
11
Basic Input/Output
Personal Computer I/O Mapped
Port 0000H-03FFH ?????????????????????????? Port
0400H-FFFFH ????????????????
12
Basic Input/Output
Basic Input
13
Basic Input/Output
  • Basic Input Interface
  • Three-State Buffer
  • External TTL connect to inputs of buffer
  • Outputs of buffer connect to Data bus
  • Data bus size depend on version of the
    Microprocessor such as 8086 has data bus 16 bits
    80486 has data bus 32bits and Pentium II has data
    bus 64 bits
  • Microprocessor can receive data when execute IN
    Instruction

14
Basic I/O Interface Output
15
Basic Input/Output
  • Basic Output Interface
  • Receive data from Microprocessor and must hold
    data for some external device
  • Latches or Flip-flop, like the buffers
  • Used OUT instruction then send data from AL,
    AX, EAX
  • Data must hold until next OUT Instruction
    execute

16
Basic Input/Output
  • Handshaking
  • Many I/O device much slower rate than the
    microprocessor. Thus, How to control I/O device?
  • Handshaking or Polling
  • Synchronizes the I/O with the microprocessor
  • Example Parallel Printer BUSY indicates that
    the printer busy and STB is clock pulse used to
    send data to printer

17
Basic Input/Output
Input Device ???????? ?????? TTL
??????????????????????????????????
???????????????????????? ??????????????????????
?????????????????????????????????????????
????????????????? Resistor ??????????? R Pull-up
??????????????????????? ( TTL Logic Level
0 0.0 V - 0.8 V 1 2.0 V - 5.0 V )
????????? R ??????????? 1KW - 10KW
??????????????????????????????????
??????????????????????????????????????????????????
??????????????????????????????????????????????????
??????????????????????????????????
18
Basic Input/Output
19
Basic Input/Output
20
Basic Input/Output
Output Device ??????????????????????????????????
???????? ??????????????????????
????????????????????????? ????????????????????????
???????????????????????????????? TTL
??????????????????????????????? ???????? 0
?????????????????? 0.0 V - 0.4 V ???????? 1 ???
2.4 V - 5.0 V ???????????????????????? 0
????????? 0.0 - 2.0 mA ??????????? 1 ?????????
0.0 - 400 mA
21
Basic Input/Output
22
Basic Input/Output
23
Basic Input/Output
I/O Port Address Decode
??? Decode Address ??? I/O ????????????? Decode
Address ??????????????????? I/O
?????????????????? ?????????????????????????
???????? ?????? Address ?????? ???? Decode
?????????????????????? Address A0-A31, A0-A24
???? A0-A19 ??? I/O ????????? Address ??? A0-A15
???????? ????????????????????? ??? IORC ??? IOWC
??????????? Decode ????
24
I/O Port Decoding
25
Basic Input/Output
8 Bit Decode
26
Basic Input/Output
16 Bit Decode
27
Basic Input/Output
16 Bit 2 Bank Decode
28
Basic Input/Output
16 Bit Decode
29
Basic Input/Output
32 Bit Decode
30
Use 8 LEDs
A19
A18

A0
mov al, 55 out dx, al
D7
D6
D5
D4
D3
D2
8088
D1
Minimum
D0
Mode
IOR
IOW
31
Use of 74LS245 and Address Decoder
A19
A18

A0
D7
D6
D5
D4
D3
D2
8088
D1
Minimum
D0
Mode
IOR
mov al, 55 mov dx, F000 out dx, al
IOW
32
Use of 74LS373 and Address Decoder
A19
A18

A0
D7
D6
D5
D4
D3
D2
8088
D1
Minimum
D0
Mode
IOR
mov al, 55 mov dx, F000 out dx, al
IOW
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
IOW
1
1
1
1
1
1
9
8
7
6
5
4
3
2
1
0
5
4
3
2
1
0
33
Use of 74LS245 and Address Decoder
A19
5V
A18

A0
D7
D6
D5
D4
D3
D2
8088
D1
Minimum
D0
Mode
IOR
mov dx, F000 in al, dx
IOW
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
IOR
1
1
1
1
1
1
9
8
7
6
5
4
3
2
1
0
5
4
3
2
1
0
Same address for input and output?
34
Polling
mov dx, F000 in al, dx L1 cmp al, FF je
L1
Write a Comment
User Comments (0)
About PowerShow.com