Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to handle the varied length of output signal

Status
Not open for further replies.

systolic

Newbie level 4
Joined
Oct 5, 2004
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
55
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". :(

Any suggestions or hints? TIA
 

use another output port to specify the bitwidth of the signal on the output.. and modify ur next block accordingly

out [4:0] output_sig;
out [2:0] out_length; // if u have only 5 or 3 bit lengths at output .. u can just use only one bit
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top