From https://en.wikipedia.org/wiki/ZX_Spectrum_Contended_Memory

"Contended memory space, on the other hand, is shared between the ULA and the Z80 and the ULA has higher priority. Contended memory occupies addresses 0x4000..0x7FFF of the Z80 memory map. This is the first 16 KB of RAM in the 48 KB machine but the entire RAM of the 16 KB machine."

Okay, I can sort of understand that in a scenario where the 48K machine uses three banks of 16kbit RAM chips, so just one bank is shared.

But as I understand it, later versions of the 48K Spectrum used a single bank of 64kbit RAM chips (so actually 64K RAM of which 16K was unused). How is that consistent with the possibility of only 16K being contended?

up vote 5 down vote accepted

I can find no evidence that a single bank of RAM was used. Checking out the schematics for every issue of 48kb Spectrum, all that seems to happen is a switch from sixteen x1 chips to two x8 chips, at issue 6. But the low 16kb and the high 32kb remain physically distinct.

  • Looks like you're right! breakintoprogram.co.uk/computers/zx-spectrum/hardware/ram confirms. Hmm, seems like that wouldn't have been good for the manufacturing cost in the long run. – rwallace Oct 8 '17 at 13:04
  • 2
    Well, the next step in development, the Spectrum 128, had two seperate 64KiB banks. One with shared access, one without. – Raffzahn Oct 8 '17 at 20:56
  • 3
    @rwallace - in the long run, the cost of the DRAM chips reduced far enough that the wastage was more along the lines of having to source less commonly available 16K chips than not using the full capability of the 64K ones. – Jules Oct 9 '17 at 2:19
  • @Wilson thanks for warning me! Updated. – Tommy May 3 at 15:36

The 64K chips in the Spectrum 48K are used to provide the difference between the 16K and 48K models, i.e. exactly half of each chip is in use. The 16K of memory from the base model is retained.

Interestingly, this design allowed Sinclair to use 64K chips that would otherwise be rejected as faulty, as they just had to configure an address line to avoid the faulty part of the chip. Presumably they got these chips cheap enough to account for what otherwise would be a waste of only using half of them. Later Spectrums used fully working chips, though, and aftermarket hacks were available that let you bank switch them.

  • Does this mean that the 64K chip really is working as a 32K chip? Or is each chip only storing half a byte somehow? – Wilson Dec 6 '17 at 9:07
  • 1
    @Wilson just using half the address space; at the time most DRAMs stored only 1 bit per address, you just wired them up in parallel until you got to your bus size. So eight of them for a Spectrum. Per faqwiki.zxnet.co.uk/wiki/DRAMS the Spectrum didn't start using wider RAM chips until the Amstrad models, when 'x4' (i.e. 4 bits per address) chips were used. Check out how the 4464 at the bottom has DQ1–4, four data lines, whereas everything else has only Din, a single data line. This was one of the factors that made 16-bit machines much more expensive way back when. – Tommy Dec 6 '17 at 14:48

Contention, especially memory contention in the ZX Spectrum, has nothing to do with the memory chips, but rather with the address that is placed in the address bus.

The method by which the ULA is granted prioritary access to memory is implemented by making the ULA generate the Z80 clock. When the ULA finds an address in the 4000h-7FFFh range in the bus, it can stop the clock signal, effectively stopping the Z80.

I'd recommend paying a visit to Chris Smith's excellent blog: http://www.zxdesign.info/harlequin.shtml or reading his book. :)

  • 1
    I'm not sure that it technically has nothing to do with the memory chips; they have no knowledge of it but it is a mechanism that the ULA puts into place because of their constraints. It's to ensure that only one device tries to access each bank of chips at a time, given that those chips can service only a single device at a time. – Tommy Dec 6 '17 at 14:40

No original speccies used SINGLE bank of 64k DRAM chips. 128k, +2 and +3 used TWO banks of 64k chips, having in total 128 kbytes. Many russian speccy clones used single bank of 64k chips, one early example is Leningrad: https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Fspeccy.info%2F%D0%9B%D0%B5%D0%BD%D0%B8%D0%BD%D0%B3%D1%80%D0%B0%D0%B4_%28%D0%BA%D0%BE%D0%BC%D0%BF%D1%8C%D1%8E%D1%82%D0%B5%D1%80%29

Interesting enough, the memory in that clone works at 3.5 MHz (access cycles frequency), i.e. faster than in original speccies, however still the whole RAM memory is contended, although not as badly as in original speccy. The contention might be described as 'every Z80 command aligns to the even number of cycles', while it is not completely true (not true for commands like DD CB xx opcode), still gives fair understanding of the contention.

Later, simple modifications within 3.5MHz access rate framework led to the wholly non-contended designs, like Pentagon https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Fspeccy.info%2F%25D0%259F%25D0%25B5%25D0%25BD%25D1%2582%25D0%25B0%25D0%25B3%25D0%25BE%25D0%25BD , Scorpion https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Fspeccy.info%2FScorpion (only later models, as the first models inherited contended design from Leningrad) and Kay https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Fspeccy.info%2FKAY

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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