library ieee;
use ieee. std_logic_1164.all;
use ieee. std_logic_unsigned.all;
use ieee. std_logic_arith.all;
En
tity select1 is
Port(
S: in std_logic;
sum_D: in integer range 0 to 9999;
sum_N: in integer range 0 to 9999;
sum: out integer range 0 to 9999
);
End;
Architecture one of select1 is
Begin
Process
要实现的功能: 当 S 为高电平时, sum_N 的值赋给sum;
当 S 无任何状态时,sum_D 的值赋给sum;
end Process;
End;
怎么实现此功能呢?先谢谢大家了。
Begin
Process(S,sum_N,sum_D)BEGIN
--要实现的功能: 当 S 为高电平时, sum_N 的值赋给sum;
IF S = '1' THEN sum <= sum_N;
--- 当 S 无任何状态时,sum_D 的值赋给sum;
ELSE sum <= sum_D;
END PROCESS;
End;
一周热门 更多>