please dont rip this site

Digital Signal Processing Logic

From Leslie Yip:

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

Entity D_FILTER is
  port( CLK,NRST: in std_logic;
            S_IN: in std_logic_vector(1 downto 0);
            DFIR: in std_logic;
            S_OUT: out std_logic_vector(1 downto 0)
            );
end D_FILTER;

architecture D_FILTER_ARCH of D_FILTER is
signal countA: std_logic_vector(1 downto 0);
signal countB: std_logic_vector(1 downto 0);
signal DS_OUT: std_logic_vector(1 downto 0);

begin

process(CLK, NRST)
begin
if NRST='0' then
     countA <= (others=>'0');

elsif CLK='1' and CLK'event then
     if S_IN(0) ='1' and countA /= 2 then
       countA <= countA + 1;
     elsif S_IN(0) ='0' and countA /= 0 then
       countA <= countA - 1;
     end if;
end if;
end process;


process(CLK)
begin
--if DFIR = '1' then
--  S_OUT <= S_IN;
--else
if CLK='1' and CLK'event then
  if countA=2 then
    DS_OUT(0) <= '1';
  elsif countA = 0 then
    DS_OUT(0) <= '0';
  end if;
end if;
--end if;
end process;

process(DFIR, S_IN, DS_OUT)
begin
if DFIR = '1' then
  S_OUT(0) <= S_IN(0);
else
  S_OUT(0) <= DS_OUT(0);
end if;
end process;


process(CLK, NRST)
begin
if NRST='0' then
     countB <= (others=>'0');

elsif CLK='1' and CLK'event then
     if S_IN(1) ='1' and countB /= 2 then
       countB <= countB + 1;
     elsif S_IN(1) ='0' and countB /= 0 then
       countB <= countB - 1;
     end if;
end if;
end process;


process(CLK)
begin
--if DFIR = '1' then
--  S_OUT <= S_IN;
--else
if CLK='1' and CLK'event then
  if countB=2 then
    DS_OUT(1) <= '1';
  elsif countB = 0 then
    DS_OUT(1) <= '0';
  end if;
end if;
--end if;
end process;

process(DFIR, S_IN, DS_OUT)
begin
if DFIR = '1' then
  S_OUT(1) <= S_IN(1);
else
  S_OUT(1) <= DS_OUT(1);
end if;
end process;

end D_FILTER_ARCH;

See also:


file: /Techref/logic/dsp/filter/majority.htm, 2KB, , updated: 2000/11/29 09:44, local time: 2017/11/23 12:28,
TOP NEW HELP FIND: 
54.224.164.166:LOG IN

 ©2017 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE! / 

<A HREF="http://www.piclist.com/techref/logic/dsp/filter/majority.htm"> Digital Signal Processing Logic - Majority Filter</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2017 contributors:
o List host: MIT, Site host massmind.org, Top posters @20171123 RussellMc, Van Horn, David, James Cameron, Sean Breheny, alan.b.pearce, IVP, Neil, David C Brown, Bob Blick, Denny Esterline,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
 

Welcome to www.piclist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .