2
$\begingroup$

In my uni lecture, I am covering address decoding. I understand that memory addresses are decoded to find if they point to the RAM, ROM, or I/O, by way of the address (in the example of BBC Micro) being in the RAM range, user ROM range or OS ROM range (e.g. 0x0000 to 0x7FFF is the range of RAM in the address space).

Addresses can be decoded as little as possible, that is, the minimum number of bits in the address are checked to determine the chip select signal, the signal which determines which chip to access. This approach allows for 'address shadows'. Now I'm not sure what this means, I'm repeating my lecturer.

What I understand address shadows to be are addresses which will point to the same place in memory as another, but only because we are decoding the address as little as possible.

The example my professor gave is of the original Apple Macintosh. The SCC READ chip had addresses from 90000 to A0000, but it only had 4 or 5 registers. This meant the same registers were repeated in memory, which is what an address shadow or mirror is.

Could someone expand on or correct this definition, because web searches have not turned up much fruitful information.

Thanks

$\endgroup$
2
$\begingroup$

Suppose you have a 16-bit CPU (65536 bytes of address space) and you have 2 16kB (16384-byte) RAM chips (and nothing else). How do you connect them together?

Each chip has 14 address pins. You connect those directly between both chips and the CPU.

You take the 15th address pin from the CPU and connect it to one RAM chip's chip-select pin. You also connect it to a NOT gate and you connect the output of the NOT gate to the other RAM chip's chip-select pin.

The 16th address pin on the CPU is not connected to anything, because it is not minimally required to make the system work with two 16k RAM chips.

The address space which this arrangement forms, looks like this:

+-------------+ 0xFFFF
| also chip 2 |
+-------------+ 0xC000
| also chip 1 |
+-------------+ 0x8000
|   chip 2    |
+-------------+ 0x4000
|   chip 1    |
+-------------+ 0x0000

Because the 16th address pin is not connected, addresses 0x8000 and 0x0000 (for example) act exactly the same on the hardware level. The only difference is the 16th address pin, which is not connected to anything. Byte 0 of chip 1 is intended to be accessed at address 0x0000, but you can also access it at address 0x8000. This is called a "mirror" or "shadow".

The official documentation for the system would probably tell you not to use addresses above 0x7FFF. This leaves room for them to add more RAM, ROM or peripherals in that space in the future, which would break the mirroring.

You might find more information by using the term "mirror" instead of "shadow", or then again, you might not. Once you understand the concept, it is very simple, so maybe few people bother to write about it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.