急切求助!谢谢恢复!
时间:10-02
整理:3721RD
点击:
m0<='1' when (d1>hold_s) else '0';
m1<='1' when (d2>hold_s) else '0';
m2<='1' when (d3>hold_s) else '0';
m3<='1' when (d4>hold_s) else '0';
m4<='1' when (d5>hold_s) else '0';
m5<='1' when (d6>hold_s) else '0';
m6<='1' when (d7>hold_s) else '0';
m7<='1' when (d8>hold_s) else '0';
m8<='1' when (d9>hold_s) else '0';
m<=m8& m7& m6& m5& m4& m3& m2& m1& m0;
process(clk)
variable counter : integer range 0 to 4:=0 ;
variable num : integer range 0 to 8 :=0;
begin
if clk'event and clk='1' then
counter:=0;
for num in 0 to 8 loop
if (m(num)='1') then
counter:=counter+1;
else
counter:=counter;
end if;
if counter=3 then
flag_s<='1'; --flag表示光斑标志
counter:=0;
exit;
else
flag_s<='0';
counter:=counter;
end if;
end loop;
end if;
end process;
请问各位高手:我上面用的FOR LOOP语句会不会被综合掉,是否为一个clk时钟for loop执行了八次?
能否满足以上语句含义的要求?
谢谢各位不吝赐教!
看帖不顶不厚道我顶

金山毒霸下载金山词霸金山快译word金山清理专家
m1<='1' when (d2>hold_s) else '0';
m2<='1' when (d3>hold_s) else '0';
m3<='1' when (d4>hold_s) else '0';
m4<='1' when (d5>hold_s) else '0';
m5<='1' when (d6>hold_s) else '0';
m6<='1' when (d7>hold_s) else '0';
m7<='1' when (d8>hold_s) else '0';
m8<='1' when (d9>hold_s) else '0';
m<=m8& m7& m6& m5& m4& m3& m2& m1& m0;
process(clk)
variable counter : integer range 0 to 4:=0 ;
variable num : integer range 0 to 8 :=0;
begin
if clk'event and clk='1' then
counter:=0;
for num in 0 to 8 loop
if (m(num)='1') then
counter:=counter+1;
else
counter:=counter;
end if;
if counter=3 then
flag_s<='1'; --flag表示光斑标志
counter:=0;
exit;
else
flag_s<='0';
counter:=counter;
end if;
end loop;
end if;
end process;
请问各位高手:我上面用的FOR LOOP语句会不会被综合掉,是否为一个clk时钟for loop执行了八次?
能否满足以上语句含义的要求?
谢谢各位不吝赐教!
看帖不顶不厚道我顶

看帖不顶不厚道我顶

金山毒霸下载金山词霸金山快译word金山清理专家
没有试过拉。但是估摸着会。为什么不加敏感量呢?这里就反映出VHDL的好处了。
请问这位大哥,,加敏感量 是什么意思?小弟不太明白
