ALU-Problem

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

ALU-Problem

weijia
This post was updated on .
remove code

Problem:In HDL file out(16) and nx(1) have different bus widths

I think it is strange.

Thank's for reading!
Reply | Threaded
Open this post in threaded view
|

Re: ALU-Problem

weijia
find the problem: nx is already defined.oh fuck
Reply | Threaded
Open this post in threaded view
|

Re: ALU-Problem

cadet1620
Administrator
In reply to this post by weijia
weijia wrote
    //get notx
    Not16(in=x,out=nx);
'nx' is a 1-bit INPUT to the ALU.  You want ..., out=notx);

The next problems that you are likely to run into are

"A pin name is expected" in
    Not16(in[0..15]=false,out=-1);
-1 is not a legal pin name.  You don't need to do anything special to get -1.  "true" is all 1 bits, and like "false" it matches any bus width.

"Can't connect gate's output pin to part" in
    Or(a=out[0],b=out[1],out=t0);
Connecting to a pin mentioned in the OUTPUT section is not allowed.
Fortunately, you can "solder" more than one wire to a part's output:

     Mux16(a=outf,b=noutf,sel=no,out=out, out[0:7]=outlow, out[]=..., out[]=...,);
and use all those extra outputs for zr and ng  processing.

Think about how to use Or8Way do save a lot of typing.

--Mark

Reply | Threaded
Open this post in threaded view
|

Re: ALU-Problem

weijia
Thanks,all fixed and it can run now.Thank you anyway!