导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→关于VHDL中WHILE LOOP的疑问

* 30347: 关于VHDL中WHILE LOOP的疑问

   mudice 
mudice发表的帖子 

 关于VHDL中WHILE LOOP的疑问
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity pwmtest is
port(clk : in std_logic;
     dianshu :in std_logic_vector(16 downto 0);
     wave : out std_logic);
end entity;
architecture behav of pwmtest is
begin
process(clk,dianshu)
variable n: integer;
begin
if(clk'event and clk='1') then
n:=conv_integer(dianshu);
if(n=0) then
wave  <='0';
else
while (n>  0) loop*******出问题处
     wave  <='1';
     n:=n-1;
end loop;
end if;
end if;
end process;
end behav;

********此程序较简单,但WHILE LOOP处通不过,有什么问题望各位指出,谢谢!

发表时间:2003年5月15日10:01:29

  
回复该帖

本主题共有 1 帖,分页:>>>>>该主题的所有内容[1]条

 *树形目录 只列出部分跟帖的标题以及简单的摘要信息 该主题的部分跟帖如下:

[上一篇帖子]:有这么复杂吗,我直接用三级管驱动了就OK了! /P P 补充:方波频率控制蜂鸣器的发声,调好了可
[下一篇帖子]:去看看摸电书!