ALU problem

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

ALU problem

dario3004
so i made my code but i got some problem finding where i made mistake...
    Mux16(a = x, b = false, sel = zx, out = x1);
    Mux16(a = y, b = false, sel = zy, out = y1);
    Not16(in = x1, out = notx1);
    Not16(in = y1, out = noty1);
    Mux16(a = x1, b = notx1, sel = nx, out = x2);
    Mux16(a = y1, b = noty1, sel = ny, out = y2);
    And16(a = x2, b = y2, out = andx2y2);
    Add16(a = y2, b = x2, out = addx2y2);
    Mux16(a = andx2y2, b = addx2y2, sel = f, out = xy);
    Not16(in = xy, out = notxy);
    Mux16(a = xy, b = notxy, sel = no, out = out, out[15] = ng, out[0..7] = primo, out[8..15] =
    secondo);
    Or8Way(in = primo, out = primo1);
    Or8Way(in = secondo, out = secondo1);
    Or(a = primo1, b = secondo1, out = primsec);
    Not(in = primsec, out = zr);

this is my code and the program result is comparison failure at line 3 where is basically the compute -1
Reply | Threaded
Open this post in threaded view
|

Re: ALU problem

WBahn
Administrator
So what is your design outputting instead?

Walk through your design and see if you at least agree that it should be outputting what the emulator says it's outputting.

Then look at each step of the process and determine what you want it to do and what it is doing and find out where they don't match.