imut FPGA第三次作业 2021.6.8 *秋昊

作业内容:

根据下面的代码,画出电路结构框图。

实际操作如下:

老师给的图片里只有顶层文件,没有底层文件,因此我们需要先找到底层文件:《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有些紧张和激动~~~

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值