Tuesday 2 August 2016

Binary to Gray:

 Binary to Gray:


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

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

endmodule

0 comments:

Post a Comment

if you have any doubt please let me know