1 / 29

Address Decoding

Address Decoding. Memory/IO. 1M locations. FFFFF. 1 Mbyte memory. 8088. D 0 – D 7. A 0 – A 19. CS. 00000. CS= Chip Select. If CS = 0 then the memory will be ON If CS = 1 then the memory will be sleeping and all its pins will be Z. 1M locations. A 19. FFFFF. 7FFFF. CS. 8088.

shaina
Download Presentation

Address Decoding

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Address Decoding Memory/IO

  2. 1M locations FFFFF 1 Mbyte memory 8088 D0 – D7 A0 – A19 CS 00000 CS= Chip Select. If CS = 0 then the memory will be ON If CS = 1 then the memory will be sleeping and all its pins will be Z

  3. 1M locations A19 FFFFF 7FFFF CS 8088 D0 – D7 D0 – D7 512 KB memory A0 – A19 A0 – A18 7FFFF 00000 00000

  4. 1M locations A19 FFFFF 7FFFF CS 8088 D0 – D7 D0 – D7 512 KB memory A0 – A19 A0 – A18 80000 00000 00000

  5. 1M locations FFFFF Address Decoding CS A16 – A19 8088 D0 – D7 D0 – D7 A0 – A15 A0 – A19 FFFF 64 KB memory 0000 0FFFF 00000

  6. 1M locations FFFFF This memory should be selected only when A16 = 0 A17 = 0 A18 = 0 A19 = 0 CS D0 – D7 A16 – A19 A0 – A15 FFFF 64 KB memory 0FFFF 00000 0000

  7. 1M locations FFFFF This memory should be selected only when A16 = 1 A17 = 0 A18 = 0 A19 = 0 CS D0 – D7 A16 – A19 A0 – A15 FFFF 1FFFF 64 KB memory 10000 00000 0000

  8. 1M locations FFFFF This memory should be selected only when A16 = 1 A17 = 0 A18 = 0 A19 = 0 CS D0 – D7 A16 – A19 A0 – A15 FFFF 2FFFF 64 KB memory 20000 00000 0000

  9. 1M locations FFFFF This memory should be selected only when A16 = 1 A17 = 0 A18 = 0 A19 = 0 CS D0 – D7 A16 – A19 A0 – A15 FFFF 3FFFF 64 KB memory 30000 00000 0000

  10. Connections Between CPU and Memory Control signals Memory 8088 Data Bus Address bus • What are the control signals from the microprocessor to memory? What are the control signal from memory to the microprocessor? • Address and data signals should be buffered • The use of buffers on address bus increases driving capability • Bi-directional buffers are used to control the data transferring directions on data bus • D latches are used to de-multiplex signals on AD[7:0] (and A[19:16])

  11. Timing Diagram of A Memory Operation • Example:8088 sends address 70C12 to memory in a memory read operation assume that data 30H is read T3 T4 T2 T1 CLK Addr[15:0] D latch ALE 8088 A[15:8] A[19:16] 7H S3-S6 Buffer A[15:8] 0CH AD[7:0] Memory D latch AD[7:0] 12H 30H D[7:0] Trans -ceiver Addr[19:16] 7H DT/R DEN Addr[15:8] 0CH IO/M Addr[7:0] 12H WR RD D[7:0] 30H

  12. Memory Chips • The number of address pins is related to the number of memory locations. • Common sizes today are 1Kto 256Mlocations. (10 and 28 address pins are present.) • The data pins are typically bi-directionalin read-write memories. • The number of data pins is related to the size of the memory location. • For example, an 8-bit wide (byte-wide) memory device has 8data pins. • Catalog listing of 1K X 8 indicate a byte addressable 8K memory. • Each memory device has at least one chip select( CS ) or chip enable( CE ) or select( S ) pin that enables the memory device. • Each memory device has at least one control pin. • For ROMs, an output enable( OE ) or gate( G ) is present. • The OE pin enables and disables a set of tristate buffers. • For RAMs, a read-write( R/W ) or write enable( WE ) and read enable (OE ) are present. • For dual control pin devices, it must be hold true that both are not 0 at the same time.

  13. Memory Address Decoding • The processor can usually address a memory space that is much largerthan the memory space covered by an individual memory chip. • In order to splice a memory device into the address space of the processor, decoding is necessary. • For example, the 8088 issues 20-bit addresses for a total of 1MB of memory address space. • However, the BIOS on a 2716 EPROM has only 2KB of memory and 11address pins. • A decoder can be used to decode the additional 9 address pins and allow the EPROM to be placed in any2KB section of the 1MB address space.

  14. Memory Address Decoding

  15. Decoding Circuits • NAND gate decoders are not often used. • 3-to-8 Line Decoder (74LS138) is more common.

  16. Addr[14:0] 32KB Addr[19] CS Addr[18] Addr[17] Addr[16] Addr[15] IO/M Memory Address Decoding • Using Full memory addressing space Addr[19:0] FFFFF 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Highest address 37FFF 32KB Lowest address 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 30000 These 5 address lines are not changed. They set the base address These 15 address lines select one of the 215 (32768) locations inside the RAMs 00000 Can we design a decoder such that the first address of the 32KB memory is 37124H?

  17. Memory Map - A14 A15 A16 A17 A18 A19 16KB EPROM chip OE A 7 B 6 C 5 74LS138 4 3 E1 2 E2 1 E 0 A0-A13 A0-A13 A19=A18=...=A14=1 select the EPROM CS10 A14 A15 A16 A16, A15, A14 select one EPROM chip 16KB EPROM chip CS9 16KB EPROM chip 16KB EPROM chip 16KB EPROM chip CS8 16KB EPROM chip 16KB EPROM chip 16KB EPROM chip CS7 16KB EPROM chip OE A19 = 1, A18 = 0, A17 = 0 activate the decoder CS6 A17 A18 A19 CS5 220 = 1,048,576 different byte addresses = 1Mbyte CS4 A0 ... A17 CS3 256KB RAM chip MRDC A18 A19 The same Memory-map assignment A0 ... A17 256KB RAM chip WR RD MWTC MRDC A 256Kbyte = 218 RAM chip has 18 address lines, A0 - A17 A18 A19 IO/M A19, A18 assigned to 00 => CS active for every address from 00000 to 3FFFF CS1’ CS1 CS2 A18 = 0 A19 = 0 IO/M = 0 WR RD 8088 Memory Map IO/M = 0 => Memory map All the address lines used by the decoder or memory chip => each byte is uniquely addressed = full address decoding Full address decoding FFFFF FC000 9FFFF 9C000 83FFF 80000 3FFFF 00000 FFFFF FC000 3FFFF 00000 FFFFF 00000 FFFFF FC000 83FFF 80000 3FFFF 00000 FFFFF 3FFFF 00000

  18. 256KB 256KB 256KB 256KB CS CS CS CS Addr[17:0] Addr[18] 2-to-4 decoder Addr[19] CS IO/M Memory Address Decoding • Design a 1MB memory system consisting of multiple memory chips • Solution 1:

  19. 256KB 256KB 256KB 256KB CS CS CS CS Addr[19:2] Addr[1] 2-to-4 decoder Addr[0] CS IO/M Memory Address Decoding • Design a 1MB memory system consisting of multiple memory chips • Solution 2:

  20. 256KB 256KB 256KB 256KB CS CS CS CS Addr[19:18] Addr[16:7] Addr[5:0] Addr[17] 2-to-4 decoder Addr[6] CS IO/M Memory Address Decoding • Design a 1MB memory system consisting of multiple memory chips • Solution 3: It is a bad design, but still works!

  21. Memory Address Decoding • Design a 1MB memory system consisting of multiple memory chips • Solution 4: 256KB 256KB 512KB CS CS CS Addr[17:0] Addr[18] Addr[18] Addr[19] IO/M Addr[19] Addr[18] Addr[19] IO/M IO/M

  22. Memory Address Decoding • Exercise Problem: • A 64KB memory chip is used to build a memory system with the starting address of 7000H. A block of memory locations in the memory chip are damaged. FFFFH 7FFFFH 733FFH 3317H 73317H Replace this block 3210H 73210H 73200H 0000H 70000H 64KB Damaged block 1M addressing space 1M addressing space

  23. A[19] A[18] A[17] CS A[16] IO/M A[15] A[14] A[13] A[12] CS A[11] A[10] A[9] Memory Address Decoding 64KB A[15:0] 512B A[8:0]

  24. Memory Address Decoding • Exercise Problem: • A 2MB memory chip with a damaged block (from 0DCF12H to 103745H) is used to build a 1MB memory system for an 8088-based computer 1FFFFFH 1FFFFFH 512K 180000H 103745H Use these two blocks 0FFFFFH 0DCF12H 07FFFFH 512K 000000H 000000H Damaged block A[19] A[20] A[19:0] A[19:0] CS

  25. Memory Address Decoding • Partial decoding • Example: • build a 32KB memory system by using four 8KB memory chips • The starting address of the 32KB memory system is 30000H 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 high addr. of chip #4 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 Low addr. of chip #4 0 0 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 high addr. of chip #3 Chip #4 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 36000H Low addr. of chip #3 Chip #3 0 0 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 34000H high addr. of chip #2 Chip #2 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 Low addr. of chip #2 32000H Chip #1 0 0 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 30000H high addr. of chip #1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Low addr. of chip #1

  26. 8KB 8KB 8KB 8KB CS CS CS CS Addr[12:0] Addr[13] 2-to-4 decoder Addr[14] IO/M Memory Address Decoding • Implementation of partial decoding • With the above decoding scheme, what happens if the processor accesses location 02117H, 32117H, and 9A117H? • If two 16KB memory chips are used to implement the 32KB memory system, what is the partial decoding circuit? • What are the advantage and disadvantage of partial decoding circuits?

  27. Memory Map - A14 A15 A16 A17 A18 16KB EPROM chip OE mirror image A 7 B 6 C 5 74LS138 4 3 E1 2 E2 1 E 0 A0-A13 A0-A13 A18=...=A14=1 select the EPROM mirror image CS10 A14 A15 A16 A16, A15, A14 select one EPROM chip 16KB EPROM chip CS9 16KB EPROM chip 16KB EPROM chip 16KB EPROM chip CS8 16KB EPROM chip 16KB EPROM chip 16KB EPROM chip CS7 16KB EPROM chip OE A19 = 1, A17 = 0 activate the decoder CS6 base image A17 A19 CS5 CS4 A0 ... A15 CS3 base image 64KB RAM chip MRDC A18 A19 The same Memory-map assignment A0 ... A15 64KB RAM chip WR RD MWTC MRDC A 64Kbyte = 216 RAM chip has 16 address lines, A0 - A15 mirror images A18 A19 IO/M A19, A18 assigned to 00 => CS active for every address from 00000 to 3FFFF base image CS1’ CS2 CS1 A18 = 0 A19 = 0 IO/M = 0 WR RD 8088 Memory Map A16, A17 not used => four images for the same chip IO/M = 0 => Memory map Some address lines not used by the decoder or memory chip => mirror images = partial address decoding Partial address decoding FFFFF FC000 DFFFF DC000 CF000 CC000 9FFFF 9C000 83FFF 80000 7FFFF 7C000 3FFFF 30000 2FFFF 20000 1FFFF 10000 0FFFF 00000 FFFFF FC000 9FFFF 9C000 83FFF 80000 7FFFF 7C000 3FFFF 30000 2FFFF 20000 1FFFF 10000 0FFFF 00000 FFFFF FC000 7FFFF 7C000 3FFFF 30000 2FFFF 20000 1FFFF 10000 0FFFF 00000 FFFFF 3FFFF 30000 2FFFF 20000 1FFFF 10000 0FFFF 00000 FFFFF 3FFFF 00000 FFFFF 00000

  28. D D Q Q Generating Wait States • Wait states are inserted into memory read or write cycles if slow memories are used in computer systems • Ready signal is used to indicate if wait states are needed data Address memory 8088 Delay circuit decoder Ready clr Ready clr clk

  29. Generating Wait States (Timing)

More Related