Unless you are working with signed values, I think you will need a custom function for this. If you are working with signed values, the MSB will be X-extended on an assignment from a 16-bit value to a 32-bit value if the sign bit is X. However if the MSB (the sign bit) is a 1 then it will be 1-extended, which is most likely not what you want if you are working with unsigned values.
Here's a simple function to do this.
function [31:0] extend(input[15:0] in);
begin
if (in[15] === 1'bX) begin
extend = {16'hXXXX, in};
end else begin
extend = {16'h0000, in};
end
end
endfunction
Example:
$display("%032b", extend(16'h0000));
$display("%032b", extend(16'hFFFF));
$display("%032b", extend(16'bX000_0000_0000_0000));
Output:
00000000000000000000000000000000
00000000000000001111111111111111
xxxxxxxxxxxxxxxxx000000000000000