I need a function to truncate a SIGNED vector efficiently

Joined
Jun 30, 2008
Messages
10
Reaction score
0
Hi Folks

I am trying to find a function that can truncate a VHDL SIGNED vector efficiently. In other words, trim the extra sign-bit duplicates (if existing) then truncate the SINGED vector to a given new length.

For example :

If the input vector that needs to be efficiently truncated is:

"11111011"

After trimming it should look like this:
"1011"

And if we want to truncate it to only 2 bits, the final result should look like this:
"10"

This allows for better truncation precision.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top