Chromatix wrote:
This leaves a 16KB chunk for I/O devices. You can divide this into 2KB pieces using a single '138, by connecting A15 to E3 and A14 to both /E1 and /E2, and A11-13 to the A0-2 inputs. Or you can divide the bottom half of it into 1KB pieces by connecting A15 to E3, A14 to /E2, A13 to /E1, and A10-12 to the address inputs. To similarly decode the top half, use a second '138 and an inverter on A13.
Look again at the diagram ttlworks posted from the 6502 primer's
address-decoding page. With nothing but a quad NAND, you can decode RAM, ROM, and up to
ten I/O ICs, as long as the I/O ICs have two chip-select inputs like the 6522 and 6551 have. One select of each of these ICs is fed from the output of one of the NAND sections as shown, and the other is fed from an address line. I/O goes in the second 16KB space, between the 16KB RAM and the 32KB ROM. No 138's necessary.