CPU writeM output

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

CPU writeM output

moejoe125
I'm trying to put together the CPU components, but I'm stuck on the writeM output part.

I'm fairly sure that it should be supplied with the instruction[15] bit, to access memory only when there is a C-instruction being processed.

Just not sure how to implement it.

Any hints would be appreciated.

Reply | Threaded
Open this post in threaded view
|

Re: CPU writeM output

cadet1620
Administrator
writeM is one of the destination bits, as in M=D+1.

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

Re: CPU writeM output

moejoe125
Thank you very much for the tip Mark.

I've got the CPU building done. However it's failing at the first compare line when I run the CPU-external test (I used the regular Register chip in my implementation).

I basically set instruction[3] to be fed into writeM in the CPU HDL.

My CPU is getting it's writeM bit set to 1 on the first line (clock 0+).

I must of misunderstood your hint or something...
Reply | Threaded
Open this post in threaded view
|

Re: CPU writeM output

cadet1620
Administrator
The first instruction in the test is 0011000000111001 (@12345). writeM should ony be active for C-instructions. You will find several other control signals that must similarly be active only during C-instructions.

(If you use ARegister and DRegister, you will be able to see them in the HardwareSimulator's "screen" view.)

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

Re: CPU writeM output

moejoe125
Ok, I think I've worked out the writeM part.
But I'm seriously struggling with getting the overall CPU working.

The latest brick wall that I've hit is comparison failure at line 4.
So based up on the internal pin read-outs, the ALU is getting the correct inputs from the DRegister and the ARegister. i.e 0 from D register and 12345 from the A register.
But for some reason, outM is outputting -12346.

I can't work out how the value from the A register is getting inverted...



Reply | Threaded
Open this post in threaded view
|

Re: CPU writeM output

cadet1620
Administrator
moejoe125 wrote
Ok, I think I've worked out the writeM part.
So based up on the internal pin read-outs, the ALU is getting the correct inputs from the DRegister and the ARegister. i.e 0 from D register and 12345 from the A register.
But for some reason, outM is outputting -12346.
Check the overall order of the ALU command bits. If you have them backwards, the ALU will be computing ~(x plus y).

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

Re: CPU writeM output

moejoe125
Yup, that's fixed it! Thanks Mark!
Now onto working out the next comparison failure.
Ironing them out one at a time...