打印
[CPLD]

CPLD模块输出自定义

[复制链接]
582|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
DAEMONS|  楼主 | 2017-5-2 12:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
沙发
DAEMONS|  楼主 | 2017-5-15 17:45 | 只看该作者
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity load_A is
  PORT(
       clk_50 :IN  STD_LOGIC;  --输入主频
       pin_out :OUT STD_LOGIC   --输出管脚
      );
end load_A;

architecture Behavioral of load_A is
SIGNAL output_reg:STD_LOGIC:='1';
BEGIN
    PROCESS
    VARIABLE cnt: INTEGER RANGE 0 to 500;
   BEGIN
        WAIT UNTIL(RISING_EDGE(clk_50));
           IF cnt=50 THEN
                cnt:=0;
                  output_reg<='0';
           ELSE
                cnt:=cnt+1;
           END IF;                        
        END PROCESS;
pin_out<=output_reg;
end Behavioral;

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

4

主题

10

帖子

0

粉丝