Clarification needed in the ALU part of CPU.hdl.

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

Clarification needed in the ALU part of CPU.hdl.

wangdw406
Dear all,

I am working on project 5 and have already completed most parts of it. The only question that is always confusing me for a couple of weeks is how the ALU deal with different kinds of instructions, namely, the A-instruction and C-instruction.

I know how the CPU process C-instructions according to the decoding of C-instruction control bits, but what about A-instruction. I mean, instructions stored in the ROM are processed line by line in the CPU controled by pc, when it comes to the line of A-instruction, for example,
@100
then all the CPU does is to load the binary bits of 100 into A-register for the use of next C-instruction line. Therefore unlike C-instruction, at this instruction moment, the ALU don't have to do anything since there is no computation needed.

So here comes the problem which tortured me for several weeks: if the ALU should do nothing with A-instruction, how can I implement it. After all, you have to give some imput pins to ALU for processing no matter whether it's an A-instruction or C-instruction.

I have been thinking about this question for two week now, but still can't get it. Could someone please give some help? Is there somethong wrong with my understanding? Any help will be greatly appreciated. If my probem is not stated clearly, please tell me! Thank you for your time!

Kind regards,
David.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Clarification needed in the ALU part of CPU.hdl.

cadet1620
Administrator
It does not matter what the ALU computes during A-instructions.

Assuming that you are using the implementation presented in figure 5.9, whatever value the ALU computes will appear on outM, but will be ignored by the memory because writeM will be false.

(If you look at CPU.cmp you will see that the expected value of outM is "******" except when writeM is 1.)

--Mark
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Clarification needed in the ALU part of CPU.hdl.

wangdw406
Dear Mark,Thank you so much for your help, this helped a lot!
Loading...