标题: 小题目 求助 [打印本页] 作者: 小试 时间: 2010-11-8 13:02 标题: 小题目 求助 刚学了一点,有个题目不会希望会的大侠给做一下 哈哈谢了
一、
library ieee;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
use IEEE.std_logic_arith.all;
entity counter_t is
generic(width : integer := 8);
port(data : in std_logic_vector (width-1 downto 0);
load, en, clk, rst : in std_logic;
q : out std_logic_vector (width-1 downto 0));
end counter_t;
architecture behave of counter_t is
signal count : std_logic_vector (width-1 downto 0);
begin
process(clk, rst)
begin
if rst = '1' then
count <=(others=>'0'); --清零
elsif CLK'EVENT AND CLK='1' then --上升沿检测
if load = '1' then
count <= data;
ELSIF en = '1' then
count <= count + 1;
END IF;
end if;
end process;
Q<=COUNT;
end behave;
要求:
(一)基本要求:
1、分析上面VHDL代码所实现的电路功能;
2、分析各语句的功能;
(二)进阶要求:
1、改写上述代码使其能实现相同的电路功能;
2、利用EDA工具(QUARTUS II,ISE,SYNPLIFY PRO)等完成编译、仿真并给出其RTL级电路图;
二、