"Single step" and "Load Script" Method generates different pin output?

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

"Single step" and "Load Script" Method generates different pin output?

Juan313
This post was updated on .
I am testing the zr and ng status pin for my ALU chip. It seems that when I'm running the test for x=0, y=-1, zx=0; nx=1; zy=0;ny=0; f=1;no=1 (x-y operation), the single step method will generate the result as out=1, zr=0, ng=0, however, the ALU.tst script will generate result as out=1, zr=1, ng=0.

Please note that I created a IsNegative16.hdl and a IsZero16.hdl chip to help calculating status pin zr and ng. Any idea why? Any help is greatly appreciated!

Juan

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

Re: "Single step" and "Load Script" Method generates different pin output?

cadet1620
Administrator
The problem is in your IsZero16 chip.

It might be easier to rewrite it using Or8Way than to debug it.

You don't need two Mux16s for the output; you can say
    Mux16(a= beforenegate,b=negateout,sel=no,out=forstatus, out=out);
Using one more "out=" connection on that mux, you can eliminate the need for IsNegative16.

--Mark

[Please edit your post to remove the links to your HDL files.]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Single step" and "Load Script" Method generates different pin output?

cadet1620
Administrator
In reply to this post by Juan313
To help debug a new chip that you have written, you can make your own test script. Look at some existing .tst files to see how they're written.  For instance, here's an IsZero16.tst file.
load IsZero16.hdl,
output-file IsZero16.out,
//compare-to IsZero16.cmp,
output-list in%B2.16.2 out%B2.1.2;

set in %B0000000000000000, eval, output;
set in %B0000000000000001, eval, output;
set in %B0000000000000010, eval, output;
set in %B0000000000000100, eval, output;
set in %B0000000000001000, eval, output;
set in %B0000000000010000, eval, output;
set in %B0000000000100000, eval, output;
set in %B0000000001000000, eval, output;
set in %B0000000010000000, eval, output;
set in %B0000000100000000, eval, output;
set in %B0000001000000000, eval, output;
set in %B0000010000000000, eval, output;
set in %B0000100000000000, eval, output;
set in %B0001000000000000, eval, output;
set in %B0010000000000000, eval, output;
set in %B0100000000000000, eval, output;
set in %B1000000000000000, eval, output;
--Mark
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Single step" and "Load Script" Method generates different pin output?

Juan313
Thank you Mark! That's exactly where the problem is. I double check my IsZero16 chip using the test script you provided and realized that I accidentally put in two "a" on input side instead of input a and b.

I agree with you on using the Or8way chip since it's doing almost the same thing. I just completely forgot about the Or8Way chip. It's good to know that I can have two out connections.

Thank you for your quick response. Now my ALU chip works completely!

--Juan
Loading...