-1

I'm having trouble getting my .hdl files to loads in the HardwareSimulator. So far I have implemented FullAdder.hdl and Add16.hdl.

The error message I'm recieving is

line 22, zab has no source pin

Here is the relevant code for the Add16:

 CHIP Add16 {
IN x[16], y[16];
OUT out[16];


PARTS: 
HalfAdder(x=x[0],y=y[0],sum=out[0],carry=c);
FullAdder(x=x[1],y=y[1],c=c,sum=out[1],carry=d);
FullAdder(x=x[2],y=y[2],c=d,sum=out[2],carry=e);
FullAdder(x=x[3],y=y[3],c=e,sum=out[3],carry=f);
FullAdder(x=x[4],y=y[4],c=f,sum=out[4],carry=g);
FullAdder(x=x[5],y=y[5],c=g,sum=out[5],carry=h);
FullAdder(x=x[6],y=y[6],c=h,sum=out[6],carry=i);
FullAdder(x=x[7],y=y[7],c=i,sum=out[7],carry=j);
FullAdder(x=x[8],y=y[8],c=j,sum=out[8],carry=k);
FullAdder(x=x[9],y=y[9],c=k,sum=out[9],carry=l);
FullAdder(x=x[10],y=y[10],c=l,sum=out[10],carry=m);
FullAdder(x=x[11],y=y[11],c=m,sum=out[11],carry=n);
FullAdder(x=x[12],y=y[12],c=n,sum=out[12],carry=o);
FullAdder(x=x[13],y=y[13],c=o,sum=out[13],carry=p);
FullAdder(x=x[14],y=y[14],c=p,sum=out[14],carry=q);
FullAdder(x=x[15],y=y[15],c=q,sum=out[15],carry=drop);
}

I'm strugginling to find the error since I'm pretty sure I've implemented this chip in exactly the same way in the past and it worked fine.

As for the full adder, it's the same error message but for line 16.

I'll provide the relevant code for this part also:

CHIP FullAdder {
IN x, y, z;  // 1-bit inputs
OUT sum,     // Right bit of x + y + z
    carry;   // Left bit of x + y + z

PARTS:
HalfAdder(x=x,y=y,sum=xy,carry=zxy);
HalfAdder(x=z,y=xy,sum=sum,carry=s);
Or(x=zab,y=s,out=carry);


}

I can't wrap my mind around the error referring to line 16. That's way after the terminating bracket in FullAdder.

I've browsed the internet and as far as I can tell my implementation is perfectly correct. Any advice from anyone who are proficient in the Computer Processors area? This would definitely be useful for anyone else who are running into the same/similar problems.

Thanks

edit: According to this link Logic Gates my implementation looks more or less exactly the same. Could it be a faulty HardwareSim at my end? Although I doubt that since I've used it in the past and it was recommended to me by my University.

Lundin
  • 195,001
  • 40
  • 254
  • 396

1 Answers1

2

The problem is in the x input to your Or gate in the FullAdder. You are referring to a signal (pin) "zab" but no such signal is defined.

In future, please remember to post the entire files. It is hard to help you diagnose an error in line 16 when it is difficult to tell what line that actually is.

MadOverlord
  • 1,034
  • 6
  • 11
  • That line is just empty space Refe to 'I can't wrap my mind around the error referring to line 16. That's way after the terminating bracket in FullAdder. ' in my OP – George Strawbridge Apr 19 '18 at 13:57
  • Yes, but there is no way we can know that without having the complete file(s). And also no way an interested party could replicate the error for themselves without making possibly unwarranted assumptions. – MadOverlord Apr 20 '18 at 14:26
  • To clarify: 'zab' is an internal pin of the FullAdder chip that is connected to 'x' input of the Or chip but not to anything else: '?---zab---x' I think you meant for the Or chip's 'x' input pin to connect to the 'zxy' internal pin and that 'zab' was a typo. – Paganini Nov 05 '20 at 21:01