VHDL simulation shows 'u' by read the input
'U' means uninitialized. You have to give an initial value for reg signal like for regr in line signal reg  : std_logic := '0'; or signal reg  : std_logic := '1'; depends on your intention