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

📄 one_shot.v

📁 Verilog实现mini-uart
💻 V
字号:
//============================================================================
//
//        Title     : UART RECIEVER DESIGN
//        Author    : JP LIU
//
//=============================================================================
//
//        File Name      : one_shot.v
//        Module Name    : one_shot
//
//=============================================================================
//
// this module generates a one shot pulse whenever an input goes high from low
//
//          |---|   |---|   |---|   |
// _________|   |___|   |___|   |___|
//
//          |------------------------
//  ________|
//
//          |-------|
//  ________|       |________________
//
//==============================================================================

module one_shot 
(
 //INPUT PORT
 sys_rst_b,
 clk_in,
 d,
 // OUTPUT PORT
 q
);

////////////////////////////////////////////// 
//
// INPUT AND OUTPUT DECLARATION             //
//
//////////////////////////////////////////////

input  sys_rst_b;
input  clk_in;
input  d;

output q;

/////////////////////////////////////////////
//
// WIRE AND REG DECLARATION                //
//
/////////////////////////////////////////////

reg    d_del;

/////////////////////////////////////////////
//  SEQUENCAL LOGIC                        //
/////////////////////////////////////////////

// generate a delay of the input
always @(posedge clk_in or negedge sys_rst_b)
  if (~sys_rst_b) 
      d_del <= 1'b1;
  else
      d_del <= ~d;

assign q = d & d_del;

endmodule

⌨️ 快捷键说明

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