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;
怎么实现此功能呢?先谢谢大家了。
Architecture one of select1 is
Begin
Process (S) begin
--要实现的功能: 当 S 为高电平时, sum_N 的值赋给sum;
if( s='1' )then sum=sum_N;
else
sum=sum_D;--当 S 无任何状态时,sum_D 的值赋给sum;
end Process;
End;
一周热门 更多>