Verilog output port is high impedance (Z) when driven by a sub module
I believe that temp1 in the top level should be a wire, not an reg, as reg is not intended to be driven from an output port of a module.

Try changing to just output [3:0] temp1;