What really happens to outM when writeM is 1?

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

What really happens to outM when writeM is 1?

eVh1955
Hi.  It is my understanding that when writeM is 1, outM == contents of the D register.  Is that accurate, or is there anything else?  My code is posted below.  Thanks.



CPU.hdl
Reply | Threaded
Open this post in threaded view
|

Re: What really happens to outM when writeM is 1?

WBahn
Administrator
No, when writeM is 1, outM is equal to the output of the ALU.

The ALU output is the heart of nearly everything associated with C-type instructions.

It is the ALU output that gets stored in the A, the D, and/or the M registers when a C-type instruction is executed.

It is the ALU output that determines whether or not a jump is taken when a C-type instruction is executed.

Reply | Threaded
Open this post in threaded view
|

Re: What really happens to outM when writeM is 1?

eVh1955
Thank you.  This is the earlier code I have used.  

CPU.hdl

At 5 seconds I got this result and at 5+, I got an error where the result is 2848 at outM.  

I pretty much forgot how the ALU works in the first place.  I'm still at a loss how I got 864 in ALUout, then a 2848 at outM.  Thanks.  

Reply | Threaded
Open this post in threaded view
|

Re: What really happens to outM when writeM is 1?

WBahn
Administrator
Look at the Proposed CPU Implementation in Chapter 5. It gives you the entire data path (it just leaves you to figure out the control logic).

Where does the outM signal come from?

Where does it come from in your code?

If the two don't agree, then you are going to have problems.