zoukankan      html  css  js  c++  java
  • 每天进步一点点------基础实验_08_触发器 :D、T触发器各一

     1 /*********************************************************************************
     2 * Company                    : 
     3 * Engineer                    : 空气微凉
     4 * 
     5 * Create Date                : 00:00:00 22/03/2013 
     6 * Design Name                : 
     7 * Module Name                :         
     8 * Project Name                :  
     9 * Target Devices            : 
    10 * Tool versions            : 
    11 * Description                :  
    12 *                       http://www.cnblogs.com/kongqiweiliang/             
    13 * Dependencies                : 
    14 *
    15 * Revision                    : 
    16 * Revision                    : 0.01 - File Created
    17 * Additional Comments    : 基础实验_08_触发器 :D、T触发器各一
    18 ********************************************************************************/
    19 `timescale 1ns/1ps
    20 `define    UD  #1
    21 /*******************************************************************************/
    22 module FLIP_FLOP    
    23 ( 
    24     //system interface
    25     input                                     iCLK_50        ,//50MHz
    26     input                                     iRESET         ,//system interface
    27     //Interface package
    28     input                                    iDFF_DAT        ,//
    29     input                                    iTFF_DAT        ,//
    30     output  reg                            oDFF_DAT        ,//
    31     output  reg                            oTFF_DAT          //
    32 );  
    33 //-------------------------------------------------------------------------------
    34 //D触发器
    35 always@(posedge iCLK_50 or negedge iRESET)begin
    36     if(!iRESET)
    37         oDFF_DAT <= 1'h0;
    38     else
    39         oDFF_DAT <= iDFF_DAT;
    40 end
    41  
    42 //T触发器
    43 //具有保持和翻转功能的电路,即当T=0时能保持状态不变,
    44 //T=1时一定翻转的电路,都称为T触发器
    45 wire  oTFF_DAT_N;
    46 always@(posedge iCLK_50 or negedge iRESET)begin
    47     if(!iRESET)
    48         oTFF_DAT <= 1'h0;
    49     else    
    50         oTFF_DAT <= oTFF_DAT_N;
    51 end
    52 assign oTFF_DAT_N = iTFF_DAT ? (~oTFF_DAT) : oTFF_DAT;
    53 //-------------------------------------------------------------------------------
    54 endmodule 
  • 相关阅读:
    一步一步理解XMLDOM(一)
    按轨迹周期运动
    Python中’__main__’模块的作用
    多进程IPC与Python支持
    Eclipse启动多个Android模拟器
    解决Android平台移植ffmpeg的一揽子问题
    开源项目 GitHub地址
    使用viewpager嵌套实现上下左右滑动切换图片(IOS双向滚动翻页效果相同)
    Android中ScrollView消除阴影的办法
    如果项目为android library怎么运行
  • 原文地址:https://www.cnblogs.com/kongqiweiliang/p/3246447.html
Copyright © 2011-2022 走看看