Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > most significant and less significant address

Reply
Thread Tools

most significant and less significant address

 
 
a01lida a01lida is offline
Junior Member
Join Date: Nov 2008
Posts: 2
 
      11-16-2008
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
 
Reply With Quote
 
 
 
 
jeppe jeppe is offline
Senior Member
Join Date: Mar 2008
Location: Denmark
Posts: 348
 
      11-16-2008
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
 
Reply With Quote
 
 
 
 
a01lida a01lida is offline
Junior Member
Join Date: Nov 2008
Posts: 2
 
      11-16-2008
yes it works
now i understand it
i didn't think at all to try and change the vector number!

thank you
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone want to bet that C++ won't be 10 times less significant in 5 years than it is today? Jo C++ 6 11-21-2011 05:53 PM
How to get most significant bits qharz VHDL 2 06-23-2009 08:23 PM
Meaning of "most significant digits" in the printf documentation Mukesh_Singh_Nick@yahoo.com C Programming 2 06-17-2007 01:24 AM
Significant Digits (Significant Figures) SMH Javascript 0 01-07-2007 09:52 AM
set and reset the least significant bit of a address onsbomma C Programming 63 03-21-2005 04:28 PM



Advertisments