作业内容:
根据下面的代码,画出电路结构框图。
实际操作如下:
老师给的图片里只有顶层文件,没有底层文件,因此我们需要先找到底层文件:《EDA技术与CPLD/FPGA开发应用简明教程(第二版)》P142-143页,描述底层D触发器的源程序,具体代码如下:(结合了我的工程,端口名和文件名稍有修改)
-- library declaration
library IEEE;
use IEEE.std_logic_1164.all;
-- entity
entity T_FF is
port ( T,CLK : in std_logic;
Q : out std_logic);
end T_FF;
-- architecture
architecture example1 of T_FF is
begin
process(CLK)
begin
if CLK='1'and CLK'event then Q<=T;
end if;
end process;
end example1;
接下来是老师给的顶层文件代码:(结合了我的工程,端口名和文件名稍有修改)
-- library declaration
library IEEE;
use IEEE.std_logic_1164.all;
-- entity
entity aaa is
Port (EN1,EN2 : in std_logic;
CLK : in std_logic;
Z : out std_logic);
end aaa;
-- architecture
architecture arch of aaa is
component T_FF
port ( T,CLK : in std_logic;
Q : out std_logic);
end component;
signal t_in,t1_s,t2_s : std_logic;
begin
t1 : T_FF
port map (T => t_in,
CLK => CLK,
Q => t1_s );
t2 : T_FF
port map (T => t1_s,
CLK => CLK,
Q => t2_s );
Z <= t2_s OR t1_s;
t_in <= EN1 AND EN2;
end arch;
然后就可以点击编译运行啦!点击红色方框部分
编译成功后:有绿色小对钩
然后点击Tools->Netlist Viewers->RTL Viewer一下我们的电路结构:
电路如下:
把封装展开看一下下:
完美,可以交啦~~~
第一次发CSDN有些紧张和激动~~~