Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/20/05 19:15
Read: times


 
#85437 - Cos i am just too good to you :)
Responding to: ???'s previous message
And I am bored of this now here is some VHDL I knocked together which implements the basic idea just using 8 registers but you can edit it to work with more,and it just saves a load of arsing about with propagation delays.Only trouble is all my formatting has dropped off,boo hoo!




library ieee;
use ieee.std_logic_1164.all;
use Ieee.numeric_std.all;
entity decoder is

port( clk :in std_Logic;
nRst :in std_logic;
addr_data:in unsigned(7 downto 0);
addr_high:in unsigned(7 downto 0);
ale :in std_logic;
nPsen :in std_logic;
nRd :in std_logic;
nWr :in std_logic;
flash_cs :out std_logic;
latch_o_0 :out unsigned(7 downto 0);
latch_o_1 :out unsigned(7 downto 0);
latch_o_2 :out unsigned(7 downto 0);
latch_o_3 :out unsigned(7 downto 0);
latch_o_4 :out unsigned(7 downto 0);
latch_o_5 :out unsigned(7 downto 0);
latch_o_6 :out unsigned(7 downto 0);
latch_o_7 :out unsigned(7 downto 0));
attribute enum_encoding : string;
end decoder;

architecture rtl of decoder is
constant upper_addr : unsigned :="11111111"; --- upper byte of address
constant bit_mask : unsigned :="00011111";
type UC_STATE_TYPE is (IDLE, ADDR_DECODE,ADDR_MATCH, DATA_TRS, END_CYCLE);
attribute enum_encoding of UC_STATE_TYPE: type is "00001 00010 00100 01000 10000";
signal prs_state, next_state : UC_STATE_TYPE;
signal latch_addr,latch_data :unsigned(7 downto 0);

begin

dec: process(nRst,clk,latch_addr,latch_data)
begin
if nrst='0' then
latch_o_0<=(others=>'0');
latch_o_1<=(others=>'0');
latch_o_2<=(others=>'0');
latch_o_3<=(others=>'0');
latch_o_4<=(others=>'0');
latch_o_5<=(others=>'0');
latch_o_6<=(others=>'0');
latch_o_7<=(others=>'0');
elsif rising_edge(clk) then
case latch_addr is
when "00000000" => latch_o_0 <= latch_data;
when "00000001" => latch_o_1 <= latch_data;
when "00000010" => latch_o_2 <= latch_data;
when "00000011" => latch_o_3 <= latch_data;
when "00000100" => latch_o_4 <= latch_data;
when "00000101" => latch_o_5 <= latch_data;
when "00000110" => latch_o_6 <= latch_data;
when "00000111" => latch_o_7 <= latch_data;
when others => null;
end case;
end if;
end process;

UC_SM_REGS: process ( nRst,clk)
begin
if nRst = '0' then
prs_state <= IDLE;

elsif rising_edge(clk) then
prs_state <= next_state;
if ((prs_state=addr_match) or (prs_state=data_trs)) then
flash_cs<='1';
else
flash_cs<='0';
end if;
end if;

end process;

Uc_decode: process (prs_state,ale,nRd,nWr,nPsen,addr_data,addr_high )

begin


case prs_state is
when IDLE =>

if ale='1' and nPsen = '1' then
next_state <= ADDR_DECODE;
end if;



when ADDR_DECODE =>
if (addr_high=upper_addr and addr_data > x"DF" ) then
next_state<=addr_match;
else next_state <=idle;
end if;

when ADDR_MATCH =>

if nWr='1' then
latch_addr<=addr_data and bit_mask;

else
latch_data <= addr_data;
next_state <= data_trs;
end if;

when DATA_TRS =>


if nRd = '1' and nWr = '1' then
next_state <= END_CYCLE;
end if;



when END_CYCLE =>


if ale = '0' then
next_state <= IDLE;
end if;


end case;

end process;

end rtl;
























</body> </html>

