Binary To Gray Code Converter using Logical Gates (Data Flow Modeling Style)-
Verilog CODE-
//-----------------------------------------------------------------------------
//
// Title : Binary_to_Gray
// Design : verilog upload
// Author : Naresh Singh Dobal
// Company : nsd
//
//-----------------------------------------------------------------------------
//
// File : Binary To Gray Code Converter.v
module Binary_to_Gray ( 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[2]^din[1];
assign dout[0] = din[1]^din[0];
endmodule
Output Waveform : Binary To Gray Code Converter |
Verilog CODE-
//-----------------------------------------------------------------------------
//
// Title : Binary_to_Gray
// Design : verilog upload
// Author : Naresh Singh Dobal
// Company : nsd
//
//-----------------------------------------------------------------------------
//
// File : Binary To Gray Code Converter.v
module Binary_to_Gray ( 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[2]^din[1];
assign dout[0] = din[1]^din[0];
endmodule
2 comments :
how to give the inputs after simulation
Where is text fixture
Post a Comment