original design of ALU

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

original design of ALU

lonelyjohner

Could anyone please check my design of the ALU in this image.
I did not build it on simulator because Xor16 did not exist during the courses.
But I wonder if this design matches the description of ALU? Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: original design of ALU

cadet1620
Administrator
lonelyjohner wrote
Could anyone please check my design of the ALU in this image.
    ...
I did not build it on simulator because Xor16 did not exist during the courses.
But I wonder if this design matches the description of ALU? Thanks.
You can test this yourself by making an Xor16 part. In fact, I did make some custom parts when I implemented my first ALU.

--Mark

Reply | Threaded
Open this post in threaded view
|

Re: original design of ALU

lonelyjohner
I have created Xor16 and Or16Way chips to implement my idea. But the simulator keeps telling me that ',' or ')' are expected in line 49. The 49th line is this:

Xor16(a=x,b=x,out=xor_x);

I have test the Xor16 and it worked just fine.

CHIP Xor16 {

    IN a[16], b[16];
    OUT out[16];

    PARTS:
Xor(a=a[0],b=b[0],out=out[0]);
Xor(a=a[1],b=b[1],out=out[1]);
Xor(a=a[2],b=b[2],out=out[2]);
Xor(a=a[3],b=b[3],out=out[3]);
Xor(a=a[4],b=b[4],out=out[4]);
Xor(a=a[5],b=b[5],out=out[5]);
Xor(a=a[6],b=b[6],out=out[6]);
Xor(a=a[7],b=b[7],out=out[7]);
Xor(a=a[8],b=b[8],out=out[8]);
Xor(a=a[9],b=b[9],out=out[9]);
Xor(a=a[10],b=b[10],out=out[10]);
Xor(a=a[11],b=b[11],out=out[11]);
Xor(a=a[12],b=b[12],out=out[12]);
Xor(a=a[13],b=b[13],out=out[13]);
Xor(a=a[14],b=b[14],out=out[14]);
Xor(a=a[15],b=b[15],out=out[15]);
}

I do not understand where I might be missing a ',' or ')' ?

Reply | Threaded
Open this post in threaded view
|

Re: original design of ALU

cadet1620
Administrator
If the problem is line 49 of ALU.hdl, including the source to Xor16 is not likely to show anything useful.  Look af lines before and after ALU Line 49; sometimes reported error line numbers can be off depending upon the exact nature of the syntax error.

If you can't find anything, feel free to send me a zip or rar files with all your HDLs in it and I'll see if I can tell what's wrong.

--Mark