cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
aapatel374
Visitor
Visitor
7,301 Views
Registered: ‎04-08-2009

vhdl code

hi, i want a vhdl code for following logic. 
i have 20 signed numbers,like. 
-2 -2 0 0 0 0 -2 -2 0 0 0 0 2 2 0 0 0 0 2 2 
1) i want to put them in group of 4 numbers like, 
-2-200 00-2-2 0000 2200 0022 
2)i want sum of that all each group internally like 
-2+-2+0+0 = -4 
0+0+-2+-2= -4 
0+0+0+0=0 
2+2+0+0=4 
0+0+2+2=4 
3) i want put this answers in seperate memory 
like, 
-4 -4 0 4 4 
last i want this signed vector in memory. 

can anyone help me? 

thank u.

regards,
AAP
Tags (1)
0 Kudos
7 Replies
drjohnsmith
Teacher
Teacher
7,264 Views
Registered: ‎07-09-2009

So

 

what algorithum / structure are you thinking off ?

 

Where are you starting from ?

 

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
eilert
Teacher
Teacher
7,248 Views
Registered: ‎08-14-2007

Hi AAP,

what Interface do you use to get the numbers?

Do they come in parallel or sequential or do you have to read them from a RAM?

 

What signal type are you going to use?

 

Since you are going to write the results to a memory you need a FSM anyway.

Is there a difference between your mentioned "seperate memory" and the "last wanted memory"?

 

have a nice synthesis

  eilert 

0 Kudos
aapatel374
Visitor
Visitor
7,232 Views
Registered: ‎04-08-2009

 

hi ,

 

thanku for response. 

i have to read results from memory.seperate memory means another memory. 

 

 

 

 

 

0 Kudos
aapatel374
Visitor
Visitor
7,227 Views
Registered: ‎04-08-2009

 

 hi thank u for response. 

 i have to implement multiuser cdma on spartan ii kit. this is a last part.      

 

 

 

 

 

 

 

 

0 Kudos
eilert
Teacher
Teacher
7,151 Views
Registered: ‎08-14-2007

Hi,

when you have two memories (one for input and one for output) then it is quite simple:

 

You need two counters for the input and output adresses, an adder connected to an accumulating register, and a small FSMs that triggers the reads and writes and resets the accumulating register for each calculation.

 You can speed up things a little by using more than one adder/accumulator but still you have to read all the data sequentially and so the gain may be quite small.

 

Have a nice synthesis

  Eilert

0 Kudos
aapatel374
Visitor
Visitor
7,124 Views
Registered: ‎04-08-2009

HI THANK U FOR YOUR RESPONSE BUT 

I DIDN`T GET ANYTHING SORRY...

0 Kudos
eilert
Teacher
Teacher
7,103 Views
Registered: ‎08-14-2007

Hi,

In that case you should join a class for digital electronics first.

(or read a good book like >Bebop to the Boolean Boogie<)

 

FSMs, accumulating registers, adders and counters etc. are basic building blocks for digital designs,

and without that knowledge you are simply lost.

 

Have a nice synthesis

  Eilert 

0 Kudos