Prev Problem
Next Problem

17. Binary to Gray Code Converter

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

 

 

Code

/*Write your code here*/
module bin2gray4 (
    input wire [3:0] bin_in,
    output wire [3:0] gray_out 
);
assign gray_out = {bin_in [3], (bin_in[3:1] ^ bin_in[2:0])};

endmodule
Was this helpful?
Upvote
Downvote