我想交换 and 的值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;