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?
4Not 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...– JoeMar 31, 2018 at 19:36
6I'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.– TommyMar 31, 2018 at 19:41
3Because "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)– JulesMar 31, 2018 at 19:59
2The 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 LockeMar 31, 2018 at 20:29
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 with a continous memory of 4 Kib would not have worked. As a result they decided to add one KiB (2x2114) at address 0, so the CPU got it's 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 8 2114s, as now, buying two larger was quite 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 static at all.
*2 - Which was anyway rushed to be completed due 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 are handled.
*5 - It still had to be static RAM, as they just wanted to make a new board, not redesign the whole system.
1Just 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.– RaffzahnApr 1, 2018 at 1:27
1Also, 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. Apr 1, 2018 at 4:03
6@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. Apr 1, 2018 at 4:14
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... Apr 1, 2018 at 23:00
1...addition of a small expander card plus one or two 8K cards, with all memory being usable. Apr 1, 2018 at 23:01
The VIC-20 has 1K of low memory ram containing room for the zeropage, the stack and kernal and basic working areas. ($000-$03FF)
4K of main RAM ($1000-$1FFF)
so the main ram is a multiple of 4.