Calculate Sum of (z[n])^2 in VHDL

OP
Lothar Miller wrote:
> Eric Thompson wrote:
>> I want to calculate the Sum of (z[n])^2 in VHDL.
>> If the signal z is represented in 2's complement with b bits.
> And what's the problem with that?
> What is z? What n? Where do they come from?

Z is just the outsignal and n is the groups of samples(forgot to write 
it so edited my first post)

And the problem is I need help to code this.
Guest
This is not a VHDL issue. What you first need is a concept of a circuit. 
You have to use a counter, start stop conditions, a resetable 
accumulator and somewhere a multiplier. If you do not see the circuit 
required, FPGA is not your business
Moderator (Company: Titel)
Eric Thompson wrote:
> Z is just the outsignal and n is the groups of samples
And where are they located? Where and how do the "samples" come from? 
Are they already stored in a RAM? Or is one sample generated each clock?

> And the problem is I need help to code this.
What hardware do you have? Or is it just for simulation?

> And the problem is I need help to code this.
The actual problem is, that VHDL is a hardware description language. 
And to describe somthing you must have a "picture" or some imagination 
of your target hardware. Do you?

Reply

A question of your own? This thread is over 12 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.