1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
module FLIP #( parameter WIDTH = 1 ) ( input [WIDTH-1:0] in, output [WIDTH-1:0] out ); genvar flip_idx; for (flip_idx = 0, flip_idx < WIDTH; flip_idx++) begin assign out[flip_idx] = in[WIDTH-flip_idx-1]; end endmodule