chp3 designing bus system, memory & io copy

37
Designing Bus System, Memory & I/O

Upload: mkazree

Post on 25-May-2015

1.943 views

Category:

Education


3 download

TRANSCRIPT

Page 1: Chp3 designing bus system, memory & io   copy

Designing Bus System, Memory & I/O

Page 2: Chp3 designing bus system, memory & io   copy

The 68k Address & Data Bus

• 16-bit wide data bus

• 24-bit address bus

• A0 bit controls and signals

D15 D0D8 D7

UDS LDS

LDSUDS

Page 3: Chp3 designing bus system, memory & io   copy

The 68k Address & Data BusCont…

Page 4: Chp3 designing bus system, memory & io   copy

Example

1. Explain the different functions of the internal A0 bit when used for:

a. byte addressingb. word addressing

a. A0 is used to activate UDS or LDS

b. A0 is ignored, UDS and LDS are both low

Page 5: Chp3 designing bus system, memory & io   copy

Example

2. Show the states of UDS and LDS when the 68000 is involve in the following memory accesses:a. a byte write to address 3000b. a byte write to address 3001c. a word write to address 3000

a. UDS = 0, LDS = 1b. UDS = 1, LDS = 0

c. UDS = 0, LDS = 0

Page 6: Chp3 designing bus system, memory & io   copy

Bus Buffering

CPU Memory

Control

Data

Address bidirectionalunidirectional

Page 7: Chp3 designing bus system, memory & io   copy

Accessing MemoryRead Data from Memory

Page 8: Chp3 designing bus system, memory & io   copy

Memory AccessingCont…Read Data from Memory

Page 9: Chp3 designing bus system, memory & io   copy

Memory AccessingWrite Data to Memory

Page 10: Chp3 designing bus system, memory & io   copy

Memory AccessingCont…Write Data to Memory

Page 11: Chp3 designing bus system, memory & io   copy

Designing a Memory Address Decoder

• monitor the state of the address bus• determine right time to enable the

memory chip• facilitate address bus and configure

time to activate memory chip• Memory chip: RAMs or EPROMs

Page 12: Chp3 designing bus system, memory & io   copy

Designing a Memory Address Decoder

Cont…

EPROMor

SRAM

CS*

SEL*

AS*

Memory AddressDecoder

Address bus

Valid AddressA1-A23

AS*

SEL*

• 68000 contain many devices.

• Only one can communicate with up at one time.

• Address Decoder select only one active device

Page 13: Chp3 designing bus system, memory & io   copy

Designing a Memory Address Decoder

Cont…

P

AS*

Address bus Address bus lower section

Address bus upper section

Addressdecoder

Device selector

RAM switch LED ROM

Page 14: Chp3 designing bus system, memory & io   copy

Full Address Decoder

• Challenge: The designer of the memory decoder is to chip-enable the memory device at the correct time.

• Steps: 1. Determine the address range for device

a. find the first address of the RAM (base address)b. what is the entire range of RAM addressesc. find the last address

2. Determine which address line go to memory and the decodera. find the sum of line address at the deviceb. low address line from the uP go to the memoryc. balance of the address go to the decoder

3. Design a decoder to detect the require address line by using digital gets

Page 15: Chp3 designing bus system, memory & io   copy

Full Address Decoder

Example 3.1:Determine the address range for 2764 chip used for EPROM.

Solution:• All EPROM in 68k system must start at

$000000• One 2764 chip contain 8kbyte.• For 68000, must be used coupled• If we are using 2 chip, the EPROM size is 8

kbyte x 2 = 16kb

Cont…

Page 16: Chp3 designing bus system, memory & io   copy

Full Address Decoder

Address line calculation: Address line = Log2 Address

= Log2 16 kilobyte

= Log2 16(1024)

= Log10 16384 / log10 2 = 14 lines

a. Base address : $000000b. Entire range : 16384 (0 – 16383)c. Last EPROM address : 1638310 =$ 003FFF

Cont…

Page 17: Chp3 designing bus system, memory & io   copy

Full Address Decoder

For 68000a. A0 : no connectionb. A1-A14 : 14 direct line to 2764

c. A15-A23 : to decoder

Cont…

ROM16kbyte

Not used

Memory Map

$000000

$3FFFFF$400000

$FFFFFF

Page 18: Chp3 designing bus system, memory & io   copy

Full Address Decoder

Example 3.2:A memory device consist 64 word (128kbyte),

RAM must be interface with 68000. Base address $480000.

Solution:1.Memory started at $480000:

Location : $480000 + $20000 = $4A0000Last Address : $4A0000 – 1 = $49FFFFAddress range : $480000 - $49FFFF

Cont…

Page 19: Chp3 designing bus system, memory & io   copy

Full Address Decoder

2. Determine the address line connected to address decoder

$480000 = 0100 1000 0000 0000 0000 0000$49FFFF = 0100 1001 1111 1111 1111 1111

