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

Reply

VHDL - dynamic size of ports

 
Thread Tools Search this Thread
Old 04-26-2005, 11:57 AM   #1
Default dynamic size of ports


Hi all!

I have a problem that someone here might have the answer to. I have a
divider that takes inputs of 13 and 12 bits, and produces an output of
12 bits. I have a component to strip away the redundant bits from the
divider, if the result of the division is, say an int value of 6, I
don't want to use all 12 bits. This circuit is a part of an MPEG-4
device, a quantizer, so I want to compress as much as possible. My
question is then, how do I declare the ports on the component that
strips away the bits to output an std_logic_vector that is not fixed
in size, but dynamic? This must be synthesizable. Guess there are many
ways of doing this, and I hope someone has got an answer to me.

Thanks,

Dan Nilsen


Dan Nilsen
  Reply With Quote
Old 04-26-2005, 06:51 PM   #2
Mike Treseler
 
Posts: n/a
Default Re: dynamic size of ports
Dan Nilsen wrote:

> 12 bits. I have a component to strip away the redundant bits from the
> divider, if the result of the division is, say an int value of 6, I
> don't want to use all 12 bits.


If you don't use all 12 bits,
how can you tell where one result
ends and the next begins?

-- Mike Treseler


Mike Treseler
  Reply With Quote
Old 04-26-2005, 07:00 PM   #3
KCL
 
Posts: n/a
Default Re: dynamic size of ports
just another guy that come from software...


"Dan Nilsen" <> a écrit dans le message de news:
...
> Hi all!
>
> I have a problem that someone here might have the answer to. I have a
> divider that takes inputs of 13 and 12 bits, and produces an output of
> 12 bits. I have a component to strip away the redundant bits from the
> divider, if the result of the division is, say an int value of 6, I
> don't want to use all 12 bits. This circuit is a part of an MPEG-4
> device, a quantizer, so I want to compress as much as possible. My
> question is then, how do I declare the ports on the component that
> strips away the bits to output an std_logic_vector that is not fixed
> in size, but dynamic? This must be synthesizable. Guess there are many
> ways of doing this, and I hope someone has got an answer to me.
>
> Thanks,
>
> Dan Nilsen





KCL
  Reply With Quote
Old 04-26-2005, 11:02 PM   #4
Eric
 
Posts: n/a
Default Re: dynamic size of ports
If the biggest answer available is 12-bits that's the resource you
need to reserve in the FPGA.

I don't think you can dynamically change the output port size without
reconfiguring the FPGA. It wouldn't make sense if you could, you need
to hardwire the max ouptut size.

You could make the output port variable by using a reconfigurable
computing algorithm and an external processor, but your process time is
going to increase considerably.

Are you size constrained? Is that why you are trying to optimize the
VHDL code?

Eric



Eric
  Reply With Quote
Old 04-27-2005, 11:23 AM   #5
Dan Nilsen
 
Posts: n/a
Default Re: dynamic size of ports
Hello,

Thanks for the responses.

The reason I need to do it is because I get a (signed) quotient from a
divider in a range I already know. I divide a 8x8 DCT by 1 out of 2
preset Quantization matrices, which in turn are scaled by an integer
ranging from 1-32. Sometimes I will get a 0 from the divider, during
this case I don't want to transmit "too many" bits. I do however
realise that this might be impossible, but I appreciate answers given
me here.

Thanks,

Dan


Dan Nilsen
  Reply With Quote
Old 04-27-2005, 02:05 PM   #6
Kolja Sulimma
 
Posts: n/a
Default Re: dynamic size of ports
Your port is a bunch of wires that represent your results. If you want
to transmit the result in one clock cycle and you have 4096 different
results from your 12-bit divider there is no way you can get along with
less than 12 bits, you need them to distinguish the different results.
In that case a 0 bit is not unused: It is used to tell the receiver that
it is not 1.

If you know in advance that ALL your results are allways less than 2**N
you can get along with less bits.
To be exact: If you know that you will have less than 2**N different
results you can get along with N bits, no matter how large the results are.

Kolja Sulimma

Dan Nilsen wrote:
> Hello,
>
> Thanks for the responses.
>
> The reason I need to do it is because I get a (signed) quotient from a
> divider in a range I already know. I divide a 8x8 DCT by 1 out of 2
> preset Quantization matrices, which in turn are scaled by an integer
> ranging from 1-32. Sometimes I will get a 0 from the divider, during
> this case I don't want to transmit "too many" bits. I do however
> realise that this might be impossible, but I appreciate answers given
> me here.
>
> Thanks,
>
> Dan



