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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Jez Smith
01/13/06 00:59
Read: 1272 times
Birmingham
England


 
#107243 - Heres a start
Responding to: Farshid Jafari Harandi'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      Farshid Jafari Harandi      01/05/06 15:26      
   Link      Kai Klaas      01/06/06 05:43      
      why go for 20MHz      Erik Malund      01/06/06 07:07      
         No 4 layer PCB & faster ADC available      Farshid Jafari Harandi      01/07/06 03:56      
      Initial look ...      Farshid Jafari Harandi      01/07/06 03:51      
         Trigger Circuit      Farshid Jafari Harandi      01/07/06 07:55      
            Try of explaination      Kai Klaas      01/07/06 14:21      
               Badly drawn      Steve M. Taylor      01/07/06 14:47      
               Trigger and Amp      Farshid Jafari Harandi      01/07/06 17:18      
                  Take care...      Kai Klaas      01/07/06 18:26      
                     Speed      Steve M. Taylor      01/08/06 05:32      
                        Like This ?      Farshid Jafari Harandi      01/08/06 07:52      
                           Just wait...      Steve M. Taylor      01/08/06 09:12      
                              so what do they do there ?      Farshid Jafari Harandi      01/08/06 10:29      
                                 Direct Digital synthesis      Steve M. Taylor      01/08/06 10:51      
                                    I just can think about one benefit      Farshid Jafari Harandi      01/08/06 13:09      
                     Searching...      Farshid Jafari Harandi      01/08/06 07:44      
                        Misinterpretation      Kai Klaas      01/09/06 06:20      
                           Proper Op-Amp      Farshid Jafari Harandi      01/09/06 16:49      
                              AD844 has 50 Ohm input resistance on -      Frieder Ferlemann      01/10/06 02:04      
                                 inverting input resistance      Farshid Jafari Harandi      01/10/06 09:05      
                              specifications      Kai Klaas      01/10/06 07:24      
                                 sampling      Farshid Jafari Harandi      01/10/06 09:14      
                                    Of course      Kai Klaas      01/10/06 09:27      
                                       Yes but      Steve M. Taylor      01/10/06 14:53      
                                          Exactly!      Kai Klaas      01/11/06 06:15      
                                 Preamp Initial Schematic      Farshid Jafari Harandi      01/10/06 21:18      
                                    please resubmit the schematic in a forma      Erik Malund      01/11/06 06:24      
                                       Real size button      Kai Klaas      01/11/06 06:39      
                                          not quite good enough      Erik Malund      01/11/06 06:53      
                                             Higher Resolution      Farshid Jafari Harandi      01/11/06 07:17      
                                       Resize      Farshid Jafari Harandi      01/11/06 06:56      
                                          I do not care if it fits, I can move it      Erik Malund      01/11/06 07:21      
                                             readable with gthumb      Frieder Ferlemann      01/11/06 08:17      
                                             They are1N4148s      Farshid Jafari Harandi      01/11/06 08:18      
                                             Problem is at your end      Ian Bell      01/11/06 12:04      
                                                do you refer to the first submit      Erik Malund      01/11/06 12:09      
                                                   Web Browser      Steve M. Taylor      01/11/06 13:28      
                                                   Both      Ian Bell      01/11/06 14:17      
                                    Some changes needed      Kai Klaas      01/11/06 19:05      
                                       have to sleep a little ,will post later      Farshid Jafari Harandi      01/11/06 22:19      
                                       I would try this      Kai Klaas      01/12/06 07:20      
                                          not an analog eagle      Erik Malund      01/12/06 07:34      
                                             Why not      Kai Klaas      01/12/06 07:58      
                                                not objecting, just wondering      Erik Malund      01/12/06 08:31      
                                          Updated Schematic      Farshid Jafari Harandi      01/12/06 13:21      
                                             FETs      Farshid Jafari Harandi      01/12/06 13:39      
                                                I remember going to the races on Thursda      Erik Malund      01/12/06 13:45      
                                                   Yes, Nowadays they're held at friday      Farshid Jafari Harandi      01/12/06 14:13      
                                             Answers      Kai Klaas      01/12/06 19:01      
                                                JFET Input good      Farshid Jafari Harandi      01/12/06 21:30      
                                                   Deviations      Kai Klaas      01/13/06 07:06      
                                             Answers II        Kai Klaas      01/13/06 06:53      
                                                Corrected mistakes      Farshid Jafari Harandi      01/13/06 10:31      
                                                   Answers III      Kai Klaas      01/13/06 17:44      
                                                      RE : Answers III      Farshid Jafari Harandi      01/13/06 19:05      
                                                      new questions about PCB/Supply      Farshid Jafari Harandi      01/13/06 20:48      
                                                         Answers IV        Kai Klaas      01/14/06 07:22      
                                                            RE : Answers IV      Farshid Jafari Harandi      01/14/06 12:29      
                                          How do adjust the cap trimmers?      Kai Klaas      01/15/06 18:06      
                                             Thanks for everything      Farshid Jafari Harandi      01/16/06 02:29      
                     Found these      Farshid Jafari Harandi      01/08/06 13:06      
            inductance      Kai Klaas      01/10/06 09:39      
               Relays      Farshid Jafari Harandi      01/10/06 21:24      
                  Reed-relay        Kai Klaas      01/11/06 07:57      
                     Reed Relays      Farshid Jafari Harandi      01/11/06 08:19      
         Plays no significant role      Kai Klaas      01/07/06 13:59      
            but they are sensitive      Erik Malund      01/09/06 10:36      
               Analog Mux      Farshid Jafari Harandi      01/09/06 16:42      
                  today Philips announced this MUX      Erik Malund      01/10/06 07:21      
                  Strac capacitance make the worse      Kai Klaas      01/10/06 09:22      
                     Sorry, stray not strac      Kai Klaas      01/10/06 09:23      
   a better aproach maybe      Jez Smith      01/12/06 08:27      
      PLD question      Farshid Jafari Harandi      01/12/06 14:15      
         Re PLD questions      Jez Smith      01/12/06 15:57      
            link      Jez Smith      01/12/06 16:05      
            Go for CPLD or not !      Farshid Jafari Harandi      01/12/06 20:28      
               Not in that timescale      Jez Smith      01/13/06 00:22      
                  so about 10K gates are needed ?      Farshid Jafari Harandi      01/13/06 12:46      
                     part numbers      Jez Smith      01/14/06 01:10      
                        Wow pretty expensive !      Farshid Jafari Harandi      01/14/06 02:18      
                  I'll have to wait till tommorow      Farshid Jafari Harandi      01/13/06 13:09      
   is this helpful?      Erik Malund      01/12/06 14:25      
      good link      Farshid Jafari Harandi      01/12/06 20:22      
   Heres a start      Jez Smith      01/13/06 00:59      
   'must read'        Rob Klein      01/14/06 07:25      
      What a great reference !      Farshid Jafari Harandi      01/14/06 12:33      

Back to Subject List