Help me please!!

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

Help me please!!

Gia Hung
hello everyone, i'm working on the project 2, and i met this kind of error when i submitted my work for ALU.hdl. "Line 65, zerox has no source pin". I've tried to fix, but its not working

CHIP ALU {
    IN  
        x[16], y[16],  // 16-bit inputs        
        zx, // zero the x input?
        nx, // negate the x input?
        zy, // zero the y input?
        ny, // negate the y input?
        f,  // compute (out = x + y) or (out = x & y)?
        no; // negate the out output?
    OUT
        out[16], // 16-bit output
        zr,      // if (out == 0) equals 1, else 0
        ng;      // if (out < 0)  equals 1, else 0

    PARTS:
    //// Mux16(a=x, b[0..15]=false, sel=zx, out=zerox);
        Not16(in=zerox, out=notx);
        Mux16(a=zerox, b=notx, sel=nx, out=presetx);
       
        Mux16(a=y, b[0..15]=false, sel=zy, out=zeroy);
        Not16(in=zeroy, out=noty);
        Mux16(a=zeroy, b=noty, sel=ny, out=presety);
       
        Add16(a=presetx, b=presety, out=addxy);
        And16(a=presetx, b=presety, out=andxy);
        Mux16(a=andxy, b=addxy, sel=f, out=operatedxy);
       
        Not16(in=operatedxy, out=notout);
        Mux16(a=operatedxy, b=notout, sel=no, out[0..7]=lowout, out[8..15]=highout, out[15]=ng, out=out);
       
        Or8Way(in=lowout, out=orlowout);
        Or8Way(in=highout, out=orhighout);
       
        Or(a=orlowout, b=orhighout, out=notzr);
        Not(in=notzr, out=zr);
       
}

thank you all!!
Reply | Threaded
Open this post in threaded view
|

Re: Help me please!!

WBahn
Administrator
Well, look at everyplace where you have the signal zerox.

   //// Mux16(a=x, b[0..15]=false, sel=zx, out=zerox);
        Not16(in=zerox, out=notx);
        Mux16(a=zerox, b=notx, sel=nx, out=presetx);

The first is commented out, so it doesn't apply.

The other two are inputs to various parts.

So there is no output of any part that is establishing the logic level on that signal, hence the error message.