24

Why does the VIC-20 have 5 KiB of RAM? Why not a multiple of 4 as any other systems, e.g 4 KiB or 8 KiB. Is there a technical reason for that?

Ola Ström
  • 327
  • 1
  • 2
  • 9
Biff Iam
  • 2,189
  • 3
  • 13
  • 20
  • 4
    Not enough for a canonical answer, but I've read that Commodore had a surplus of 512-byte SRAM chips and used them, as to why the magic number was 10 chips I'd guess it was related to space on board or the logic required to wire all those chips together, but hoping someone has a more comprehensive reference... – Joe Mar 31 '18 at 19:36
  • 7
    I'd need to check my sources before giving a confident answer, but this I can tell you offhand with certainty: the Vic-20 memory map is dreadful. Each RAM expansion changes the ordering and/or placement of BASIC and the screen such that most software is compatible with only exactly one memory layout. Want to run a base-machine-compatible program? Better actually unplug your 16kb expansion, or it's not going to work. Better hope you don't sit through the full load and realise only at the end. – Tommy Mar 31 '18 at 19:41
  • 3
    Because "5K ought to be enough for anyone" .... literally what a salesman said to my family when shopping for a computer in 1981. I think they made the better choice getting a TI-99/4A (which, incidentally, also had an odd amount of memory for similar reasons -- its CPU needed a fast SRAM in order to work properly in addition to the 16K of DRAM connected to its VDP, resulting in a total of 16.25K of RAM) – Jules Mar 31 '18 at 19:59
  • 3
    The VIC-20 RAM is not that bad. If you add only the 3K, the video stays the same at $1E00 and the start of BASIC moves down into the 3K at $0400.

    When the first 8K is added, regardless of the 3K expander, the video moves down to $1000 and the start of BASIC moves to the end of the video RAM at $1200, and stays there regardless of ANY other expanders. This leaves the 3K expander space empty for other uses.

    This all could have been avoided by giving the VIC-20 8K of RAM. The video could be at $400 and BASIC at $600, and nothing would have to move when RAM is added, except the end of BASIC.

    – Tim Locke Mar 31 '18 at 20:29
  • 1
    @TimLocke: Alternatively, the space between $0400-$0FFF could have been used for I/O, making character ROM visible to the CPU at $B000, allowing 4K of normal main RAM at $1000 to be contiguous with address space up to $B000. The "small" expansion unit would need to contain its own 74LS138, but could support 4K and could also be designed to combine nicely with other expansion units (including using two 4K units to make 8K). – supercat Aug 11 '23 at 16:06
  • Yes, I think that would have been an acceptable place for the I/O. They always seemed to waste a lot of space for I/O as if they were expecting a lot more I/O devices to be added later, but I think it had to do with reducing the number of address decoding gates. They probably could have squeezed it into 1K from $0400 to $7FF and left 2K more for RAM, assuming the CHAR ROM was also moved up. – Tim Locke Aug 13 '23 at 16:37
  • @TimLocke: The I/O region contains 1K of 4-bit-wide color RAM, so it couldn't fit into 1K unless one wanted to make half of the color RAM unusable. Another variation would be to move I/O and the font ROM both to $B000, with the CPU accesses $B000-$B3FF and $B800-$BBFF showing the ROM contents, $B400 being the VIC and VIAs, and $BC00 being color RAM, while the VIC would just see a uniform 4K font ROM. – supercat Aug 15 '23 at 18:06

2 Answers2

30

Simple reason:

Commodore had an overstock of 2114 Chips at that time (*1), so Jack Tramiel, then president of Commodore, ordered the project (*2) to use them.

Yeah, but why 5 KiB? Why not just 4KiB?

Due the nature of the 6502, RAM is needed at address 0, while the way the 6560 VIC (*3) was addressed called for RAM at $1xxx. So a contiguous memory of 4 Kib would not have worked. As a result they decided to add 1 KiB (2x2114) at address 0, so the CPU got its special areas (ZP/Stack), plus 4 KiB (8x2114) at $1000, thus having maximum flexibility with the video chip (*4).

