I am designing a nanoprocessor and below is my instruction decoder code. As you can see I have used case statements for specific operations based on the input signal.
Because of this, as you can see, many outputs are shown as U (undefined) in the simulation. My question is: is it OK to leave it like this when run on the board, or should I initialize the output variables?
entity Instruction_Decoder is
Port ( Ins : in STD_LOGIC_VECTOR (11 downto 0);
RegCh : in STD_LOGIC_VECTOR (3 downto 0);
RegEN : out STD_LOGIC_VECTOR (2 downto 0);
LSel : out STD_LOGIC;
ImVal : out STD_LOGIC_VECTOR (3 downto 0);
RegSel1 : out STD_LOGIC_VECTOR (2 downto 0);
AdSel : out STD_LOGIC;
JMPF : out STD_LOGIC;
Jmadd : out STD_LOGIC_VECTOR (2 downto 0);
RegSel2 : out STD_LOGIC_VECTOR (2 downto 0));
end Instruction_Decoder;
architecture Behavioral of Instruction_Decoder is
signal I:std_logic_vector(1 downto 0);
begin
case1:process(Ins)
begin
case Ins(11 downto 10) is
when "10"=>
RegEN<=Ins( 9 downto 7);
ImVal<=Ins( 3 downto 0);
LSel<='1';
when "00"=>
RegSel1<=Ins(9 downto 7);
RegSel2<=Ins(6 downto 4);
AdSel<='1';
RegEN<=Ins(9 downto 7);
LSel<='0';
when "01"=>
RegSel1<=Ins(9 downto 7);
RegEN<=Ins(9 downto 7);
AdSel<='0';
LSel<='0';
when "11"=>
RegSel1<=Ins(9 downto 7);
if (RegCh="0000") then
JMPF<='1';
Jmadd<=Ins(2 downto 0);
end if;
when others=>
end case;
end process case1;
end Behavioral;