Tuesday 2 August 2016

Gray to Binary

Gray to Binary:


module g2b(b,g);
    output [3:0] b;
    input [3:0] g;

assign b[3] = g[3];
assign b[2] = g[3] ^ g[2];
assign b[1] = g[3] ^ g[2] ^ g[1];
assign b[0] = g[3] ^ g[2] ^ g[1] ^ g[0];


endmodule

0 comments:

Post a Comment

if you have any doubt please let me know