Hezi wrote
Hi, I was wondering if the following is a legal syntax:
Mux4way16(a=input1, b=input2, c=input3, d=input4, sel=somebits, out=muxOutput);
SomeChip(in=someIn[0], out=input1[0]);
SomeChip(in=someIn[1], out=input1[2]);
.
.
.
OtherChip(in=otherIn[0], out=input2[0]);
.
.
.
etc.
So I beleive it is legal to use a bus before defining it, but is it also legal to define the bus one bit at a time? and if not, how can I work around this?
What are someIn and otherIn?
It would appear that you are connecting input signals (e.g., input1[0]) to the outputs of other parts. If this is the case, this will case conflicts.
As for buses, the HDL the authors have devised only allows sub-bussing on top-level signals -- i.e., those that are defined as buses in the IN and OUT statements of a part.
This is inconvenient, but not insurmountable, since you can also sub-bus I/O signals of the parts you use (since those signals were declared in the IN and OUT statements of the part being used).