module adder_16bit (
  input [15:0] a,
  input [15:0] b,
  input Cin,
  output [15:0] y,
  output Co
);

  wire [7:0] carry;
  wire [7:0] sum;

  // Instantiating eight 8-bit adders
  genvar i;
  generate
    for (i = 0; i < 8; i = i + 1) begin : ADDER_INST
      // Instantiating 8-bit adder
      adder_8bit adder_inst (
        .a(a[i*2 +: 8]),  // Extracting 8-bit portion from a
        .b(b[i*2 +: 8]),  // Extracting 8-bit portion from b
        .Cin(i ? carry[i-1] : Cin),  // Using carry from previous adder or Cin for the first adder
        .y(y[i*2 +: 8]),  // Storing the 8-bit sum
        .Co(carry[i])  // Storing the carry-out
      );
    end
  endgenerate

  // Generating carry-out for the 16-bit output
  assign Co = carry[7];

endmodule