⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vhdl 文本文档.txt

📁 用MAXPLUS设计的CMI程序
💻 TXT
字号:
--shiyanbufen VHDLdaima--
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity cmi is
   port( clk    :   in   std_logic;
         key    :   in   std_logic_vector(7 downto 0);
         cmiin  :   in   std_logic;
         cmiout :  out   std_logic;
         sout   :  out   std_logic);
end cmi;
architecture behave of cmi is
  signal sin:     std_logic;
  signal scount:  std_logic_vector(2 downto 0);
  signal cmi_temp: std_logic;
  signal cme_out : std_logic;
  signal s1,s2   :std_logic;
  begin
  process(clk)
    begin
      if(clk'event and clk='1') then
         scount<=scount+1;
         case(scount) is
           when "000"=>sin<=key(1);
                 ......
           when "111"=>sin<=key(0);
           when others=>sin<='0';
         end case;
         cmi_temp<=not cmi_temp;
       end if;
  end process;
  process(clk,scount)
    begin
      if(sin='1') then
         cmiout<=cmi_temp;
      else
         cmiout<=not clk;
      end if;
  end process;
  process(clk)
    begin
      if(clk'event and clk='1') then
         s1<=cmiin;
      end if;
      if(clk'event and clk='0') then 
         s2<=cmiin;
      end if;
  end process;
  process(clk)
    begin 
      if(clk'event and clk='0') then
         sout<=not (s1 xor s2);
      end if;
  end process;
end behave;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -