always @(posedge clk or posedge rst)
begin
if(rst) begin
areg<知岁=0
end
else begin
areg<=areg+y
end
end
library ieeeuse ieee.std_logic_1164.all
use ieee.std_logic_signed.all
entity alu is
port (a,b:in std_logic_vector(3 downto 0)
c, d , e, f: out std_logic_vector(3 downto 0))
end alu
architecture behav of alu is
begin
c <= a + b
d <= a - b
e <镇脊穗= a and b
f <= a or b
end behav
备注御卜:Quartus II 8.0下 编译及仿野谈真通过。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)