How do I make bigger ram chips?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I make bigger ram chips?

kingpinzs
I tried to make a 1mb ram chip but it just locks up the simulator when loading it with no errors.
Do I need to make my 128k ram built in before I can make the 1mb one?
Reply | Threaded
Open this post in threaded view
|

Re: How do I make bigger ram chips?

cadet1620
Administrator
kingpinzs wrote
I tried to make a 1mb ram chip but it just locks up the simulator when loading it with no errors.
Do I need to make my 128k ram built in before I can make the 1mb one?
A 1mb RAM would require 64 RAM16K chips. I built a modified Hack computer that required writable program memory using 4 RAM16Ks to implement a write-back cache in front of the ROM32K. Each of the 5 RAM16Ks in the computer tries to create its own UI panel in the simulator (in addition to the UI panels for ROM, Screen, ALU, etc.) and Java's automatic layout scrambles things rather badly. My guess is that the attempt to make 64 UI panels is causing the hang.

Since the TECS tools were written to handle the Hack computer, not as general tools, I see this as a minor issue. In my professional job I'd probably enter this bug as priority 2 (1-5, 1=no plan to fix) with the proposed fix to be adding an error message that more than one RAM with UI is not supported and aborting the HDL load.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: How do I make bigger ram chips?

kingpinzs
I made a built in chip of 1MB and it loads fine . I am working on a script to test it now.
One issue is that the address space only goes to 32767 then it goes to -32768 and starts counting down. How could I fix that issue?
Reply | Threaded
Open this post in threaded view
|

Re: How do I make bigger ram chips?

cadet1620
Administrator
kingpinzs wrote
I made a built in chip of 1MB and it loads fine . I am working on a script to test it now. One issue is that the address space only goes to 32767 then it goes to -32768 and starts counting down. How could I fix that issue?
Because the A register is 16 bits long, the Hack CPU is limited to 64KB directly addressable RAM (addresses can be treated as unsigned). It is a little hard to use addresses above 32767 since they cannot be directly loaded using A-instructions. The assembler could be modified to automatically generate the two instruction sequence @x; A=!A where x is the address's inverse if it is > 32767, but that doesn't get us to the 20 bits required to address 1MB.

The classic solution is to add segment registers like the Intel 8086. To create a 20-bit physical address, EA, a segment register is added to the A-register.

    ssss ssss ssss ssss       segment register
         aaaa aaaa aaaa aaaa  A-register
    ------------------------
    pppp pppp pppp pppp pppp  physical address
The Hack instruction set would need to be augmented with ways to set the segment registers and ways to select which segment register is used for memory accesses.

--Mark