初学者,请教问题!!!1

2019-03-25 09:38发布

entity cnt16 is
port(clk:in std_logic;
     dout:out std_logic_vector(3 downto 0);
          dclk1:out std_logic);
end cnt16;

architecture Behavioral of cnt16 is
     signal clk1:std_logic :='1';
          signal q:integer range 0 to 24000000:=0;
     signal w:std_logic_vector(3 downto 0):="0000";

begin
     dclk1<=clk1; dout<=not w;
          t1:process(clk)
            begin
                       if clk'event and clk='1' then
                                   if q=23999999 then
                                           q<=0;clk1<=not clk1;
                                        else
                                           q<=q+1;
                                        end if;
                                  end if;
                 end process;
                 
          t2:process(clk1)
            begin
                       if clk1'event and clk1='1' then
                                   if w=9 then
                                           w<="0000";
                                        else
                                           w<=w+1;
                                        end if;
                                  end if;
                 end process;
end Behavioral;


错误提示在if w=9 then
                                           w<="0000";
                                        else
                                           w<=w+1;
can not have such operands in this context. 请问这是什么意思?应该怎么修改? 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
7条回答
beijing2008lina
1楼-- · 2019-03-25 12:18
< / 没人知道怎么修改吗?
huxiaokai2005
2楼-- · 2019-03-25 12:42
可能是你的library没加全
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all
use ieee.std_logic_arith.all;
beijing2008lina
3楼-- · 2019-03-25 14:44
 精彩回答 2  元偷偷看……
357482894
4楼-- · 2019-03-25 20:15
w是标准逻辑类型,不能和1进行加操作。
yixindianzi
5楼-- · 2019-03-25 21:00
popcup512j
6楼-- · 2019-03-25 23:30
写成w=“1001”试试!

一周热门 更多>