为了账号安全,请及时绑定邮箱和手机立即绑定

求解,关于在vhdl中的component的定义及使用?

求解,关于在vhdl中的component的定义及使用?

浮云间 2021-06-16 18:11:52
1.如何定义component,是直接编写需要的文件vhd 文件吗,与一般的普通vhd文件有何不同?2.如何调用component,能不能有简单的例子来解释一下?3.component里面的generic以及后面括号里的是什么内容?4.举个最简单的例子,构建一个8bit寄存器,调用8个DFF触发器,整个过程5.感激!--以下定义dfflibrary ieee;use ieee.std_logic_1164.all;entity dff isport( clk, D : in std_logic;Q : out std_logic);end dff;architecture arch_dff of dff isbeginprocess(clk)beginif(clk'event and clk='1') thenQ<=D;end process;以下调用dff作为component构建8bit register并行入并行出PIPO 触发器library ieee;use ieee.std_logic_1164.all;entity reg_8bit isport( clk, clr : in std_logic;x : in std_logic_vector(7 down to 0);y: out std_logic_vector(7down to 0));end reg_8bit;architecture arch_reg_8bit of reg_8bit is不知道前面有没有写对,然后后面也不知道了,求助...还有,8bit 触发器是不是可以可有有直接通过编程实现或者通过从小到大构建(比如先dff,然后以dff为component来往上构建更复杂的元件)
查看完整描述

2 回答

?
UYOU

TA贡献1878条经验 获得超4个赞

  1. 如何定义component,是直接编写需要的文件vhd 文件吗,与一般的普通vhd文件有何不同?
    2.如何调用component,能不能有简单的例子来解释一下?
    3.component里面的generic以及后面括号里的是什么内容?
    4.举个最简单的例子,构建一个8bit寄存器,调用8个DFF触发器,整个过程
    5.感激!
    --以下定义dff
    library ieee;
    use ieee.std_logic_1164.all;
    entity dff is
    port( clk, D : in std_logic;
    Q : out std_logic
    );
    end dff;
    architecture arch_dff of dff is
    begin
    process(clk)
    begin
    if(clk'event and clk='1') then
    Q<=D;
    end process;
    以下调用dff作为component构建8bit register并行入并行出PIPO 触发器
    library ieee;
    use ieee.std_logic_1164.all;
    entity reg_8bit is
    port( clk, clr : in std_logic;
    x : in std_logic_vector(7 down to 0);
    y: out std_logic_vector(7down to 0)
    );
    end reg_8bit;

    architecture arch_reg_8bit of reg_8bit is
    不知道前面有没有写对,然后后面也不知道了,求助...
    还有,8bit 触发器是不是可以可有有直接通过编程实现或者通过从小到大构建(比如先dff,然后以dff为component来往上构建更复杂的元件)

查看完整回答
反对 回复 2021-06-21
  • 2 回答
  • 0 关注
  • 1670 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信