/*Write your code here*/
module bin2gray4 (
input [3:0]bin_in,
output [3:0] gray_out
);
assign gray_out =bin_in ^ (bin_in>>1);
// if bin_in is 1010 , ans: 1, 1 ^0 =1, 0^1 =1, 1^0=1 :::1111
// for bin to gray compare only the adjacent bits, not with the result bit
endmodule