WHEN "0000000000000001" => --SUB减
temp_Y <= inputA - inputB;
if(inputA(15) = '0' and inputB(15) = '0' and temp_Y(15) = '1') then --进行溢出和是否进位判断
flags<="0000000000000001";
end if;
if(inputA(15)='1' and inputB(15)='1' and temp_Y(15)='0') then --进行溢出和是否进位判断
flags<="0000000000000011";
end if;
if(temp_Y = "0000000000000000") then --0标志位与0进行比较
flags<= flags or "0000000000000100";
end if;
if(temp_Y(15) = '1') then --通过符号位来判断正负标志位
flags<=flags or "0000000000001000";
end if;
WHEN "0000000000000010" => --AND逻辑与
temp_Y <= (inputA AND inputB);
if(temp_Y = "0000000000000000") then --0标志位与0进行比较
flags<= "0000000000000100";
end if;
if(temp_Y(15) = '1') then --通过符号位来判断正负标志位
flags<=flags or "0000000000001000";
end if;