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

Reply

VHDL - most significant and less significant address

 
Thread Tools Search this Thread
Old 11-16-2008, 01:25 AM   #1
Default most significant and less significant address


i'm having a bit of problem in understand how does this work like
i'm doing a 64x4 bit static ram and it has an address of 6 bits, taking most significant 3 bits into a 3 to 8 decoder and the less significant to the 8x4 bit sram.

what i've done so far..

Code:
entity sixtyfour_by_four_sram is Port( add : in std_logic_vector (5 downto 0); read_nwrite : in std_logic; c_select : in std_logic; d_inout : inout std_logic_vector (3 downto 0)); end sixtyfour_by_four_sram; architecture Behavioral of sixtyfour_by_four_sram is component three_to_eight_decoder Port ( OE : in std_logic; address : in std_logic_vector (2 downto 0); o_outputs : out std_logic_vector (7 downto 0)); end component; component eight_by_four_sram Port ( address : in std_logic_vector(2 downto 0); read_notwrite : in std_logic; chip_select : in std_logic; data_inout : inout std_logic_vector(3 downto 0)); end component; -- SIGNALS signal ad : std_logic_vector (2 downto 0); signal o_put : std_logic_vector (7 downto 0); signal d_in : std_logic_vector (3 downto 0); begin -- create an instance inst : for i in 7 downto 0 generate gate1 : three_to_eight_decoder port map ( OE => c_select, address => ad, o_outputs => o_put); gate2 : eight_by_four_sram port map ( address => ad, read_notwrite => read_nwrite, chip_select => o_put(i), data_inout => d_in); end generate;

i don't think that will work
could anyone tell me how it works like (most significant and less significant) so that i can fix this?

thanks


a01lida
a01lida is offline   Reply With Quote
Old 11-16-2008, 08:53 AM   #2
jeppe
Senior Member
 
Join Date: Mar 2008
Location: Denmark
Posts: 245
Default
Hi

Your quite right - the 3 most significant bit should be used for decoding and the the rest should be used for internal addressing inside the rams

this code should work - hopefully:

Code:
entity sixtyfour_by_four_sram is Port( add : in std_logic_vector (5 downto 0); read_nwrite : in std_logic; c_select : in std_logic; d_inout : inout std_logic_vector (3 downto 0)); end sixtyfour_by_four_sram; architecture Behavioral of sixtyfour_by_four_sram is component three_to_eight_decoder Port ( OE : in std_logic; address : in std_logic_vector (2 downto 0); o_outputs : out std_logic_vector (7 downto 0)); end component; component eight_by_four_sram Port ( address : in std_logic_vector(2 downto 0); read_notwrite : in std_logic; chip_select : in std_logic; data_inout : inout std_logic_vector(3 downto 0)); end component; -- SIGNALS --signal ad : std_logic_vector (2 downto 0); signal o_put : std_logic_vector (7 downto 0); signal d_in : std_logic_vector (3 downto 0); begin gate1 : three_to_eight_decoder port map ( OE => c_select, address => add(5 downto 3), o_outputs => o_put); -------------- create 8 instances of RAM inst : for i in 7 downto 0 generate gate2 : eight_by_four_sram port map ( address => add(2 downto 0), read_notwrite => read_nwrite, chip_select=> o_put(i), data_inout => d_in); end generate; end Behavioral;

Regards Jeppe


jeppe
jeppe is offline   Reply With Quote
Old 11-16-2008, 12:28 PM   #3
a01lida
Junior Member
 
Join Date: Nov 2008
Posts: 2
Default
yes it works
now i understand it
i didn't think at all to try and change the vector number!

thank you


a01lida
a01lida is offline   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




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