what is wrong with this jump implementation.

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

what is wrong with this jump implementation.

kraftwerk1611
Hi,

After trying several approached in last 7 hours I was hoping that this solution might work. I thought that if output from two tables Jump bit tables and ALU output tables are both true then this would pass the HW simulator test. But alas this did not happen. The test failed only after few lines.

Can someone please tell me what is wrong with following approach and if there is another direction that I should head to in search of right implementation. I tried all I could think of and nothing worked.

Thanks.

 Or(a=instruction[2], b=instruction[1], out=J1ORJ2);
   Or(a=J1ORJ2, b=instruction[0], out=outJTable);
   
    Or(a=outZero, b=outNegative, out=NegativeORZero);
    Or(a=NegativeORZero, b=instruction[0], out=outALUOutputsTable);
   
    And(a=outJTable, b=outALUOutputsTable, out=Jump);

At the time of failure Jump bit seems to be 1.




Reply | Threaded
Open this post in threaded view
|

Re: what is wrong with this jump implementation.

cadet1620
Administrator
The test step that failed is the one before the highlighted line, the @12345 (0011000000111001).

So the question is, why are you jumping on an A-instruction?

(You might want to check for other control signals that should not be active during A-instructions.)

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

Re: what is wrong with this jump implementation.

kraftwerk1611
hi Mark,

May I email my code to you for you to give me feedback. I have tried several solutions in last fewl days but nothing is working. It seems like I am at a dead end.

Thanks.

Reply | Threaded
Open this post in threaded view
|

Re: what is wrong with this jump implementation.

cadet1620
Administrator
Yes, I'll be happy to look at your code.

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

Re: what is wrong with this jump implementation.

kraftwerk1611
This post was updated on .
This project has been the hardest so far.

In case someone gets stuck on Jump logic or decode box and if it could make life easier for anyone then following helped me in finishing this task.

1-understanding what happens during C and A instructions and how it effects different components in figure 5.9. Every part of C-instruction and A-instruction has a separate story to tell. Chapter 3 on machine instruction i had to check several times.

2-what each jump bit means and what conditions need to be checked in each case. I had to refer to pages  94, 36, 37, 110 and 69 again and again.