2656|2

2

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

请问怎么消除锁存器? [复制链接]

是带7位数码管的模100计数器
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity top is
       port(clk,rst:in std_logic;
                      digit1,digit2:out std_logic_vector(6 downto 0));
end top;

architecture Behavioral of top is
begin
     process(clk,rst)
           variable temp1,temp2:integer range 0 to 10;
          begin
     if(rst='1')then
          temp1:=0;
          temp2:=0;
     elsif(clk'event and clk='1')then
          temp1:=temp1+1;
          if(temp1=10)then
          temp1:=0;
          temp2:=temp2+1;
          if(temp2=10)then
          temp2:=0;
     end if;
          end if;
          end if;

   case temp1 is
        when 0 => digit1 <= "1111110";
        when 1 => digit1 <= "0110000";
        when 2 => digit1 <= "1101101";
        when 3 => digit1 <= "1111001";
        when 4 => digit1 <= "0110011";
        when 5 => digit1 <= "1011011";
        when 6 => digit1 <= "1011111";
        when 7 => digit1 <= "1110000";
        when 8 => digit1 <= "1111111";
        when 9 => digit1 <= "1111011";
        when others => null;
        end case;
       
        case temp2 is
        when 0 => digit2 <= "1111110";
        when 1 => digit2 <= "0110000";
        when 2 => digit2 <= "1101101";
        when 3 => digit2 <= "1111001";
        when 4 => digit2 <= "0110011";
        when 5 => digit2 <= "1011011";
        when 6 => digit2 <= "1011111";
        when 7 => digit2 <= "1110000";
        when 8 => digit2 <= "1111111";
        when 9 => digit2 <= "1111011";
        when others => null;
        end case;
end process;
end Behavioral;
总是有如下的警告
WARNING:HDLCompiler:1369 - "C:\Users\zm\counter\top.vhd" Line 11: Possible infinite loop; process does not have a wait statement
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal >. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.


此帖出自FPGA/CPLD论坛

最新回复

library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity top is         port(        clk,rst:in std_logic;        digit1,digit2:out std_logic_vector(6 downto 0)     ); end top; architecture Behavioral of top is begin process(clk,rst) variable temp1,temp2:integer range 0 to 10; begin         if(rst='1')then                 temp1:=0;                 temp2:=0;         elsif(clk'event and clk='1')then                 temp1:=temp1+1;                 if(temp1=10)then                         temp1:=0;                         temp2:=temp2+1;                         if(temp2=10)then                                 temp2:=0;                         end if;                 end if;         end if;         if(clk'event and clk='1')then                 case temp1 is                         when 0 => digit1 <= "1111110";                         when 1 => digit1 <= "0110000";                         when 2 => digit1 <= "1101101";                         when 3 => digit1 <= "1111001";                         when 4 => digit1 <= "0110011";                         when 5 => digit1 <= "1011011";                         when 6 => digit1 <= "1011111";                         when 7 => digit1 <= "1110000";                         when 8 => digit1 <= "1111111";                         when 9 => digit1 <= "1111011";                         when others => null;                 end case;         end if;                 if(clk'event and clk='1')then                 case temp2 is                         when 0 => digit2 <= "1111110";                         when 1 => digit2 <= "0110000";                         when 2 => digit2 <= "1101101";                         when 3 => digit2 <= "1111001";                         when 4 => digit2 <= "0110011";                         when 5 => digit2 <= "1011011";                         when 6 => digit2 <= "1011111";                         when 7 => digit2 <= "1110000";                         when 8 => digit2 <= "1111111";                         when 9 => digit2 <= "1111011";                         when others => null;                 end case;         end if; end process; end Behavioral;复制代码   详情 回复 发表于 2017-8-11 11:57
点赞 关注
 

回复
举报

664

帖子

104

TA的资源

纯净的硅(中级)

沙发
 
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;

  3. entity top is
  4.         port(
  5.        clk,rst:in std_logic;
  6.        digit1,digit2:out std_logic_vector(6 downto 0)
  7.     );
  8. end top;

  9. architecture Behavioral of top is
  10. begin

  11. process(clk,rst)
  12. variable temp1,temp2:integer range 0 to 10;
  13. begin
  14.         if(rst='1')then
  15.                 temp1:=0;
  16.                 temp2:=0;
  17.         elsif(clk'event and clk='1')then
  18.                 temp1:=temp1+1;
  19.                 if(temp1=10)then
  20.                         temp1:=0;
  21.                         temp2:=temp2+1;
  22.                         if(temp2=10)then
  23.                                 temp2:=0;
  24.                         end if;
  25.                 end if;
  26.         end if;

  27.         if(clk'event and clk='1')then
  28.                 case temp1 is
  29.                         when 0 => digit1 <= "1111110";
  30.                         when 1 => digit1 <= "0110000";
  31.                         when 2 => digit1 <= "1101101";
  32.                         when 3 => digit1 <= "1111001";
  33.                         when 4 => digit1 <= "0110011";
  34.                         when 5 => digit1 <= "1011011";
  35.                         when 6 => digit1 <= "1011111";
  36.                         when 7 => digit1 <= "1110000";
  37.                         when 8 => digit1 <= "1111111";
  38.                         when 9 => digit1 <= "1111011";
  39.                         when others => null;
  40.                 end case;
  41.         end if;
  42.        
  43.         if(clk'event and clk='1')then
  44.                 case temp2 is
  45.                         when 0 => digit2 <= "1111110";
  46.                         when 1 => digit2 <= "0110000";
  47.                         when 2 => digit2 <= "1101101";
  48.                         when 3 => digit2 <= "1111001";
  49.                         when 4 => digit2 <= "0110011";
  50.                         when 5 => digit2 <= "1011011";
  51.                         when 6 => digit2 <= "1011111";
  52.                         when 7 => digit2 <= "1110000";
  53.                         when 8 => digit2 <= "1111111";
  54.                         when 9 => digit2 <= "1111011";
  55.                         when others => null;
  56.                 end case;
  57.         end if;
  58. end process;

  59. end Behavioral;
复制代码

此帖出自FPGA/CPLD论坛
 
 

回复

2

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
此帖出自FPGA/CPLD论坛
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/9 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表