论文首页哲学论文经济论文法学论文教育论文文学论文历史论文理学论文工学论文医学论文管理论文艺术论文 |
process煟悖欤耄 --clk为外部时钟(如晶振)
variable temp,fen:std_logic_vector(15 down to 0);
constant temp1:std_logic_vector(15 down to 0):=“1111111111111111”;
variable a:std_logic;
begin
fen:=temp1-fen_in; --使分频后的频率正比于频率控制字
if clk=‘1’ and clk'event then
if temp=(‘0’&fen(15 down to 1)) then --相当于除2运算
a:=not a;
temp:=temp+1;
elsif temp=fen then
a:=not a;
temp:=“0000000000000000”;
else
temp:=temp+1;
end if;
end if;
fen out<=a; --fen out 为输入时钟的频率fen倍分频
end process;
3.3 寻址计数器设计
寻址计数器主要用于产生对ROM寻址输出波形数据的寻址信号,寻址空间为360字节,具体的程序代码如下:
process(clk)
variable temp:integer rang