Prev Problem
Next Problem

17. Binary to Gray Code Converter

Back To All Submissions
Previous Submission
Next Submission

So SMART I'd never write this one on my own. Hajże!

How do you plan to solve it?

 

 

Code

module bin2gray4 (
    input [3:0] bin_in,
    output [3:0] gray_out
);
    assign gray_out = bin_in ^ (bin_in >> 1);

endmodule
Was this helpful?
Upvote
Downvote