CPU.hdl question

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

CPU.hdl question

onie
Hi,

Do we need to register instruction before sending it as ALU control bits, ie, should I add a register to give a cycle's delay before the incoming instruction reaches the ALU? Or should I just take the ALU control bits from the output of 'A' register?

Also, do I need to register writeM?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: CPU.hdl question

cadet1620
Administrator
onie wrote
Do we need to register instruction before sending it as ALU control bits, ie, should I add a register to give a cycle's delay before the incoming instruction reaches the ALU? Or should I just take the ALU control bits from the output of 'A' register?

Also, do I need to register writeM?
There are no registers in the CPU except for those that are internal to the A-Register, D-Register, and PC.

All of the (c) control signals shown in figure 5.9, Proposed CPU implementation, are generated with combinational logic from 'instruction' and ALU 'zr' and 'ng'.

For some of the control signals it is important whether an A-instruction or C-instruction is being decoded. Others, like the ALU command can be directly connected to 'instruction' since the ALU's output is ignored during A-instructions and only stored during C-instructions.

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

Re: CPU.hdl question

onie
This post was updated on .
Thank you, sir. I have implemented the project. However, by observing the cmp script, I came to know that I cannot directly feed instruction bits to load of Aregister and DRegister and instead had to do the following,

        Not(in=instruction[15], out=notInstr15);
        Or (a=notInstr15, b=instruction[5],    out=aRegLoader);
        ARegister(in=mux1out,   load=aRegLoader,     out=aRegOut);
        And(a=instruction[15],  b=instruction[4], out=dRegLoader);
        DRegister(in=ALUoutput, load=dRegLoader,     out=dRegOut);


I still don't understand why the AND, OR and NOT gates are required?