M
Mahurshi Akilla
Guest
I am doing 16 to 32 bit sign extention like below. I tested it out
and it works great. I know it is just 2 assign statements, but I am
wondering if there is a better way of doing this..
module sign_extender(in, out);
input [15:0] in;
output [31:0] out;
assign out[31:16] = {16{in[15]}};
assign out[15:0] = in[15:0];
endmodule
Mahurshi Akilla
and it works great. I know it is just 2 assign statements, but I am
wondering if there is a better way of doing this..
module sign_extender(in, out);
input [15:0] in;
output [31:0] out;
assign out[31:16] = {16{in[15]}};
assign out[15:0] = in[15:0];
endmodule
Mahurshi Akilla