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 04-03-2004, 06:57 AM
pandora
Guest
 
Posts: n/a
Default vector concatenation

hello:
I am a beginner of vhdl, I have some knowledge about verilog. please
help me with this problem:
In VHDL serveral vector can concatenate like " a & b & c " also (a ,b
,). i know this can be used as the right operand when assigning. but can
the concatenated vector be the left operand? i writed like this
(a,b,c)<= d ; or
a & & c <= d;
but all can not pass the compilation.

can tell me how the cooncatenated vector be the left operand? thanks
you!!




Reply With Quote
  #2 (permalink)  
Old 04-03-2004, 10:27 AM
Niv
Guest
 
Posts: n/a
Default Re: vector concatenation

"pandora" <[email protected]> wrote in message
news:[email protected] lkaboutprogramming.com...
> hello:
> I am a beginner of vhdl, I have some knowledge about verilog. please
> help me with this problem:
> In VHDL serveral vector can concatenate like " a & b & c " also (a ,b
> ,). i know this can be used as the right operand when assigning. but can
> the concatenated vector be the left operand? i writed like this
> (a,b,c)<= d ; or
> a & & c <= d;
> but all can not pass the compilation.
>
> can tell me how the cooncatenated vector be the left operand? thanks
> you!!
>

I've not checked, but I don't think you can do this; you have to slice the
rhs thus:

a <= d(msb downto X);
b <= d(X-1 downto Y);
c <= d(Y-1 downto 0);

Or something similar.

Niv.


Reply With Quote
  #3 (permalink)  
Old 04-03-2004, 11:23 AM
Egbert Molenkamp
Guest
 
Posts: n/a
Default Re: vector concatenation

"pandora" <[email protected]> wrote in message
news:[email protected] lkaboutprogramming.com...
> hello:
> I am a beginner of vhdl, I have some knowledge about verilog. please
> help me with this problem:
> In VHDL serveral vector can concatenate like " a & b & c " also (a ,b
> ,). i know this can be used as the right operand when assigning. but can
> the concatenated vector be the left operand? i writed like this
> (a,b,c)<= d ; or
> a & & c <= d;
> but all can not pass the compilation.
>
> can tell me how the cooncatenated vector be the left operand? thanks
> you!!


Here an example. It would be nice if the line marked with --***
could be (co,s)<=...
But that is not allowed (yet).

Egbert Molenkamp

LIBRARY ieee;
USE ieee.numeric_bit.ALL;
ENTITY adder IS
PORT (a,b : IN unsigned(1 DOWNTO 0);
ci : IN bit;
s : OUT unsigned(1 DOWNTO 0);
co : OUT bit);
END adder;
ARCHITECTURE demo OF adder IS
BEGIN
(co,s(1),s(0)) <= ('0'&a) + b + ('0'&ci) ; --***
END demo;


Reply With Quote
  #4 (permalink)  
Old 04-03-2004, 02:15 PM
pandora
Guest
 
Posts: n/a
Default Re: vector concatenation

but sometimes the left part is an expression, you can not write like this!
so it is really troublesome to write every bit in the left when it is a
very long vector.

Reply With Quote
  #5 (permalink)  
Old 04-05-2004, 12:33 AM
Mike Treseler
Guest
 
Posts: n/a
Default Re: vector concatenation

pandora wrote:

> (a,b,c)<= d ; or
> a & & c <= d;
> but all can not pass the compilation.


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

-- Mike Treseler

Reply With Quote
  #6 (permalink)  
Old 04-05-2004, 08:57 AM
Thomas Stanka
Guest
 
Posts: n/a
Default Re: vector concatenation

"pandora" <[email protected]> wrote
> but sometimes the left part is an expression, you can not write like this!
> so it is really troublesome to write every bit in the left when it is a
> very long vector.


Then use a variable

my_var:=my_function(x,y,z);
a<=my_var(t downto s);
b<=my_var(s-1 downto r);
c<=my_var(r-1 downto 0);

bye Thomas
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
VHDL : Use concatenation on port mapping Georgios Sidiropoulos FPGA 6 10-17-2005 04:10 PM
Repeat concatenation and Modelsim DW Verilog 9 06-01-2004 10:42 PM
Zero width concatenation. Ron Smith Verilog 2 10-24-2003 02:35 PM
what's the difference between VHDL 93 CONCATENATION and VHDL 87 CONCATENATION? walala VHDL 3 09-18-2003 06:17 AM
type conversion and concatenation Ralf Hildebrandt VHDL 3 07-28-2003 08:41 AM


All times are GMT +1. The time now is 03:07 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