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

Reply

VHDL - How to handle varied length of output signal

 
Thread Tools Search this Thread
Old 10-21-2004, 07:50 AM   #1
Default How to handle varied length of output signal


I am doing compression algorithm using VHDL. I need to output different
length of codes according to different intermediate computation results.
In this way, I compress the original information.

For example, if intermediate computation result is less than certain
threshold, I will output 5 bits, but if it is greater than the
threshold, I only need to output 3 bits.

How could I handle the definition of the output signal?
I thougth about using 2 'Z's to concatenate with 3 bits. It didn't work,
turned my output to "ZX". Sad

Any suggestions or hints? TIA



systolic
  Reply With Quote
Old 10-21-2004, 04:37 PM   #2
rickman
 
Posts: n/a
Default Re: How to handle varied length of output signal
systolic wrote:
>
> I am doing compression algorithm using VHDL. I need to output different
> length of codes according to different intermediate computation results.
> In this way, I compress the original information.
>
> For example, if intermediate computation result is less than certain
> threshold, I will output 5 bits, but if it is greater than the
> threshold, I only need to output 3 bits.
>
> How could I handle the definition of the output signal?
> I thougth about using 2 'Z's to concatenate with 3 bits. It didn't work,
> turned my output to "ZX". Sad
>
> Any suggestions or hints? TIA


I am curios about how you will use this result with dynamically changing
size. You can compress the data, but a compression algorithm can't
change the number of wires in hardware. You still need enough wires to
carry the maximum width signal.

Think about what you are doing in terms of the hardware you will be
building. VHDL is not a programming language, it is a Hardware
Description Language V*HDL*.

Hint: just set the unused bits to zeros...

--

Rick "rickman" Collins


Ignore the reply address. To email me use the above address with the XY
removed.

Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design URL http://www.arius.com
4 King Ave 301-682-7772 Voice
Frederick, MD 21701-3110 301-682-7666 FAX


rickman
  Reply With Quote
Old 10-21-2004, 04:49 PM   #3
Prasanth Kumar
 
Posts: n/a
Default Re: How to handle varied length of output signal
On Thu, 2004-10-21 at 01:50 -0500, systolic wrote:
> I am doing compression algorithm using VHDL. I need to output different
> length of codes according to different intermediate computation results.
> In this way, I compress the original information.
>
> For example, if intermediate computation result is less than certain
> threshold, I will output 5 bits, but if it is greater than the
> threshold, I only need to output 3 bits.
>
> How could I handle the definition of the output signal?
> I thougth about using 2 'Z's to concatenate with 3 bits. It didn't work,
> turned my output to "ZX". Sad
>
> Any suggestions or hints? TIA
>


It kind of depends on how you want to output transmitted. If you are
transmitting the results one at a time and they are self delimitting,
set the other bits to zero or one. Otherwise transmit an additional
signal of 3 or 4 bits indicating how long the result is in bits.

If you want to pack the results into a fixed size packet (eg byte) then
use a shift register to accumulate the results. When then is more than
a byte worth, you shift a byte out. This is kind of like a fifo.




Prasanth Kumar
  Reply With Quote
Old 10-21-2004, 10:03 PM   #4
systolic
 
Posts: n/a
Default Re: How to handle varied length of output signal
Thx, guys,
So, I need to either use two buses with an extra flag bit. Or just add
padding '0' or '1'.
I will take the first choice since I need to have pure compressed code.



systolic
  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
ntsc on pal TV? Perfect Stranger DVD Video 26 09-15-2004 03:46 AM
Panasonic S25 DVD player w/o S-video output - will its replacement have S-video? Mark DVD Video 1 02-11-2004 04:19 PM
Convert S-video to RF signal Monkey Monkey DVD Video 10 01-14-2004 08:17 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