返回信息流case temp1 is
when "00100001" =>
count<= totalvector;xuanze<="01";
when "00100011" =>
count<= totalvector;xuanze<="10";
when "00100100" =>
zhankongbi<=totalvector;xuanze<="11";
when "00100010" =>
fangcnt<= totalvector;xuanze<="11";
when others=>null;
end case;
逻辑上当when "00100100" => 时候 占空比发生改变 fangcnt 的值是不会改变的 为什么我运行的时候占空比按照理想的改变了 但是 fangcnt 却莫名奇妙的也改变了呢??????
这是一条镜像帖。来源:北邮人论坛 / circuit / #19113同步于 2011/11/24
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Circuit机器人发帖
关于vhdl 语言的一些疑问
chenyuxxh
2011/11/24镜像同步5 回复
订阅后,新回复会通过你的通知中心匿名送达。
5 条回复
【 在 foryouever 的大作中提到: 】
: 把全程序贴上看看,看这部分貌似没问题
: --
process(cs,contrl,temp1,temp)
begin
if cs'event and cs='1' then
rd<='1';
temp<=contrl&temp(39 downto 8) ;
end if;
rd<='0';
temp1<=temp(7 downto 0);
totalvector<=conv_integer(temp(39 downto 8));
end process;
process(temp1)
begin
case temp1 is
when "00100001" =>
count<= totalvector;xuanze<="01";
when "00100011" =>
count<= totalvector;xuanze<="10";
when "00100100" =>
zhankongbi<=totalvector;
when "00100010" =>
fangcnt<= totalvector;xuanze<="11";
when others=>null;
end case;
end process;
当没有占空比那行 也就是说没有when "00100100" =>zhankongbi<=totalvector;
这行 代码运行正确 但是加了这行以后 count值就改变了 不知道为什么 。。。。。
temp<=contrl&temp(39 downto 8) ;
end if;
rd<='0';
temp1<=temp(7 downto 0);
LZ知道 temp1 是在缓一拍才赋值的吗 把这个contrl&temp(39 downto 8) 直接赋给 temp1 试试看吧
temp1<=temp(15 downto 8) ;
你那个赋值看着很别扭啊 temp 都不知道是何值
改改第一个process吧
【 在 foryouever 的大作中提到: 】
: temp<=contrl&temp(39 downto 8) ;
:
: end if;
: ...................
temp temp1 都没有复位赋初值,不是硬件描述语言的风格啊
【 在 foryouever 的大作中提到: 】
: temp<=contrl&temp(39 downto 8) ;
:
: end if;
: ...................
是挺别扭的 但是temp(39 downto 0) 一共四十位 然后低八位代表命令头 然后高32位代表数据 这样方便点 谢谢 我在改改