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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/13/06 07:59
Read: times


 
#107243 - Heres a start
Responding to: ???'s previous message
As a start here is some code which will allow you to generate 'large' counters for your addressing scheme,its not simple code but it does produce large fast counters and will stop the logic compiler using its generic counters which would be smaller but prolly not fast enough after everything else has been placed and routed.

---vhdl code to generate the simplest and therefore the fastest practical binary up 
---counter structure in a cpld/fpga.In most synthesis tools the generic counter
--- macro is a trade off between size and speed and will not generate wide/fast counters easily
--- 

---The counter consists of an array of T-type flip flops and AND gates.
---Most modern cplds can implement an AND gate upto 48 bits wide therefore counters upto 
---48 bits long need only one layer of decode logic.Clock rates of 250 Mhz for a 32 bit
--- counter are achievable in a xilinx 95xl series cpld.

---Inputs
---clk clock in
---reset_n active low asyncronous reset

---Outputs
---q N bit wide counter output


library ieee;
use ieee.std_logic_1164.all;

entity tff is
   port(clk      :in    std_logic;
         t       :in    std_logic;
         clear   :in    std_logic;
         q       :inout std_logic);
end tff;

architecture rtl of tff is
begin
   process(clear, clk)
   begin
      if clear = '0' then
         q <= '0';
      elsif rising_edge(clk) then
         if t = '1' then
            q <= not q;
         else
            null;
         end if;
      end if;
   end process;
end rtl;



library ieee;
use ieee.std_logic_1164.all;

entity fastcntr is
   generic(size  : positive := 32);     ---counter width
   port(clk      : in std_logic;
        reset_n : in std_logic;
        q        : inout std_logic_vector((size-1) downto 0));
end fastcntr;

architecture rtl of fastcntr is

   component tff is
      port(clk   :in    std_logic;
         t       :in    std_logic;
         clear   :in    std_logic;
         q       :inout std_logic);
   end component;

   signal tin : std_logic_vector((size-1) downto 0);

begin

   genttf : for i in (size-1) downto 0 generate
      ttype : tff port map (clk, tin(i), reset_n, q(i));
   end generate;

   genand : for i in 0 to (size-1) generate
      t0 : if i = 0 generate
         tin(i) <= '1';
      end generate;
      t1_size : if i > 0 generate
         tin(i) <= q(i-1) and tin(i-1);
      end generate;
   end generate;

end rtl;






List of 87 messages in thread
TopicAuthorDate
20Mhz Analog Input of a DSO            01/01/70 00:00      
   Link            01/01/70 00:00      
      why go for 20MHz            01/01/70 00:00      
         No 4 layer PCB & faster ADC available            01/01/70 00:00      
      Initial look ...            01/01/70 00:00      
         Trigger Circuit            01/01/70 00:00      
            Try of explaination            01/01/70 00:00      
               Badly drawn            01/01/70 00:00      
               Trigger and Amp            01/01/70 00:00      
                  Take care...            01/01/70 00:00      
                     Speed            01/01/70 00:00      
                        Like This ?            01/01/70 00:00      
                           Just wait...            01/01/70 00:00      
                              so what do they do there ?            01/01/70 00:00      
                                 Direct Digital synthesis            01/01/70 00:00      
                                    I just can think about one benefit            01/01/70 00:00      
                     Searching...            01/01/70 00:00      
                        Misinterpretation            01/01/70 00:00      
                           Proper Op-Amp            01/01/70 00:00      
                              AD844 has 50 Ohm input resistance on -            01/01/70 00:00      
                                 inverting input resistance            01/01/70 00:00      
                              specifications            01/01/70 00:00      
                                 sampling            01/01/70 00:00      
                                    Of course            01/01/70 00:00      
                                       Yes but            01/01/70 00:00      
                                          Exactly!            01/01/70 00:00      
                                 Preamp Initial Schematic            01/01/70 00:00      
                                    please resubmit the schematic in a forma            01/01/70 00:00      
                                       Real size button            01/01/70 00:00      
                                          not quite good enough            01/01/70 00:00      
                                             Higher Resolution            01/01/70 00:00      
                                       Resize            01/01/70 00:00      
                                          I do not care if it fits, I can move it            01/01/70 00:00      
                                             readable with gthumb            01/01/70 00:00      
                                             They are1N4148s            01/01/70 00:00      
                                             Problem is at your end            01/01/70 00:00      
                                                do you refer to the first submit            01/01/70 00:00      
                                                   Web Browser            01/01/70 00:00      
                                                   Both            01/01/70 00:00      
                                    Some changes needed            01/01/70 00:00      
                                       have to sleep a little ,will post later            01/01/70 00:00      
                                       I would try this            01/01/70 00:00      
                                          not an analog eagle            01/01/70 00:00      
                                             Why not            01/01/70 00:00      
                                                not objecting, just wondering            01/01/70 00:00      
                                          Updated Schematic            01/01/70 00:00      
                                             FETs            01/01/70 00:00      
                                                I remember going to the races on Thursda            01/01/70 00:00      
                                                   Yes, Nowadays they're held at friday            01/01/70 00:00      
                                             Answers            01/01/70 00:00      
                                                JFET Input good            01/01/70 00:00      
                                                   Deviations            01/01/70 00:00      
                                             Answers II            01/01/70 00:00      
                                                Corrected mistakes            01/01/70 00:00      
                                                   Answers III            01/01/70 00:00      
                                                      RE : Answers III            01/01/70 00:00      
                                                      new questions about PCB/Supply            01/01/70 00:00      
                                                         Answers IV            01/01/70 00:00      
                                                            RE : Answers IV            01/01/70 00:00      
                                          How do adjust the cap trimmers?            01/01/70 00:00      
                                             Thanks for everything            01/01/70 00:00      
                     Found these            01/01/70 00:00      
            inductance            01/01/70 00:00      
               Relays            01/01/70 00:00      
                  Reed-relay            01/01/70 00:00      
                     Reed Relays            01/01/70 00:00      
         Plays no significant role            01/01/70 00:00      
            but they are sensitive            01/01/70 00:00      
               Analog Mux            01/01/70 00:00      
                  today Philips announced this MUX            01/01/70 00:00      
                  Strac capacitance make the worse            01/01/70 00:00      
                     Sorry, stray not strac            01/01/70 00:00      
   a better aproach maybe            01/01/70 00:00      
      PLD question            01/01/70 00:00      
         Re PLD questions            01/01/70 00:00      
            link            01/01/70 00:00      
            Go for CPLD or not !            01/01/70 00:00      
               Not in that timescale            01/01/70 00:00      
                  so about 10K gates are needed ?            01/01/70 00:00      
                     part numbers            01/01/70 00:00      
                        Wow pretty expensive !            01/01/70 00:00      
                  I'll have to wait till tommorow            01/01/70 00:00      
   is this helpful?            01/01/70 00:00      
      good link            01/01/70 00:00      
   Heres a start            01/01/70 00:00      
   'must read'            01/01/70 00:00      
      What a great reference !            01/01/70 00:00      

Back to Subject List