input0
との値を入れ替えてinput1
、小さい方を出力したい。Modelsim でプロジェクトをシミュレートすると、信号出力の波形が赤い線になります。私の間違いは何ですか?
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity MF is
port (clk : in std_logic;
input0: in std_logic_vector(2 downto 0);
input1: in std_logic_vector(2 downto 0));
end MF;
architecture Behavioral of MF is
signal bubble0: std_logic_vector(2 downto 0);
signal bubble1: std_logic_vector(2 downto 0);
begin
bubble0 <= input0;
bubble1 <= input1;
output <= bubble0; -- my output
process(clk)
begin
if rising_edge(clk) then
if bubble0 > bubble1 then -- swap
bubble1 <= bubble0;
bubble0 <= bubble1;
end if;
end if;
end process;
end Behavioral;