Problem using Unsigned in Modelsim

Discussion in 'VHDL' started by ElecB, May 17, 2009.

  1. ElecB

    ElecB

    Joined:
    May 17, 2009
    Messages:
    1
    Hey guys,

    I'm currently learning to code in VHDL and are having a problem implementing unsigned vectors. I'm using ISE 9.2i and ModelSim PE 6.5a. I wrote the code using Standard Logic Vector and it executes no problem, but when I try implement it using unsigned vectors I get an error (among others) that "Identifier "unsigned" is not directly visible."

    Unfortunately the task does not allow modification of the entity declaration, so I have to use the unsigned vector. Here's code as it stands:

    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    use IEEE.NUMERIC_STD.ALL;

    entity CountQ1 is
    port(clk,Ld8,Enable: in STD_LOGIC;
    Q: out UNSIGNED(3 downto 0));
    end CountQ1;

    architecture Behavioral of CountQ1 is
    signal Count: UNSIGNED(3 downto 0);
    begin
    process(clk)
    begin
    if (clk='1' and clk'event) then
    if (Ld8 = '1' or Count = "0011") then
    Count <= "1000";
    elsif Enable = '1' then
    end if;
    Count <= Count-"0001";
    end if;
    end if;
    end process;
    Q <= Count;
    end Behavioral;



    the library declaration given includes only STD_LOGIC_1164 and NUMERIC_BIT, but I didn't see how the latter was relevant since I dont use numeric_bit vectors and so removed it and replaced with NUMERIC_STD.

    Any hints or tips would be greatly appreciated
    Cheers
     
    ElecB, May 17, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Timo Freiberger
    Replies:
    3
    Views:
    987
    Bob Hairgrove
    Oct 30, 2004
  2. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    727
    Eric Sosman
    Jul 8, 2003
  3. ashtonn@gmail.com

    unsigned long to unsigned char

    ashtonn@gmail.com, Jun 1, 2005, in forum: Python
    Replies:
    1
    Views:
    466
    Diez B. Roggisch
    Jun 1, 2005
  4. sridhar

    comparing unsigned long and unsigned int

    sridhar, Nov 1, 2004, in forum: C Programming
    Replies:
    6
    Views:
    464
    J. J. Farrell
    Nov 3, 2004
  5. pozz
    Replies:
    12
    Views:
    777
    Tim Rentsch
    Mar 20, 2011
Loading...

Share This Page