_TOP_MENU

Dec 17, 2016

Verilog Code for Gray to Binary Code Converter



Block diagram for Gray to Binary Converter ->




Verilog code for Gray to Binary converter.

//-----------------------------------------------------------------------------
// Title       : Gray_to_Binary
// Design      : verilog upload
// Author      : Rahul Jain
//-----------------------------------------------------------------------------
//
// File        : Gray to Binary Code Converter 

module Gray_to_Binary ( din ,dout );

output [3:0] dout ;

input [3:0] din ;

assign dout[3] = din[3];
assign dout[2] = din[3]^din[2];
assign dout[1] = din[3]^din[2]^din[1];
assign dout[0] = din[3]^din[2]^din[1]^din[0];

endmodule

Gray to Binary Table for 4-bit.




Below is the simulation result using modelsim. 




Thanks for reading my Blog.

Table of Contents

No comments:

Post a Comment