Electronic – 8086 memory decoder logic

addressingcpudecodersram

I started creating a scheme for 8086 based computer now I'm in trouble with memory addressing.
I know a 20 bit wide addressing line can address up to 1024 KB of RAM and that pin A0, when high, select all the even memory banks and when BHE is high the odd memory banks are selected (yes I know there is a bit more complicated logic circuit to do this).

I choosed a setup where there are 8 chips (6x 128 KB are SRAM chips and remaining 2x 128KB are EEPROM chips).

Reading online I know that using a M74HC138B1R (a so called 3:8 decoder) I need to use A17, A18 and A19 to decode what chip select, ending having the lines A1-A16 to use for chip addressing. The problem comes when according to IS62C1024AL datasheet (chip I wish to use as SRAM) the chip use 17 lines for addressing (A1 up to A17) meaning 17 bit=128KB. But doing this I end up with 1 address line in conflict (A17).

I can't figure it out how to exit this weird situation and I can't figure it out if the A0 still available for addressing, my assumption following the logic is no.
Another thing that seems obvious to me was searching for a 2:8 decoder that apparently it doesn't exist.

Any tip is much appreciate, may be I'm currently missing something stupid I can't figure it out now.

Best Answer

Your problem is that you talked about using Banks of RAM in your first paragraph - but then assumed you would use the chips serially.

You should use the chips in pairs, using A0 and BHE as you described. So you actually have a 2x3 array of RAM chips and a 2x1 array of EEPROM.

There is no such thing as a "2-to-8" decoder precisely because you need 3 bits to get 8 possibilities - but you need a 2-to-4 decoder:

  • A19-A18 to decode which pair of RAM or EEPROM chips;
  • A17-A1 to decode the address in each pair;
  • A0 and BHE to decode which chip in the pair.