Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Electronic Equipment > VHDL > Re: ****ft regi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 18 of 18 Topic 6054 of 6417
Post > Topic >>

Re: ****ft register extraction fails

by Sean Durkin <news_may08@[EMAIL PROTECTED] > May 30, 2008 at 09:51 PM

Kevin Neilson wrote:
> I have found that you can sometimes use better style than the
> templates in the XST user's guide and they still synthesize properly.
> This code, which I think is better style, synthesizes the same way:

> library ieee;
> use ieee.std_logic_1164.all;
> entity ****ft_registers_1 is
>   ****t(C, SI : in std_logic;
>        SO : out std_logic);
> end ****ft_registers_1;
> architecture archi of ****ft_registers_1 is
>   signal SI_dly : std_logic_vector(7 downto 0);
> begin
>   process (C)
>   begin
>     if (rising_edge(C)) then
>       SI_dly <= SI_dly(6 downto 0) & SI;
>     end if;
>   end process;
>   SO <= SI_dly(7);
> end archi; 

I like this style even better, since you only have to change one single
line of code (the signal declaration) when you want to change the delay
later on:

library ieee;
use ieee.std_logic_1164.all;
entity ****ft_registers_1 is
  ****t(C, SI : in std_logic;
       SO : out std_logic);
end ****ft_registers_1;
architecture archi of ****ft_registers_1 is
  signal SI_dly : std_logic_vector(7 downto 0);
begin
  process (C)
  begin
    if (rising_edge(C)) then
      SI_dly <= SI_dly(SI_dly'length-2 downto 0) & SI;
    end if;
  end process;
  SO <= SI_dly(SI_dly'left);
end archi;

This also works if you later decide to pass the length of SI_dly as a
GENERIC when instantiating the thing.

cu,
Sean
 




 18 Posts in Topic:
Shift register extraction fails
Philip Herzog <phu@[EM  2008-05-29 10:21:53 
Re: Shift register extraction fails
"Symon" <sym  2008-05-29 10:01:17 
Re: Shift register extraction fails
Philip Herzog <phu@[EM  2008-05-29 11:06:22 
Re: Shift register extraction fails
"Symon" <sym  2008-05-29 15:27:05 
Re: Shift register extraction fails
Brian Drummond <brian_  2008-05-29 13:18:11 
Re: Shift register extraction fails
Philip Herzog <phu@[EM  2008-05-29 15:51:46 
Re: Shift register extraction fails
Mike Treseler <mike_tr  2008-05-29 11:52:25 
Re: Shift register extraction fails
Philip Herzog <phu@[EM  2008-05-30 09:29:16 
Re: Shift register extraction fails
Mike Treseler <mtresel  2008-05-30 08:09:51 
Re: Shift register extraction fails
Tricky <Trickyhead@[EM  2008-05-30 02:52:25 
Re: Shift register extraction fails
Philip Herzog <phu@[EM  2008-05-30 11:56:57 
Re: Shift register extraction fails
jens <roden@[EMAIL PRO  2008-05-29 14:49:57 
Re: Shift register extraction fails
"Symon" <sym  2008-05-30 01:45:32 
Re: Shift register extraction fails
Kevin Neilson <kevin_n  2008-05-30 12:29:41 
Re: Shift register extraction fails
Mike Treseler <mike_tr  2008-05-30 12:44:33 
Re: Shift register extraction fails
Kevin Neilson <kevin_n  2008-05-30 13:59:47 
Re: Shift register extraction fails
"Symon" <sym  2008-05-31 01:43:41 
Re: Shift register extraction fails
Sean Durkin <news_may0  2008-05-30 21:51:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 15:54:19 CST 2008.