Could anyone please check my chips?

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

Could anyone please check my chips?

lazyCrab
This post was updated on .
They pass the Add test but not the rect and max for some reason. Hopefully the comments in the CPU chip will make it more readable.

*Removed Code*
Reply | Threaded
Open this post in threaded view
|

Re: Could anyone please check my chips?

ybakos
Try not to post huge implementation listings in the forum.
Reply | Threaded
Open this post in threaded view
|

Re: Could anyone please check my chips?

lazyCrab
Sorry, didn't know how else to post it.
Reply | Threaded
Open this post in threaded view
|

Re: Could anyone please check my chips?

cadet1620
Administrator
In reply to this post by lazyCrab
Your Memory.hdl has two RAM16K chips in. That is confusing the Hardware Simulator. Combine your loadaout and loadbout into a single loadram signal. See if that fixes the problem.

Please edit your post to remove the HDL code.

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

Re: Could anyone please check my chips?

cadet1620
Administrator
In reply to this post by lazyCrab
lazyCrab wrote
Sorry, didn't know how else to post it.
It's best to describe your problems and ask for ideas first. If someone needs to see you code they can ask you to email it to them.

It is OK to post small snippets of code.

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

Re: Could anyone please check my chips?

lazyCrab
In reply to this post by cadet1620
It either didn't help, or I did it wrong
Reply | Threaded
Open this post in threaded view
|

Re: Could anyone please check my chips?

cadet1620
Administrator
The failure with Max is happening when PC = 4.  This means that the results of the instruction at address 3 are wrong. You can load Max.hack into the CPU emulator to see the instructions disassembled.

I've got your code. I'll get a chance to look at it sometime this evening if I don't hear that you found your problem.

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

Re: Could anyone please check my chips?

lazyCrab
This post was updated on .
Thanks, very appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Could anyone please check my chips?

cadet1620
Administrator
The clue is that when you are about to execute the D=D-M instruction in Max.hack,
    D-reg = 3, A-reg = 1 and RAM[1] = 5
but what is computed by the ALU is D-3 instead of D-5. Also notice that RAM[0] is highlighted in the simulator, indicating that the RAM's address is 0, so it is returning 3 instead of 5.

What's wrong with the RAM16K part in Computer.hdl?

Your CPU.hdl is good. Assuming that you have also correctly fixed your Memory.hdl, your Computer passes all three tests.

--Mark