乐勉力的个人空间 https://blog.eetop.cn/956667 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

数码管的静态显示

已有 403 次阅读| 2012-6-23 09:33

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

entity jingtai is
     port(clk   :in std_logic;
         seg1   :out std_logic_vector(7 downto 0);
         seg_dat:out std_logic_vector(7 downto 0));
end jingtai;

architecture one of jingtai is
    signal cnt8   :std_logic_vector(2 downto 0);
    signal clk_tem:std_logic;
    signal cnt    :std_logic_vector(25 downto 0);
begin
      
process(clk)
begin
  if clk'event and clk='1' then
      if cnt=600  then
         clk_tem<=not clk_tem;--取反,分频
         cnt<=(others=>'0');
      else
         cnt<=cnt+1;
      end if;
  end if;
end process;

 p1:process(clk_tem)
    begin
       if(clk_tem'event and clk_tem='1') then
          if(cnt8="111")then
             cnt8<="000";
          else
             cnt8<=cnt8+1;
          end if;
       end if;
     end process p1;

p2:process(clk_tem)
       begin
       case cnt8 is
          when"000"=>seg_dat<="01111111";
          when"001"=>seg_dat<="10111111";
          when"010"=>seg_dat<="11011111";
          when"011"=>seg_dat<="11101111";
          when"100"=>seg_dat<="11110111";
          when"101"=>seg_dat<="11111011";
          when"110"=>seg_dat<="11111101";
          when"111"=>seg_dat<="11111110";
          when thers=>null;
       end case;
       end process p2;


p3:process(clk_tem)
   begin
       case cnt8 is
          when"000"=>seg1<="01111001";  --1
          when"001"=>seg1<="00100100";  --2
          when"010"=>seg1<="00110000";  --3
          when"011"=>seg1<="00011001";  --4
          when"100"=>seg1<="00010010";  --5
          when"101"=>seg1<="00000010";  --6
          when"110"=>seg1<="01111000";  --7
          when"111"=>seg1<="00000000";  --8
          when thers=>null;
       end case;
   end process p3;
end one;


点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 1

    粉丝
  • 0

    好友
  • 0

    获赞
  • 0

    评论
  • 43

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-6-27 01:47 , Processed in 0.133239 second(s), 13 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部