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

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来往上构建更复杂的元件)

浮云间
浏览 1671回答 2
2回答

UYOU

如何定义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来往上构建更复杂的元件)
打开App,查看更多内容
随时随地看视频慕课网APP