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

Reply

VHDL - big decoder

 
Thread Tools Search this Thread
Old 01-11-2005, 05:50 AM   #1
Default big decoder


hi,
I have a total of 13 lines and it must be decoded into 2^13=8192 unique
lines. Is there any way to reduce the burden of having to type the entire
number?




bxbxb3
  Reply With Quote
Old 01-11-2005, 07:31 AM   #2
Thomas Reinemann
 
Posts: n/a
Default Re: big decoder
bxbxb3 wrote:

> hi,
> I have a total of 13 lines and it must be decoded into 2^13=8192 unique
> lines. Is there any way to reduce the burden of having to type the entire
> number?


How meaningful is it, to have 8192 lines, are you creating a memory?

Bye Tom


Thomas Reinemann
  Reply With Quote
Old 01-11-2005, 08:40 AM   #3
Nicolas Matringe
 
Posts: n/a
Default Re: big decoder
bxbxb3 a écrit :
> hi,
> I have a total of 13 lines and it must be decoded into 2^13=8192 unique
> lines. Is there any way to reduce the burden of having to type the entire
> number?


Quite easy:

library ieee.
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
....
constant n : natural := 13;
signal addr : std_logic_vector(n-1 downto 0);
signal lines : std_logic_vector(2**n-1 downto 0);
....
process (addr)
begin
lines <= (others => '0');
lines(to_integer(unsigned(addr))) <= '1';
end process;
....

--
____ _ __ ___
| _ \_)/ _|/ _ \ Adresse de retour invalide: retirez le -
| | | | | (_| |_| | Invalid return address: remove the -
|_| |_|_|\__|\___/


Nicolas Matringe
  Reply With Quote
Old 01-11-2005, 09:13 AM   #4
bxbxb3
 
Posts: n/a
Default Re: big decoder
Yes, I am creating a DDR-SDRAM memory module of 8192*256*32 size. Even
though I prefered complete RTL code, I think will have to code this one in
behavioral style, thanks to Nicholas Matringe for giving the much needed
idea.



bxbxb3
  Reply With Quote
Old 01-11-2005, 10:14 AM   #5
Paul Uiterlinden
 
Posts: n/a
Default Re: big decoder
bxbxb3 wrote:
> hi,
> I have a total of 13 lines and it must be decoded into 2^13=8192 unique
> lines. Is there any way to reduce the burden of having to type the entire
> number?


Something along this way (not tested):

SIGNAL input: std_logic_vector(12 DOWNTO 0);
SIGNAL output: std_logic_vector(2**13-1 DOWNTO 0);

VARIABLE out_var: std_logic_vector(2**13-1 DOWNTO 0);
BEGIN
out_var := (OTHERS => '0');
out_var(to_integer(unsigned(input))) := '1';
ouput <= out_var;
END



Paul Uiterlinden
  Reply With Quote
Old 01-11-2005, 10:16 AM   #6
Nicolas Matringe
 
Posts: n/a
Default Re: big decoder
Paul Uiterlinden a écrit :

> Something along this way (not tested):
>
> SIGNAL input: std_logic_vector(12 DOWNTO 0);
> SIGNAL output: std_logic_vector(2**13-1 DOWNTO 0);
>
> VARIABLE out_var: std_logic_vector(2**13-1 DOWNTO 0);
> BEGIN
> out_var := (OTHERS => '0');
> out_var(to_integer(unsigned(input))) := '1';
> ouput <= out_var;
> END


Why do you use a variable? (just curious)

--
____ _ __ ___
| _ \_)/ _|/ _ \ Adresse de retour invalide: retirez le -
| | | | | (_| |_| | Invalid return address: remove the -
|_| |_|_|\__|\___/


Nicolas Matringe
  Reply With Quote
Old 01-11-2005, 10:43 AM   #7
Paul Uiterlinden
 
Posts: n/a
Default Re: big decoder
Nicolas Matringe wrote:
> Paul Uiterlinden a écrit :
>
>> Something along this way (not tested):
>>
>> SIGNAL input: std_logic_vector(12 DOWNTO 0);
>> SIGNAL output: std_logic_vector(2**13-1 DOWNTO 0);
>>
>> VARIABLE out_var: std_logic_vector(2**13-1 DOWNTO 0);
>> BEGIN
>> out_var := (OTHERS => '0');
>> out_var(to_integer(unsigned(input))) := '1';
>> ouput <= out_var;
>> END

>
>
> Why do you use a variable? (just curious)


I guess it is not necessary. It was done in a paranoid mood, being
affraid that "output(some_variable) <= '1'" would create a driver for
all bits, resulting in all X-s. But that's not the case here (sequential
signal assignments).

Paul.


Paul Uiterlinden
  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
Standalone 5.1 decoder Steve Kraus DVD Video 7 03-05-2007 07:15 AM
save cost advice: decoder chip for large printer lois8386 General Help Related Topics 0 11-03-2006 06:19 AM
ISO DVD standalone player with DTS decoder Bodo Malo DVD Video 0 02-12-2006 08:56 PM
DVD DECODER Barry day DVD Video 0 06-07-2004 03:32 AM
MPEG-2 decoder for nero Donny DVD Video 10 01-08-2004 07:54 PM




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