if(temp10="0101" and temp1="1001")then co<='1'; if(cin='1')then temp10<="0000";…
Jump to turn (6)
- 1if(temp10="0101" and temp1="1001")then co<='1'; if(cin='1')then temp10<="0000";
- 2library ieee; use ieee.stdlogic1164.all; use ieee.stdlogicunsigned.all; entity c
- 3library ieee; use ieee.stdlogic1164.all; use ieee.stdlogicunsigned.all; entity c
- 4有无语法问题?
- 5Error (10500): VHDL syntax error at counter60min.vhd(47) near text "if"; expecti
- 6process(clr,clk,change,c) begin if(clr='1')then temp1<="0000"; temp10<="0000"; e
- User
if(temp10="0101" and temp1="1001")then co<='1'; if(cin='1')then temp10<="0000"; temp1<="0000"; end if; else co<='0'; end if; end if;这一段有什么错误?
- Assistant
在 VHDL 中,字符串比较应该使用“=”而不是“==”。因此,“temp10="0101" and temp1="1001"”应该改为“temp10 = "0101" and temp1 = "1001"”。除此之外,代码看起来没有其他错误。
- User
library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all;