Electrical – Does pin A15 on a Z80 tell if the CPU is addressing ROM or RAM

addressingmemoryz80

I am designing a simple, hobbyist single board computer similar to an Arduino using a Z80 CPU. The trouble I am running into is how the CPU addresses memory. I know that the Z80 uses pins A0-A15 to form an address bus, but reading "The Z80 Microcomputer Handbook", https://archive.org/details/The_Z80_microcomputer_handbook_William_Barden/page/n109, page 118 (In the book, not in the slider at the bottom of the webpage), second paragraph under "Interfacing ROM and RAM", it says that pin A15 is used to differentiate between the CPU addressing ROM or RAM. It says that when A15 is low, then ROM is being addressed, and when A15 is high, then RAM is being addressed. Is this true?

If it is, would I be correct in saying that that would take my 16 bit address bus to a 15 bit one, since one of those address pins is used to tell if the CPU is using ROM or RAM? Wouldn't it make more sense to AND MREQ and M1 together and connect that with the chip enable on the ROM, so as to make the ROM active whenever the Z80 is in opcode fetch mode?

The reason I ask this is because I would like the CPU to have 64K of ROM and RAM, if this is possible.

I'm new here, so any help is much appreciated, but if I did anything wrong, please tell me and I'll fix it.

Best Answer

Look at the schematic on the following page. A15 is connected to the chip selects of the ROM and RAM to make that happen. It's not a function of the Z-80 per se -- it's a function of how the external memory is laid out.

Good choice -- the Z80 was the second microprocessor I ever worked with (in a TRS-80), and the first one I was paid to develop software on (at 13 -- you gotta love family businesses).