|
Re: [求助] 求帮写一个CPLD分频的程序(Verilog)
这是载来的一个程序,希望有些帮助
vhdl如下:
process(clk)
begin
if clk='1' and clk'event then
if temp1="11" then
temp1<="00";
else
temp1<=temp1+1;
end if;
end if;
q0<=temp1(0);
q1<=temp1(1);
end process;
process(temp1(1))
begin
if temp1(1)='1' and temp1(1)'event then
if temp2="11" then
temp2<="00";
else
temp2<=temp2+1;
end if;
end if;
q2<=temp2(0);
q3<=temp2(1);
end process;
process(temp2(1))
begin
if temp2(1)='1' and temp2(1)'event then
if temp3="11" then
temp3<="00";
else
temp3<=temp3+1;
end if;
end if;
q4<=temp3(0);
q5<=temp3(1);
end process;
可以实现2,4,8,16,32,64分频 |
|