Start from right:A1-A16 : direct to memoryA0 : directly to UDS* and LDS*Checking : 217 = 128k So line balance A17- A23 go to decoder

Cont…

Page 20: Chp3 designing bus system, memory & io   copy

Full Address Decoder

3. Design circuit that sense AS* = 0 and A23-A17 = 0100100

Circuit below decode $480000 - $49FFFF address by

detecting A23-A17 = 0100100

Cont…

Page 21: Chp3 designing bus system, memory & io   copy

Full Address DecoderCont…

Page 22: Chp3 designing bus system, memory & io   copy

Partial Address Decoder

• Most of the applications would require much smaller memories

Challenge:• To reduce logic when developing memory decoder

Steps:1. Determine address range for every device

a. find starting address (base address)b. find Device sizec. find Last address

2. Determine the total of address line for every device that go directly to memorya. find the total of address line in the deviceb. low address line from the µP go directly to the memory.

3. Use the decoder to activated one device at a time by referring on the address line balance & total of device

Page 23: Chp3 designing bus system, memory & io   copy

Partial Address Decoder

Example 3.3: Designing partial decoder• RAM : start address $400000, 64k word (128k byte)• ROM : start address $000000, 16k word (32k byte)• I/O : address $800000-$80001F

Steps:• RAM : $400000 ~ $41FFFF ($400000 + 128k –1)• ROM : $000000 ~ $007FFF ($000000 + 32k – 1)• I/O : $800000 ~ $ 80001F

Place X in the address table • RAM: A0 –A16 directly to device• ROM: A0 – A14 directly to device• I/O :A0 –A4 directly to device

Cont…

Page 24: Chp3 designing bus system, memory & io   copy

Partial Address DecoderCont…

Choose minimum address line: A23 & A22

Page 25: Chp3 designing bus system, memory & io   copy

Partial Address DecoderCont…

Design using ½ 74LS139

Page 26: Chp3 designing bus system, memory & io   copy

Partial Address DecoderCont…

Design using full 74LS139

Page 27: Chp3 designing bus system, memory & io   copy

Generating

• Data transfer acknowledge• A signal that tells the 68K CPU data may be

read from or written into memory• Synchronize memory access time

Page 28: Chp3 designing bus system, memory & io   copy

Generating

Example 3.4: A typical RAM might require 100ns to become active after it gets enabled. This due to the time required by the internal RAM circuitry to correctly decode the supplied address and turn on its internal buffers. This 100ns access time must fits within the time frame of the memory read or writes cycle, or else problems such as data loss might arise. So is needed.

Cont…

Page 29: Chp3 designing bus system, memory & io   copy

Direct Memory Access (DMA)

• A process where external device requests the use of the CPU’s buses (address bus, data bus & control bus) for its own use

• Video pattern generator (external) shares video RAM with CPU & high-speed data transfer circuits such as those used in hard disk.

Page 30: Chp3 designing bus system, memory & io   copy

Direct Memory Access (DMA)Cont…

Page 31: Chp3 designing bus system, memory & io   copy

Direct Memory Access (DMA)Cont…

Page 32: Chp3 designing bus system, memory & io   copy

Direct Memory Access (DMA)Cont…

Example 3.5: Recall that a memory-read cycle requires a minimum of eight states (four CLK cycles) to read a word from memory. If 1,024 reads are performed, a total of 4,096 CLK cycles are needed. A DMA controller is able to read memory faster, since it uses a different type of bus cycle to access memory. Let us assume that we are using a DMA controller that is capable of reading memory every two CLK cycles (once it controls the buses). Now, suppose that the DMA controller has been programmed to read the same 1,024 locations, in bursts of 128 words. Each burst will use 256 CLK cycles, plus some additional CLK cycles for controller overhead, such as bus request/grant protocol. With 16 CLK cycles of overhead, each burst requires 212 CLK cycles. The total number of CLK cycles required for the 1,024-word block is 2,116, a little more than half that required by the 68000 itself. Thus, a DMA controller can be very useful when large blocks of data must be transferred.

Page 33: Chp3 designing bus system, memory & io   copy

Memory-Mapped I/O

• A process to write into particular memory location & read later

• Communicate with outside world• Also known as memory-mapped I/O port

Page 34: Chp3 designing bus system, memory & io   copy

Memory-Mapped I/O

Example 3.6:Imagine that you have a keyboard that supplies an 8-bit ASCII code (complete with parity) whenever you press a key. Your job is to somehow get this parallel information into your computer. By using memory-mapped I/O, a memory location may be set aside that, when read, will contain the 8-bit code generated by the keyboard. Conversely, data may be sent to the outside world by writing to a memory-mapped output location.

Cont…

Page 35: Chp3 designing bus system, memory & io   copy

Memory-Mapped I/OCont…

Page 36: Chp3 designing bus system, memory & io   copy

Parallel Data Transfer: 6821 PIA

Page 37: Chp3 designing bus system, memory & io   copy

Serial Data Transfer: 6850 ACIA