Wednesday 11 February 2015

4 to 2 Encoder (Structural Modeling)

4 to 2 Encoder (Structural Modeling):


module encoder_struct(
    input [3:0] d,
    output [1:0] a
    );
wire x,y,z;
not g1(x,d[2]);
and g2(y,x,d[1]);
or g3(a[0],y,d[3]);
or g4(a[1],d[2],d[3]);

endmodule
 

No comments:

Post a Comment