List of 242 messages in thread
TopicAuthorDate
BIG I/O expansion            01/01/70 00:00      
   Like I said            01/01/70 00:00      
      Carry on            01/01/70 00:00      
   As i said before            01/01/70 00:00      
   Fanout            01/01/70 00:00      
      Great idea, but 2 things            01/01/70 00:00      
         Thanx Sasha            01/01/70 00:00      
   Why?            01/01/70 00:00      
      Yep, nice guess            01/01/70 00:00      
   outputs            01/01/70 00:00      
      I really need'em and can't multiplex'em            01/01/70 00:00      
         But why??            01/01/70 00:00      
         Can't you go serial?            01/01/70 00:00      
            Serial??            01/01/70 00:00      
            output of a CPLD            01/01/70 00:00      
               using CPLD outputs ..            01/01/70 00:00      
                  To buffer or not to buffer            01/01/70 00:00      
                     to buffer or not            01/01/70 00:00      
   timing problems            01/01/70 00:00      
   what on earth are you doing            01/01/70 00:00      
      Exactly!            01/01/70 00:00      
   complaints and more info.            01/01/70 00:00      
      Don't worry            01/01/70 00:00      
      Consensus - not conspiracy!            01/01/70 00:00      
      Head Bashing            01/01/70 00:00      
         Head banging            01/01/70 00:00      
      more questions            01/01/70 00:00      
      Summary of data and a suggestion            01/01/70 00:00      
         A typo correction.            01/01/70 00:00      
   well            01/01/70 00:00      
   More info. on the project            01/01/70 00:00      
      More info?            01/01/70 00:00      
      thevenin terminations on LE signals            01/01/70 00:00      
         Cable            01/01/70 00:00      
            Termination must exactly match!            01/01/70 00:00      
               Explanation            01/01/70 00:00      
   Stranger and stranger            01/01/70 00:00      
      Humor            01/01/70 00:00      
         Russel            01/01/70 00:00      
            tolerance goes both ways            01/01/70 00:00      
   Bingo !            01/01/70 00:00      
   Bingo !            01/01/70 00:00      
      repeating myself            01/01/70 00:00      
         bare CPLD            01/01/70 00:00      
            Not professional?            01/01/70 00:00      
   Forget about the second Bingo ! :)            01/01/70 00:00      
      Payam            01/01/70 00:00      
         The new decoder            01/01/70 00:00      
   Cos i am just too good to you :)            01/01/70 00:00      
      Wouldn't this be a bit expensive?            01/01/70 00:00      
   Trifle expensive            01/01/70 00:00      
      synchronous design            01/01/70 00:00      
         synchronicity            01/01/70 00:00      
   Not really            01/01/70 00:00      
      ...but there are clocks            01/01/70 00:00      
   a total mess            01/01/70 00:00      
      Dear Eric            01/01/70 00:00      
         Why didn't you just say....            01/01/70 00:00      
            Sub-micros and RS485            01/01/70 00:00      
         wrong approach            01/01/70 00:00      
            here are the links (I forgot)            01/01/70 00:00      
            Eric            01/01/70 00:00      
               serial/parallel            01/01/70 00:00      
                  Cables, Multiplexing            01/01/70 00:00      
                     more on MPX            01/01/70 00:00      
                        sunlight            01/01/70 00:00      
                           more on sunlight            01/01/70 00:00      
                              Could you please explain more?            01/01/70 00:00      
                                 Where is the current limiting from            01/01/70 00:00      
                                 more explaining            01/01/70 00:00      
                           LEDs are in danger!            01/01/70 00:00      
                              4538ing is nice            01/01/70 00:00      
                              What about this            01/01/70 00:00      
                              instead of 4538            01/01/70 00:00      
                                 all over the globe            01/01/70 00:00      
                                    RE: to do what            01/01/70 00:00      
                                       no need if non-mpx            01/01/70 00:00      
                  Question to Erik            01/01/70 00:00      
                     ST2221            01/01/70 00:00      
               EMI!            01/01/70 00:00      
                  not out, but in            01/01/70 00:00      
                  Transmitting parallel            01/01/70 00:00      
                     Series termination            01/01/70 00:00      
                        correct impedance of series termination            01/01/70 00:00      
                           termination            01/01/70 00:00      
                              Output current            01/01/70 00:00      
                                 Kai, is that right?            01/01/70 00:00      
                                    Series termination methode            01/01/70 00:00      
                                       serial termination, got it            01/01/70 00:00      
                                    series termination            01/01/70 00:00      
                                 cable of 100Ohm            01/01/70 00:00      
                                    Of course!            01/01/70 00:00      
                              used for parallel of thevenin terminatio            01/01/70 00:00      
                           Impedance of flat ribbon cable            01/01/70 00:00      
                              anyhow, termination may not be needed            01/01/70 00:00      
                                 Is needed for 2m long cables!            01/01/70 00:00      
                                    that long not needed            01/01/70 00:00      
                                       Agreed            01/01/70 00:00      
                                 re: termination may not be needed            01/01/70 00:00      
                              Thanx Kai            01/01/70 00:00      
                              Flat cable characteristic impedance            01/01/70 00:00      
                                 Look closely...            01/01/70 00:00      
                                    the the            01/01/70 00:00      
                                    Doh!            01/01/70 00:00      
                                       Initial Misconception            01/01/70 00:00      
                                          I can't even spell that...            01/01/70 00:00      
                        ferrite            01/01/70 00:00      
                           ground is part of signal path            01/01/70 00:00      
                              Vcc IS part of the signal path            01/01/70 00:00      
                                 Vcc PIN is part of signal path            01/01/70 00:00      
                           Depends on what you want to filter            01/01/70 00:00      
                              PC power supply            01/01/70 00:00      
                                 4700micro is too high            01/01/70 00:00      
                                    paralell            01/01/70 00:00      
                                       This cannot work!            01/01/70 00:00      
                                          we have a problem            01/01/70 00:00      
                                             Kai, Eric            01/01/70 00:00      
                                                you need to think            01/01/70 00:00      
                                                paralell resistor current limiter !            01/01/70 00:00      
                                                   Thanks Farshid, Reinforcing PC power sup            01/01/70 00:00      
                                                      Reinforcing PC power            01/01/70 00:00      
   Jan            01/01/70 00:00      
      We don't understand each other            01/01/70 00:00      
         What if only BIG I expansion            01/01/70 00:00      
            Your Own Thread            01/01/70 00:00      
      Metastability            01/01/70 00:00      
   how about            01/01/70 00:00      
   Maybe            01/01/70 00:00      
      Divide the problem            01/01/70 00:00      
      Own ideas            01/01/70 00:00      
      sidesteps            01/01/70 00:00      
   Thanks            01/01/70 00:00      
   I dunno Kai..            01/01/70 00:00      
      I dunnoJez            01/01/70 00:00      
      Agreed            01/01/70 00:00      
         CE radiation            01/01/70 00:00      
   Thanx for criticisims from Eric & Kai            01/01/70 00:00      
      the original poster            01/01/70 00:00      
         Eric, Kai            01/01/70 00:00      
            if you can't explain            01/01/70 00:00      
               paralell resistor current limiter !            01/01/70 00:00      
      Then, why don't you discuss it?            01/01/70 00:00      
         taking our warnings seriously and discus            01/01/70 00:00      
      world record            01/01/70 00:00      
         world record +1            01/01/70 00:00      
   Eric            01/01/70 00:00      
      Cost Is Final Issue            01/01/70 00:00      
         lowest cost            01/01/70 00:00      
            Yeah.......            01/01/70 00:00      
            now drop the multiplex            01/01/70 00:00      
      Let's compare parallel vs. serial            01/01/70 00:00      
         Time to confess            01/01/70 00:00      
            simple bitbang            01/01/70 00:00      
               something ain't mising here?            01/01/70 00:00      
                  more            01/01/70 00:00      
               not even that...            01/01/70 00:00      
                  you can, but            01/01/70 00:00      
                  Cool            01/01/70 00:00      
      urband legends            01/01/70 00:00      
      No influence            01/01/70 00:00      
   This heart of mine on fire            01/01/70 00:00      
      HC595's and ULN2803's            01/01/70 00:00      
         typpo            01/01/70 00:00      
         column xistors            01/01/70 00:00      
            Instantaneous!            01/01/70 00:00      
               saturation and off state not on and off            01/01/70 00:00      
                  What is a 'xistor'??            01/01/70 00:00      
                     Okay, transistor            01/01/70 00:00      
                     xistor            01/01/70 00:00      
                  Saturation and Gain            01/01/70 00:00      
                     FETs and gate capacitance            01/01/70 00:00      
                        Fets Vs Transistors            01/01/70 00:00      
                           Which MOSFET            01/01/70 00:00      
                           More Qs on P-MOSFETs            01/01/70 00:00      
                              Best text ...            01/01/70 00:00      
                              Mosfets            01/01/70 00:00      
                              Low 'Ugs' and low 'Ron' is crucial!            01/01/70 00:00      
                                 Bingo!            01/01/70 00:00      
                                 Soft-start circuit            01/01/70 00:00      
      answers and comments            01/01/70 00:00      
         ghosting            01/01/70 00:00      
            what            01/01/70 00:00      
               ghosting            01/01/70 00:00      
                  ok            01/01/70 00:00      
                     this is probably not the case with Payam            01/01/70 00:00      
                        no, worse            01/01/70 00:00      
            P-MOSFETs            01/01/70 00:00      
         typicals            01/01/70 00:00      
            These probably might go            01/01/70 00:00      
            yes, you are and so what            01/01/70 00:00      
               "them" explained            01/01/70 00:00      
   another solution            01/01/70 00:00      
   Serial is a must!            01/01/70 00:00      
      Serial is not a must!            01/01/70 00:00      
   Additional facts            01/01/70 00:00      
      Multiprocessor?            01/01/70 00:00      
      To ULN or not to ULN            01/01/70 00:00      
         ULN2803, human eye response            01/01/70 00:00      
            typical again            01/01/70 00:00      
         consider everything            01/01/70 00:00      
         Equivalent brightness with pulsing            01/01/70 00:00      
      Re: Additional facts            01/01/70 00:00      
         You put many of them...            01/01/70 00:00      
            Re: You put many of them            01/01/70 00:00      
               the matrix revisited            01/01/70 00:00      
   here are some more additional facts            01/01/70 00:00      
      NFI            01/01/70 00:00      
         Me, not subtle ???            01/01/70 00:00      
            Subtle as a brick!            01/01/70 00:00      
   one little detail            01/01/70 00:00      
      30° is it enough?            01/01/70 00:00      
   Calculating ... please wait!            01/01/70 00:00      
      answers/comments            01/01/70 00:00      
         six-layer boards?            01/01/70 00:00      
            no 2 layers possible            01/01/70 00:00      
               6 layer for 20$???            01/01/70 00:00      
                  here            01/01/70 00:00      
                     PCB discussion extracted            01/01/70 00:00      
               a trace about 1 inch            01/01/70 00:00      
                  20A on a 2mm track!            01/01/70 00:00      
                  holy smoke            01/01/70 00:00      
                     Okay.            01/01/70 00:00      
                        again            01/01/70 00:00      
                           colloquialism            01/01/70 00:00      
               Calculating a bit...            01/01/70 00:00      
                  'Three' layer design            01/01/70 00:00      
                     layers - LED - EMI            01/01/70 00:00      
                        LEDs don't understand ground bounce            01/01/70 00:00      
                           But the four 74HC595 and ULN2804 do!            01/01/70 00:00      
                              595s don't, ULN ... not important            01/01/70 00:00      
                                 not so            01/01/70 00:00      
                           Ground bounce            01/01/70 00:00      
                              Sure, shall take care of it.            01/01/70 00:00      
      Don't underestimate heat dissipation!            01/01/70 00:00      
   Kai            01/01/70 00:00      
      Payam            01/01/70 00:00      
         less complex/less expensive            01/01/70 00:00      
         Did you try the multiplex?            01/01/70 00:00      
            Yes            01/01/70 00:00      
            go ahead and try            01/01/70 00:00      
            Square root increase            01/01/70 00:00      
               Distributed power supply            01/01/70 00:00      

Back to Subject List