Later, when the overstock was used up and the VIC-20 still sold well, Commodore made the B revision using two 6116 2KiB RAMs (*5) instead of the eight 2114s: by now, buying two larger was significantly less expensive than continuing with 2114s.

And as a side note, the VC-20 didn't just have 5 KiB, but an additional 1 Ki Nibble (4 bit words) as Colour RAM at $9400 (or $9600 in maximum RAM mode).


*1 - Commodore/MOS did produce RAMs at that time, but reacted way too late when the market shifted away from these small sizes and away from static RAM generally.

*2 - Which was already being rushed to completion, due to his need for a Spring 1980 CES presentation.

*3 - 6560 VIC - Video Interface Controller, the video controller used - hence the name for the machine. European Versions used the PAL Version 6561.

*4 - The whole story here is tied to the unusual way the RAM expansion for different sizes is handled.

*5 - It still had to be static RAM, as they just wanted to make a new board, not redesign the whole system.

Toby Speight
  • 1,611
  • 14
  • 31
Raffzahn
  • 222,541
  • 22
  • 631
  • 918
  • Out of curiosity, would there have been any difficulty using 4K of RAM and having the decode logic for that region ignore A12? – supercat Apr 01 '18 at 01:12
  • 1
    Just for the RAM, so it's mirrored at 0000 and 1000? Yeah, would have worked. But then some additional logic would have been needed to disable this again when the 3KiB (well, now 4KiB) RAM Expansion would come into play (which again was made up of 6 2114 ... remember, they wanted to burn thru the chip stack :)). And a more sophisticted routine to detect if it's mirrored or real RAM (with the expansion). LAst but not least it would have reduced the free RAM to about 2.5 KiB for BASIC. Not realy an argument to sell a USD 300 computer. – Raffzahn Apr 01 '18 at 01:27
  • If one uses a 74LS138 decoder wired to A10, A11, and A13, then the first 4K would be mapped at 0000-0FFF and again 1000-1FFF. The next 8K would be mapped at 2000-2FFF and 3000-3FFF [just ignore the second one]. If it's necessary to combine a 4K and 8K expander, one would need a multi-cart backplane in any case, and that could include its own 74LS138 to map the 4K cart at a better position. – supercat Apr 01 '18 at 03:59
  • 1
    Also, out of curiosity, is there any reason the VIC would care about whether RAM was mapped at 1000 and ROM at 0000, versus the other way around? I'm thinking the 5K decision really was more likely motivated by marketing than the technical issues of 1Kx4 RAM chips. BTW, it's interesting to note that the C64 also includes a 1Kx4 RAM for color attributes. – supercat Apr 01 '18 at 04:03
  • 9
    @supercat You don't want to map $0000 to ROM, that contains the Zero Page which is treated specially by the 65XX family of processors. Arguably only RAM required for a 6500 is the $0000 and $0100 pages. – Will Hartung Apr 01 '18 at 04:14
  • @supercat the whole decoding part is a bit more complex. there are 3 '138. The first is doing 8 KiB Blocks, the second the I/O and the third the 8 KiB RAM - inkluding 3 KiB of the expansion cardridge which therfore needs nothing than the RAMs - a great way to get rid of even more of them. Then again, the VIC can only address 16 KiB of RAM, but since A13 was used for selecting the colour RAM, only 8 are left. So they are also maped for the first 8 KiB. Basicly the VIC is an 8 KiB RAM design with 3 8 KiB expansions. modified to run with 2114 and some RAM left out to sell a RAM modul. – Raffzahn Apr 01 '18 at 12:04
  • @WillHartung: The VIC chip has an 8K addressing range, of which 4K maps to RAM and 4K to the character generator ROMs. If none of its range mapped to ROM, it would be necessary to use 2K of RAM to hold the current font. – supercat Apr 01 '18 at 14:23
  • @Raffzahn: My point was that the 74138 that generated 1K selects for the first 8K of RAM could have just as easily generated selects which hit the first 4K twice and then the second 4K twice, and that would have worked beautifully for an unexpanded VIC, one with 4K of expansion RAM, or one expanded without using those +4K selects. I would suspect, however, that Commodore's marketing may have been trying to set itself apart from the other machines with "only" 4K of RAM, for less cost than pushing to 8K. – supercat Apr 01 '18 at 16:34
  • @supercat Any nore complicated decoding doesn't make any sense. The first 8 KiB are complete decoded as 8 CS lines. Any combination of 1..8 KiB at any address is already possible. No further decoding needed. No Changes needed. So why making it more complicated? – Raffzahn Apr 01 '18 at 16:57
  • 1
    @Raffzahn: My recollection from that era is that the the incompatibilities with 3K and 8K expansions may have discouraged people from getting them who otherwise might have done so, since it wouldn't be possible to get a 3K expander and then later upgrade to 16K. Abandoning the address space from 0400-0FFF and having a small expander card which could sit at 2000, 4000, or 6000 would have required nothing more than adding a 74138 in the small expander card (while freeing up three contacts on the bus connector) and would have allowed... – supercat Apr 01 '18 at 23:00
  • 1
    ...addition of a small expander card plus one or two 8K cards, with all memory being usable. – supercat Apr 01 '18 at 23:01
  • @supercat And how is that related to why it has been done the way it was? You're talking about things that happened later on, when the machine was designed and people already bought it. – Raffzahn Apr 01 '18 at 23:24
  • 1
    @Raffzahn: I wasn't the very first person in the world to buy a VIC-20, but the incompatibility issues posed by upward-growing and downward-growing memory were recognized and described in the documentation from the get-go. Having 5K instead of 4K was great marketing, but I fail to see any particular technical benefit to having expansion RAM at 0400-0FFF. – supercat Apr 01 '18 at 23:31
  • 1
    @Raffzahn I figured you're the best person to answer this question. I heard that the VIC-20 was renamed to VC in Germany, VolksComputer, since VIC sounds like "fick". But I would have thought that VIC-20 would have rather been pronounced as Vau I Zee Zwanzig rather than some nonsensical Fick-Zwanzig oder so was? Was hältest Du davon? – Omar and Lorraine Oct 17 '19 at 08:10
  • @Wilson Yes, exactly. The C at the end would usually be pronounced as a hard K, but the V would, when spoken, end up more close to W than F. So it needs quite some effort to read it as Fick - most people would have pronounced it rather like Wick. Which then again is a well known sweet. Vau Ih Ce on the other hand sounds 'unhandy' to Germans. So I would like to think marketing had a talk about that until someone came up with dropping the I which makes it a quite easy to use Vau-Ce - from there the association with Vau-Weh is a short one and using Volks-Computer jumps to mind. ... – Raffzahn Oct 17 '19 at 09:35
  • 1
    @Wilson ... Using Volks-Computer as a name for that machine is (in Germany) pure genius Volk got a positive connotation, and Volkswagen is as well known as Jesus. It's a marketing dream. Now, the story with VIC/Fick has been colported a lot, but I have a hard time to belive it as a main reason - if at all, it's an afterthought. Thinking of it, we all know how sensible Americans are wen it comes to such conotations, so it might have been a killer argument for German marketing to get the permission to change the name in German speaking countries to the incredible powerful Volks-Computer. – Raffzahn Oct 17 '19 at 09:35
7

The VIC-20 has 1K of low memory ram containing room for the zeropage, the stack and kernal and basic working areas. ($000-$03FF)

and

4K of main RAM ($1000-$1FFF)

so the main ram is a multiple of 4.

see memory map

EL Dendo
  • 1,112
  • 6
  • 10