MC 542 Organizao de Computadores Teoria e Prtica

  • Slides: 19
Download presentation
MC 542 Organização de Computadores Teoria e Prática 2007 Prof. Paulo Cesar Centoducatte@ic. unicamp.

MC 542 Organização de Computadores Teoria e Prática 2007 Prof. Paulo Cesar Centoducatte@ic. unicamp. br www. ic. unicamp. br/~ducatte MC 542 8. 1

MC 542 Arquitetura de Computadores Input / Output “DDCA” - (Capítulo 8) MC 542

MC 542 Arquitetura de Computadores Input / Output “DDCA” - (Capítulo 8) MC 542 8. 2

Título do Capítulo Abordado Sumário MC 542 8. 3

Título do Capítulo Abordado Sumário MC 542 8. 3

Input / output • I/O Mapeado em Memória • I/O Mapedado em Espaçamento de

Input / output • I/O Mapeado em Memória • I/O Mapedado em Espaçamento de Endereço Próprio MC 542 8. 4

I/O Mapeado em Memória • O Processador acessa os dispositivos de I/O (keyboards, monitores,

I/O Mapeado em Memória • O Processador acessa os dispositivos de I/O (keyboards, monitores, printers) da mesma forma que acessa à Memória • A cada dispositivo de I/O é atribuído um ou mais endereços • Quando o endereço é utilizado o daddo é lido ou escrito no dispositivo de I/O no lugar da memória • Em geral, uma parte do espaço de endereçamento é dedicado aos dispositivos de I/O (por exemplo, endereços de 0 x. FFFF 0000 a 0 x. FFFF) MC 542 8. 5

Memory-Mapped I/O Hardware • Address Decoder: – Looks at address to determine which device/memory

Memory-Mapped I/O Hardware • Address Decoder: – Looks at address to determine which device/memory communicates with the processor • I/O Registers: – Hold values written to the I/O devices • Read. Data Multiplexer: – Selects between memory and I/O devices as source of data sent to the processor MC 542 8. 6

The Memory Interface MC 542 8. 7

The Memory Interface MC 542 8. 7

Memory-Mapped I/O Hardware MC 542 8. 8

Memory-Mapped I/O Hardware MC 542 8. 8

Memory-Mapped I/O Code • Suppose I/O Device 1 is assigned the address 0 x.

Memory-Mapped I/O Code • Suppose I/O Device 1 is assigned the address 0 x. FFFFFFF 4 – Write the value 42 to I/O Device 1 – Read the value from I/O Device 1 and place it in $t 3 MC 542 8. 9

Memory-Mapped I/O Code • Write the value 42 to I/O Device 1 (0 x.

Memory-Mapped I/O Code • Write the value 42 to I/O Device 1 (0 x. FFFFFFF 4) addi $t 0, $0, 42 sw $t 0, 0 x. FFF 4($0) Recall that the 16 bit immediate is sign-extended to 0 x. FFFFFFF 4 MC 542 8. 10

Memory-Mapped I/O Code • Read the value from I/O Device 1 and place it

Memory-Mapped I/O Code • Read the value from I/O Device 1 and place it in $t 3 sw $t 3, 0 x. FFF 4($0) MC 542 8. 11

Example I/O Device: Speech Chip • Allophone: fundamental unit of sound, for example: –

Example I/O Device: Speech Chip • Allophone: fundamental unit of sound, for example: – “hello” = HH 1 EH LL AX OW • Each allophone assigned a 6 -bit code, for example: – “hello” = 0 x 1 B 0 x 07 0 x 2 D 0 x 0 F 0 x 20 See www. speechchips. com MC 542 8. 12

Speech Chip I/O • A 6: 1: allophone input • ALD: allophone load (low-asserted,

Speech Chip I/O • A 6: 1: allophone input • ALD: allophone load (low-asserted, i. e. loads the address when ALD goes low) • SBY: standby, indicates when the speech chip is standing by waiting for the next allophone MC 542 8. 13

Driving the Speech Chip 1. Set ALD to 1 2. Wait until the chip

Driving the Speech Chip 1. Set ALD to 1 2. Wait until the chip asserts SBY to indicate that it has finished speaking the previous allophone and is ready for the next one 3. Write a 6 -bit allophone to A 6: 1 4. Reset ALD to 0 to initiate speech MC 542 8. 14

Memory-Mapping the I/O Ports • A 6: 1: 0 x. FFFFFF 00 • ALD:

Memory-Mapping the I/O Ports • A 6: 1: 0 x. FFFFFF 00 • ALD: 0 x. FFFFFF 04 • SBY: 0 x. FFFFFF 08 MC 542 8. 15

Software Driver for the Speech Chip init: addi lui addi start: sw loop: lw

Software Driver for the Speech Chip init: addi lui addi start: sw loop: lw beq add lw sw sw addi beq j $t 1, $t 2, $t 3, $t 4, $0, 1 $0, 20 0 x 1000 $0, 0 # # $t 1 $t 2 $t 3 $t 4 = = 1 array size * 4 array base address 0 (array index) $t 1, 0 x. FF 04($0) $t 5, 0 x. FF 08($0) $0, $t 5, loop # ALD = 1 # $t 5 = SBY # loop until SBY == 1 $t 5, $t 3, $t 4 $t 5, 0($t 5) $t 5, 0 x. FF 00($0) $0, 0 x. FF 04($0) $t 4, 4 $t 4, $t 2, done start # # # # $t 5 = address of allophone $t 5 = allophone A 6: 1 = allophone ALD = 0 to initiate speech increment array index last allophone in array? repeat done: MC 542 8. 16

Hardware for Supporting SP 0256 MC 542 8. 17

Hardware for Supporting SP 0256 MC 542 8. 17

SPO 256 Pin Connections MC 542 8. 18

SPO 256 Pin Connections MC 542 8. 18

Summary • You have learned about: – Combinational and sequential logic – Schematic and

Summary • You have learned about: – Combinational and sequential logic – Schematic and HDL design entry – Digital building blocks: adders, ALUs, multiplexers, decoders, memories – Assembly language – computer architecture – Processor design – microarchitecture • The world is an increasingly digital place • You have the tools to design and build powerful digital circuits that will shape our world • Use this power wisely and for good! MC 542 8. 19