Kolja Sulimma
  Reply With Quote
Old 04-28-2005, 11:52 PM   #7
Irwin Kennedy
 
Posts: n/a
Default Re: dynamic size of ports
(Dan Nilsen) wrote in message news:<. com>...
> Hi all!
>
> I have a problem that someone here might have the answer to. I have a
> divider that takes inputs of 13 and 12 bits, and produces an output of
> 12 bits. I have a component to strip away the redundant bits from the
> divider, if the result of the division is, say an int value of 6, I
> don't want to use all 12 bits. This circuit is a part of an MPEG-4
> device, a quantizer, so I want to compress as much as possible.


I think you will find the step following quantization actually
performs the compression. Quantization just prepares the values so
they compress well (loads of zeroes). Something like the huffman and
run length encoding algorithms will take the quantized values and
express them concisely (compress them).


Irwin Kennedy
  Reply With Quote
Old 04-29-2005, 03:02 AM   #8
Dan Nilsen
 
Posts: n/a
Default Re: dynamic size of ports
I'm not implementing RLE or Huffman in this project, but I'm aware
that this is where much of the compression do take place. I will as I
said, get lots of 0's and this can be compressed further. It might be
the next step, but it is out of scope for my undergrad. engineering
project.

Thanks to all for their contributions anyway!

Dan


Dan Nilsen
  Reply With Quote
Old 04-29-2005, 05:30 AM   #9
Dal
 
Posts: n/a
Default Re: dynamic size of ports
Could you declare another "mask" slv that validates the divider result
slv?


Dan Nilsen wrote:
> Hi all!
>
> I have a problem that someone here might have the answer to. I have a
> divider that takes inputs of 13 and 12 bits, and produces an output

of
> 12 bits. I have a component to strip away the redundant bits from the
> divider, if the result of the division is, say an int value of 6, I
> don't want to use all 12 bits. This circuit is a part of an MPEG-4
> device, a quantizer, so I want to compress as much as possible. My
> question is then, how do I declare the ports on the component that
> strips away the bits to output an std_logic_vector that is not fixed
> in size, but dynamic? This must be synthesizable. Guess there are

many
> ways of doing this, and I hope someone has got an answer to me.
>
> Thanks,
>
> Dan Nilsen




Dal
  Reply With Quote
Old 05-02-2005, 12:59 PM   #10
backhus
 
Posts: n/a
Default Re: dynamic size of ports
Hi Dan,
first thing to do: Think of the hardware you want to create.

A device with 12 output lines always ever has these wires.
There is no magical monkey inside the chip, riping off unused wires and reconnecting them as needed.
It's HARD-ware!

But then...
If you want to transmit the data, you can do it in some serialized manner.
With the help uf some useful algorithm
or even a simple dataformat (e.g. Datalength(4bits), Data (0 to 12 bits variable)).
(well, an dataformatter also has some kind of algorithm inside..)

In the end you see that compression only works by serialisation.
Otherwise you always have to keep your wires with you all the way.

Have a nice synthesis
eilert


Dan Nilsen schrieb:
> Hi all!
>
> I have a problem that someone here might have the answer to. I have a
> divider that takes inputs of 13 and 12 bits, and produces an output of
> 12 bits. I have a component to strip away the redundant bits from the
> divider, if the result of the division is, say an int value of 6, I
> don't want to use all 12 bits. This circuit is a part of an MPEG-4
> device, a quantizer, so I want to compress as much as possible. My
> question is then, how do I declare the ports on the component that
> strips away the bits to output an std_logic_vector that is not fixed
> in size, but dynamic? This must be synthesizable. Guess there are many
> ways of doing this, and I hope someone has got an answer to me.
>
> Thanks,
>
> Dan Nilsen




backhus
  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
Re: partitions and total hard drive size shown Bodhione A+ Certification 0 06-14-2007 08:57 PM
Dynamic VPN tunneling Rcushman General Help Related Topics 0 09-28-2006 04:06 PM
Re: USB issue ... some USB 2 ports working only in USB 1 mode hungsolo2005@yahoo.com A+ Certification 0 06-14-2006 08:26 PM
'Dynamic Full' vs '2/8' means what? Dogger the Filmgoblin DVD Video 2 06-30-2004 09:03 AM
Question: Windows Explorer File Sizes JS A+ Certification 4 10-27-2003 01:46 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