FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > VHDL

VHDL comp.lang.vhdl newsgroup / Usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-16-2004, 07:23 PM
andy
Guest
 
Posts: n/a
Default UNSIGNED and sign exteension

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
  #2 (permalink)  
Old 11-16-2004, 07:38 PM
Fidodido
Guest
 
Posts: n/a
Default Re: UNSIGNED and sign exteension

Try

libray ieee;
use ieee.std_logic_arith.all;

....

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

"andy" <[email protected]> ha scritto nel messaggio
news:[email protected] 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
  #3 (permalink)  
Old 11-16-2004, 07:47 PM
mike_treseler
Guest
 
Posts: n/a
Default Re: UNSIGNED and sign exteension

http://groups.google.com/groups?q=vh...ed+numeric_std

-- Mike Treseler

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sign extension issue in Xilinx Multiplier CoreGen version10 Vivek Menon FPGA 1 12-16-2008 08:24 PM
Systemverilog array: .sum(), but not sign-extension? atass Verilog 3 11-20-2008 10:06 AM
What option can change the path sign "\" in Quartus ? fl FPGA 3 12-02-2007 10:19 AM
16 to 32 bit Sign Extention Mahurshi Akilla Verilog 3 04-24-2007 06:56 PM
. What is the sign-and-magnitude of the following 4's complement number? (Leave answer in base 4). [email protected] FPGA 4 12-14-2006 08:42 AM


All times are GMT +1. The time now is 01:42 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved