VHDL分频器代码
我有以下代码:VHDL分频器代码,vhdl,Vhdl,我有以下代码: architecture Behavioral of BlockName is signal t: std_logic; signal c : std_logic_vector (1 downto 0); begin process (reset, clk) begin if (reset = '1') then t <= '0'; c <= (others=>'0'); elsif clk'event and
architecture Behavioral of BlockName is
signal t: std_logic;
signal c : std_logic_vector (1 downto 0);
begin
process (reset, clk) begin
if (reset = '1') then
t <= '0';
c <= (others=>'0');
elsif clk'event and clk='l' then
if (c = din) then
t <= NOT(t);
c <= (others=>'0');
else
c <= c + 1;
end if;
end if;
end process;
dout <= t;
end Behavioral;
BlockName的架构行为是
信号t:std_逻辑;
信号c:标准逻辑向量(1到0);
开始
过程(重置、时钟)开始
如果(重置='1'),则
T
c'0')
相当于c,因为'c'被视为一个向量,并用零'c'0')存储它的每一位;'使用了,VHDL中没有阻塞和非阻塞信号的概念。这里的“=”用于比较和“只需将代码粘贴在这里,不要将其设置为图像c'0”)
是一个赋值语句,其右侧表达式是一个数组,其类型和长度由上下文提供,值取决于数组元素与元素值的关联others
作为一个选项,这里代表长度为c
的std\U逻辑\U向量的每个元素,并且该表达式将值“0”与该std\U逻辑\U向量的每个元素相关联。子类型(索引范围约束)将在赋值期间转换为c
的子类型。NOT
是一元逻辑运算符。此处不需要在t
周围加括号。"