In reverse order...
Yes, I took the picture and then altered the program but forgot to take another picture before switching off
.
A standard ZX81 has minimal address decoding. Indeed, the Z80 address line A15 is not used at all by the rest of the ZX81 circuitry. Also not all of the addresses used for the on board ROM or the on board RAM are fully decoded.
This means that even though the standard ZX81 has only 8k bytes of ROM and 1k bytes of RAM, as far as the Z80 CPU is concerned, any of the 64k bytes of available memory addresses will return a value from memory for reading data only (it is more complex when the Z80 CPU reads a machine code instruction due to the way the display system works) from either an address in ROM or an address in RAM.
So what is happening?
The Z80 CPU counts on it's address bus using binary, from zero (0) to 1111 1111 1111 1111 binary (FFFF hex, 65535 decimal). That's sixteen lines, numbered A0 to A15.
The hardware of the ZX81 ignores the CPU address line A15, so any memory in the address range zero (0) to 0111 1111 1111 1111 binary (7FFF hex, 32767 decimal) will also respond in the address range 1000 0000 0000 0000 binary (8000 hex, 32768 decimal) to 1111 1111 1111 1111 binary (FFFF hex, 65535 decimal) as it cannot tell if the difference.
The memory map looks like this:
0000 hex, 0 decimal
> ROM (8k bytes)
1FFF hex, 8191 decimal
-----
2000 hex, 8192 decimal
> ghost of the ROM at 0000 hex to 1FFF hex
3FFF hex, 16383 decimal
-----
4000 hex, 16384 decimal
>RAM (1k bytes)
43FF hex, 17407 decimal
-----
4400 hex, 17408 decimal
> 15 ghosts of the 1k bytes of RAM at 4000 hex to 4400 hex
7FFF hex, 32767 decimal
-----
8000 hex, 32768 decimal
>ghosts of the memory from 0000 hex to 7FFF hex
FFFF hex, 65535 decimal
By ghosts, I mean because the hardware cannot tell the difference between two or more address ranges, the same memory chip is accessed at more than one address range. So if you store a value of 181 decimal at address 17407 decimal (43FF hex), if you read back address 18431 (47FF hex), or any other higher address where the address lines A0 to A9 and A14 are the same, you will get the same value (181 decimal) returned.
As far as the 1k bytes of RAM is concerned, the state of address lines A10 to A13 and A15 does not matter.
So when any expansion, interface or extra memory is added, it is the responsibility of the expansion, interface or extra memory to control the /RAMCS line. By driving it to logic high, you prevent the ZX81 internal RAM from responding to the same addresses used by the expansion, interface or extra memory.
If you examine the Sinclair 16k byte RAM pack, you will see that on the PCB there is a direct connection from the +5V line and the /RAMCS line, so the ZX81 internal RAM is always disabled.
If an expansion, interface or extra memory does not control the /RAMCS line, both the expansion, interface or extra memory and the internal memory in the ZX81 will respond to the same address. This does not matter for writing to memory, but when reading, both will put data on the data bus. Two different chips putting data on the same data bus lines at the same time is not good. This is known as a data bus clash or a data bus collision.
The original scheme makes no attempt to deal with this problem. I do not know why. As I spotted the problem when working out the schematic by reverse engineering the PCB, I added the extra transistor before I tested it with a ZX81. So I cannot say what the actual result would be if a board based on the original scheme was plugged into a ZX81. I suspect that as the interface board uses a bus buffer chip (the 74LS244), this is more likely to have more powerful outputs than the RAM chips, so will overpower the output from the RAM chip. As the overpowering is only for a short time, it may not cause any damage to the RAM chip, but it is not recommended.
Yes, the data bus is a 8 bit binary number. The BASIC used on the ZX81 only uses decimal when communicating with the user. So you have to convert a binary number to decimal to select which output lines are logic high (one).
The same applies when reading the input port. If you convert the decimal number that is returned to binary, you can see which lines are high and which are low. Because of the pull up resistor network, the normal state of each of the input lines is logic high.
Mark