Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > UNSIGNED and sign exteension

Reply
Thread Tools

UNSIGNED and sign exteension

 
 
andy
Guest
Posts: n/a
 
      11-16-2004
Hi there

I have defined

signal xx std_logic_vector(2 downto 0);
signal zz unsigned(4 downto 0);

and I want to assign

zz <= unsigned(xx);

without getting an array type mismatch and without doing

zz <= unsigned ("00" & xx);

which works fine but is not very portable and flexible.

Is there a way to 'extend' xx with a ieee library function?

maybe it is trivial, but I cannot get rid of that I am so tired, it is
so late now in Italy now ...

Thanks to who'll reply
 
Reply With Quote
 
 
 
 
Fidodido
Guest
Posts: n/a
 
      11-16-2004
Try

libray ieee;
use ieee.std_logic_arith.all;

....

zz <= conv_unsigned(xx,zz'length);

"andy" <> ha scritto nel messaggio
news: om...
> Hi there
>
> I have defined
>
> signal xx std_logic_vector(2 downto 0);
> signal zz unsigned(4 downto 0);
>
> and I want to assign
>
> zz <= unsigned(xx);
>
> without getting an array type mismatch and without doing
>
> zz <= unsigned ("00" & xx);
>
> which works fine but is not very portable and flexible.
>
> Is there a way to 'extend' xx with a ieee library function?
>
> maybe it is trivial, but I cannot get rid of that I am so tired, it is
> so late now in Italy now ...
>
> Thanks to who'll reply



 
Reply With Quote
 
 
 
 
mike_treseler
Guest
Posts: n/a
 
      11-16-2004
http://groups.google.com/groups?q=vh...ed+numeric_std

-- Mike Treseler

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
(int) -> (unsigned) -> (int) or (unsigned) -> (int) -> (unsigned):I'll loose something? pozz C Programming 12 03-20-2011 11:32 PM
signed and unsigned Sign bit doubt hari C Programming 4 12-23-2008 12:18 AM
Automatic sign-up and sign-in across different domains without cookies? Jimmy ASP .Net 1 11-21-2006 04:41 PM
Automatic sign-up and sign-in between different domains without cookies? Jimmy Javascript 3 11-20-2006 01:28 PM
comparing unsigned long and unsigned int sridhar C Programming 6 11-03-2004 03:52 AM



Advertisments
 



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 47 48 49 50 51 52 53 54 55 56 57