DDS函数信号发生器的设计与实现 第5页

DDS函数信号发生器的设计与实现 第5页
 END IF ;
    IF (DA_2_SEL='1' AND CLK='1')  THEN
       DA_2B<="1110";
    ELSE DA_2B<=DA_2;
    END IF ;
 IF (DA_3_SEL='1' AND CLK='1')  THEN
 DA_3B<="1110";
 ELSE DA_3B<=DA_3;
 END IF ;
   IF (DA_4_SEL='1' AND CLK='1')  THEN
       DA_4B<="1110";
   ELSE DA_4B<=DA_4;
   END IF ;
END PROCESS;

PROCESS (CLK2)---扫描
BEGIN
 IF CLK2 'event AND CLK2 = '1' THEN
 SEL<=SEL+1;
 END IF ;
 case sel is
     when "000" => A <= da_1B;
     when "001" => A <= da_2B;
     when "010" => A <= da_3B;
     when "011" => A <= da_4B;
     when others => null;
 end case;
END PROCESS ;

PROCESS( A )
BEGIN
  CASE  A  IS
   WHEN "0000" =>  LED7S <= "0111111" ;--显示0
   WHEN "0001" =>  LED7S <= "0000110" ;--显示1
   WHEN "0010" =>  LED7S <= "1011011" ;--显示2
   WHEN "0011" =>  LED7S <= "1001111" ;--显示3
   WHEN "0100" =>  LED7S <= "1100110" ;--显示4
   WHEN "0101" =>  LED7S <= "1101101" ;--显示5
   WHEN "0110" =>  LED7S <= "1111101" ;--显示6
   WHEN "0111" =>  LED7S <= "0000111" ;--显示7
   WHEN "1000" =>  LED7S <= "1111111" ;--显示8
   WHEN "1001" =>  LED7S <= "1101111" ;--显示9
   WHEN "1010" =>  LED7S <= "1101101" ;--显示A
   WHEN "1100" =>  LED7S <= "0111001" ;--显示C
   WHEN "1110" =>  LED7S <= "1000000" ;--显示--
   WHEN OTHERS =>  NULL ;
   END CASE ;
END PROCESS ;
end;

上一页  [1] [2] [3] [4] [5] 

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有