![]() |
|
|
|||||||
![]() |
VHDL - How to handle varied length of output signal |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
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 |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |