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

Reply

VHDL - comparing the array in parallel

 
Thread Tools Search this Thread
Old 06-28-2005, 03:04 PM   #1
Default comparing the array in parallel


hello
in my design i need a logic to compare the array (suppose width 16 bit and
size of 0 to 15) with a vector of 16 bit in parallel and in one clk cycle.
and need to generate address of array is matching.

thank you
bye



srinukasam
  Reply With Quote
Old 06-28-2005, 03:28 PM   #2
Ralf Hildebrandt
 
Posts: n/a
Default Re: comparing the array in parallel
srinukasam wrote:

> in my design i need a logic to compare the array (suppose width 16 bit and
> size of 0 to 15) with a vector of 16 bit in parallel and in one clk cycle.


Just model 16 comparators - each for one array row.

match_0 <= '1' when (my_array(0) = my_vector) else '0';
....


> and need to generate address of array is matching.


Does the vector match only one array element or may there be more?

process(match_0, macht_1 ....)
begin
if (match_0 = '1') then
address<="0000"
elsif (match_1 = '1') then
address<="0001"
elsif ...
end if;
end process;


Note: You may eliminate the intermediate match_X signals if you combine
all statements, but this does not lead to a smaller hardware.

Ralf


Ralf Hildebrandt
  Reply With Quote
Old 06-29-2005, 12:46 PM   #3
Me
 
Posts: n/a
Default Re: comparing the array in parallel
Homework buster.
Give directions not solutions.

A.

On Tue, 28 Jun 2005 16:28:22 +0200, Ralf Hildebrandt wrote:

> srinukasam wrote:
>
>> in my design i need a logic to compare the array (suppose width 16 bit and
>> size of 0 to 15) with a vector of 16 bit in parallel and in one clk cycle.

>
> Just model 16 comparators - each for one array row.
>
> match_0 <= '1' when (my_array(0) = my_vector) else '0';
> ...
>
>
>> and need to generate address of array is matching.

>
> Does the vector match only one array element or may there be more?
>
> process(match_0, macht_1 ....)
> begin
> if (match_0 = '1') then
> address<="0000"
> elsif (match_1 = '1') then
> address<="0001"
> elsif ...
> end if;
> end process;
>
>
> Note: You may eliminate the intermediate match_X signals if you combine
> all statements, but this does not lead to a smaller hardware.
>
> Ralf




Me
  Reply With Quote
Old 07-30-2005, 01:27 PM   #4
viku
 
Posts: n/a
Default Re: comparing the array in parallel
try this but in one clock cycle u r able to compare only one address of
array with the vector;
try this codee
if rst='1'then
addr<=(others=> '0');
elsif rising_edge(clk)then
array(addr)<= vector
addr<= addr+1;
if array(addr)= vector then
found <='1';
foundaddr<=addr
else
found <='0';
foundaddr<="zzzz....z";
end if;



viku
  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
constants as of array of integers, for loops octavsly Hardware 0 04-25-2009 11:53 AM
How to retrieve array parameter ( JAVA ) naruponk Software 1 04-16-2009 10:20 AM
Array Programme rits Software 2 03-04-2009 05:18 PM
Comparing Data IcePirate General Help Related Topics 0 09-05-2008 04:31 PM
Altera Soft Core parallel tasking? Possible bbiandov Hardware 0 12-02-2006 06:00 AM




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