اطلاعیه

Collapse
No announcement yet.

این Error توی ISE11.1 واسه چیه ؟

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    این Error توی ISE11.1 واسه چیه ؟

    + can not have such operands in this context.

    من همه ی لایبرری های مربوط رو Use کردم ولی بازم وقتی دستور :

    [pre]j <= j + 1 ;[/pre]

    می نویسم این Error می گیره ؟؟؟؟؟

    همه ی این لایبری ه رو use کردم :
    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    use IEEE.STD_LOGIC_ARITH.ALL;
    use IEEE.STD_LOGIC_UNSIGNED.ALL;
    use IEEE.numeric_std.all;
    use IEEE.numeric_bit.all;

    #2
    پاسخ : این Error توی ISE11.1 واسه چیه ؟

    کسی نمی تونه کمک کنه ؟ oo:

    دیدگاه


      #3
      پاسخ : این Error توی ISE11.1 واسه چیه ؟

      سلام
      برای استفاده از اپراتورهای حسابی، اگه سیگنال رو از نوع integer تعریف کنی، نیازی به use کردن library های اضافه نیست ولی برای نوع std_logic_vector باید بسته های ieee.std_logic_unsigned یا ieee.std_logic_signed رو هم use کنی. مثال های زیر رو ببینید که در هر
      دو عبارت cnt <= cnt + 1 وجود داره.

      بر اساس std_logic_vector
      کد:
      ----------------------------------------------------------------------------------
      -- Auther: mas 
      -- Create Date:  00:58:57 04/28/2010 
      -- Project Name:	led_tst
      -- Target Devices: general/ test on spartan3a board
      -- Tool versions: ISE 11.1
      -- Description: 
      --	 electronics Hello world project!:
      -- 	it divides 50MHz system_clk into 1Hz clk 
      -- Output view:
      --					  --------------'1'
      -- '0'------------
      -- 0      25M      25M+25M 
      -- => T=50M => clk_out = clk_in/50M
      ----------------------------------------------------------------------------------
      library IEEE;
      use IEEE.STD_LOGIC_1164.ALL;
      use ieee.std_logic_unsigned.ALL; 
      
      entity clk_div is
        Port ( CLK_50M : in STD_LOGIC;
            clk_1hz : out STD_LOGIC);
      end clk_div;
      
      architecture arch of clk_div is
      
      signal cnt : std_logic_vector(31 downto 0) := X"00000000";
      signal div_temp : std_logic := '0';
      
      begin
      	process (CLK_50M) begin
      		if (CLK_50M'event and CLK_50M = '1') then
      			if cnt >= 25000000 then
      				div_temp <= not(div_temp);
      				cnt <= X"00000000";
      			else	
      				div_temp <= div_temp;
      				cnt <= cnt + '1';
      			end if;
      			clk_1hz <= div_temp;
      		end if;
      	end process;
      end arch;

      بر اساس integer که معمول تره
      کد:
      library IEEE;
      use IEEE.STD_LOGIC_1164.ALL;
      
      
      entity clk_div is
        Port ( CLK_50M : in STD_LOGIC;
            clk_1hz : out STD_LOGIC);
      end clk_div;
      
      architecture arch of clk_div is
      
      signal cnt : integer := 0; --integer type is 32b.
      signal div_temp : std_logic := '0';
      
      begin
      	process (CLK_50M) begin
      		if (CLK_50M'event and CLK_50M = '1') then
      			if cnt >= 25000000 then
      				div_temp <= not(div_temp);
      				cnt <= 0;
      			else	
      				div_temp <= div_temp;
      				cnt <= cnt + 1;
      			end if;
      			clk_1hz <= div_temp;
      		end if;
      	end process;
      end arch;

      دیدگاه

      لطفا صبر کنید...
      X