Mux16, is my soultion would work ?

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

Mux16, is my soultion would work ?

Ypaps
CHIP Mux16 {
    IN a[16], b[16], sel;
    OUT out[16];

    PARTS:
    // Put your code here:
        Not(in=sel,out=Nsel);
        And16(a=a[15] , b=Nsel, out=out1);
        and16[a=b[15] , b=sel , out=out2);
        Or16(a=out1 , b= out2 , out=out);
}

would like to know if its a right way to build this chip, i've seen the the suggested and correct way is using the mux chip we build earlier 16 times (0...15) but can i stick with my way as well?
thanks for the answers
Reply | Threaded
Open this post in threaded view
|

Re: Mux16, is my soultion would work ?

WBahn
Administrator
There are multiple ways of doing most of the parts. Any solution that behaves according to the specification is a correct solution.

Have you tested your solution to see if it behaves properly? If so (and if the tests you good enough), then it is correct.

The suggested solution is simply emphasizing using increasing layers of abstraction as you go from primitive to complex logic structures. This approach emphasizes the simple parallelism involved, which is masked by the limited expressiveness of this HDL. In some schematic capture programs you could implement the Mux16 with a single Mux part in which the signal names used imply the needed parallelism.