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;
process(Aclr,Clk) --这个进程不会对q_t(0)赋值 begin if Aclr='1' then for i in 1 to Number loop q_t(i)<=(others=>'0'); end loop; elsif Clk'event and Clk='1' then for i in 1 to Number loop q_t(i)<=q_t(i-1); end loop; end if; end process; Q<=q_t(Number);