Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Ambiguous reference to type

 
Thread Tools Search this Thread
Old 09-12-2005, 10:22 AM   #1
Default Ambiguous reference to type


Hello all,

I was trying to complie the following code. I need one bit at each
rising edge frm the constant std_logic_vector and afterward i am
rotating it left in cyclic way.

But,I got an error " Ambiguous reference to type "UNSIGNED" ". I didnt
understand what it is meant , secondly can anyone suggest me how to
assign std_logic_vector to unsiged and vice versa.any type conv ?

regards,
Ali
-----------------------------------------------------------
LIBRARY IEEE;
USE IEEE.STD_lOGIC_1164.ALL;
USE IEEE.NUMERIC_BIT.ALL;
USE IEEE.NUMERIC_STD.ALL;

ENTITY SHIFT_REG IS
PORT
(
CLK : IN STD_LOGIC;
RESET : IN STD_LOGIC;
OUTPUT : OUT STD_LOGIC
);
END SHIFT_REG;

ARCHITECTURE ARCH_REG OF SHIFT_REG IS

CONSTANT DATA_IN : UNSIGNED(7 DOWNTO 0) := "01010101";

BEGIN

INP: PROCESS(CLK,RESET)

VARIABLE DATAV_IN1 : UNSIGNED(7 DOWNTO 0);
VARIABLE DATAV_IN2 : UNSIGNED(7 DOWNTO 0);


BEGIN
IF (RESET = '0') THEN
OUTPUT <= '0';
DATAV_IN1 := DATA_IN;
ELSIF (CLK'EVENT AND CLK = '1') THEN
OUTPUT <= DATAV_IN1(7);
DATAV_IN2 := ROTATE_LEFT (DATAV_IN1,1);
DATAV_IN1 := DATAV_IN2;

END IF;
END PROCESS INP;

END ARCHITECTURE ARCH_REG;
-----------------------------------------------------------



jahaya@gmail.com
  Reply With Quote
Old 09-12-2005, 10:39 AM   #2
Hubble
 
Posts: n/a
Default Re: Ambiguous reference to type
You should only use one of numeric_std and numeric_bit. Both packages
define the type "unsigned" differently.
numeric_bit:
type unsigned is array (natural range <>) of bit;
numeric_std:
type unsigned is array (natural range <>) of std_logic;

You instructed the compiler to use (!) all (!) symbols in both
packages.

Delete "use ieee.numeric_bit.all" (obviously unused) and everything
should be ok. You can also specify "ieee.numeric_std.unsigned" in each
place where you use unsigned.

Most design units only need either numeric_bit or numeric_std. If you
really need symbols of both packages, you must qualify them and not use
a "use package.all" statement.

Hubble.



Hubble
  Reply With Quote
Old 09-12-2005, 10:55 AM   #3
jahaya@gmail.com
 
Posts: n/a
Default Re: Ambiguous reference to type
Hi hubble,

it works now !

thank u

regards,
ahmed

Hubble wrote:
> You should only use one of numeric_std and numeric_bit. Both packages
> define the type "unsigned" differently.
> numeric_bit:
> type unsigned is array (natural range <>) of bit;
> numeric_std:
> type unsigned is array (natural range <>) of std_logic;
>
> You instructed the compiler to use (!) all (!) symbols in both
> packages.
>
> Delete "use ieee.numeric_bit.all" (obviously unused) and everything
> should be ok. You can also specify "ieee.numeric_std.unsigned" in each
> place where you use unsigned.
>
> Most design units only need either numeric_bit or numeric_std. If you
> really need symbols of both packages, you must qualify them and not use
> a "use package.all" statement.
>
> Hubble.




jahaya@gmail.com
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: expected constructor, destructor or type conversion before '(' token suse Software 0 03-09-2009 03:25 AM
Eclipse - Axis2 - Java Webservices Error amanjsingh Software 1 10-09-2007 09:03 AM
Need help on Modelsim VHDL syntax? ASAP:) kaji General Help Related Topics 0 03-14-2007 10:43 PM
Need help on a Modelsim VHDL Syntax? ASAP:) kaji Software 0 03-14-2007 10:43 PM
Need Help on a Modelsim VHDL Syntax....ASAP:) kaji Hardware 0 03-14-2007 10:41 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46