CPU's PC logic

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

CPU's PC logic

erwinleonardy
This post was updated on .

So, I need to verify the veracity of my PC's logic here. Please correct me if i am wrong. This is how I check if I should make the load bit to true or false.

At time 13:
zr = 0
ng = 0
pos = 1  // am i correct?
j1 = 1
j2 = 1
j3 = 1
j3 & pos = 1  // there should be a jump, right?

Albeit, CPU.cmp indicates that there is no jump, since the PC is incremented. Can anyone tell me which part goes wrong?

Thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: CPU's PC logic

cadet1620
Administrator
Your logic for 'pos' is correct, and 'load is mostly correct.

Look at the instruction that is executing, 0000001111100111. What is this instruction? Should this instruction cause a jump?


After you've solved your problem, please edit your post to remove the implementation details. We want students to develop their own solutions.

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

Re: CPU's PC logic

erwinleonardy
Oh blimey! It is an a-instruction! Thanks a lot!
Reply | Threaded
Open this post in threaded view
|

Re: CPU's PC logic

moejoe125
My CPU implementation is also stuck on the same time '13'.
I get that this is an A inst. and therefore no jump is carried out. So the 'in', 'load' and 'reset' inputs should be disregarded...
I can't see why the PC is not incrementing to 15.

I've set PC(..., inc=true, ...)

Any ideas?

Reply | Threaded
Open this post in threaded view
|

Re: CPU's PC logic

cadet1620
Administrator
The most common cause for this failure is that you did not prevent the PC's 'load' input from being true during A-instructions.

Note that the data value of this A-instruction has three bits set that correspond to the jump bits in C-instructions.

--Mark