给人做网站的哪个推广平台效果好

目录
0x00 RS 触发器(RS Flip-Flop)
0x01 实现 RS 触发器
0x02 使用 NOR 的 RS 触发器
0x03 使用 NAND 的 RS 触发器
0x00 RS 触发器(RS Flip-Flop)
触发器(Flip-Flop)是一种带有时钟的二进制存储设备,用于存储 0 和 1 的值。只有在时钟信号的边沿转换时,存储的 0 或 1 的值才会改变。
从 1 到 0 的转换称为下降沿触发,而从 0 到 1 的转换称为上升沿触发。触发器中存储的值在触发器的输入数据和先前存储的数据值的影响下完成这些转换。
S(设置)输入会导致触发器在下一个有效时钟沿存储一个 1,而 R(复位)输入会导致触发器存储一个 0。如果 S 和 R 的值同时为 0,则触发器保持当前状态;如果两者同时为 1,则被视为非法输入。
|   行为表  | |
|   
  |   
  | 
|   状态图  | |
|   
  | |
|   Timing Diagram  | |
|   
  | |
|   Circuit  | |
|   
  | |
0x01 实现 RS 触发器

真值表:
|   Input  |   Output  | |||
|   입력 순서  |   R  |   S  |   Q  |   ~Q  | 
|   1  |   0  |   1  |   1  |   0  | 
|   2  |   0  |   0  |   1  |   0  | 
|   3  |   1  |   0  |   0  |   1  | 
|   4  |   0  |   0  |   0  |   1  | 
|   5  |   1  |   0  |   0  |   1  | 
|   6  |   1  |   1  |   X  |   X  | 
0x02 使用 NOR 的 RS 触发器
💬 Design source:
`timescale 1ns / 1psmodule RSFF (input clk,input S,input R,input CLR,output Q,output Qp
);reg Q;// falling edge triggered
always @(posedge !clk) beginif(CLR) Q<=1'b0;else beginif ( (S == 1'b0) && (R == 1'b0) ) Q <= Q;else if ( (S == 1'b0) && (R == 1'b1)) Q <= 1'b0;else if ( (S == 1'b1) && (R == 1'b0)) Q <= 1'b1;else if ( (S == 1'b1) && (R == 1'b1)) Q <= 1'bx;end
endassign Qp = ~Q;endmodule 
💬 Testbench:
`timescale 1ns / 1psmodule RSFF_tb;
reg clk, S, R, CLR;
wire Q, Qp;RSFF u_RSFF(.clk(clk ),.S(S ),.R(R ),.CLR(CLR ),.Q(Q ),.Qp(Qp ) 
);initial clk = 1'b0;
initial CLR = 1'b1;
initial S = 1'b0;
initial R = 1'b0;always clk = #50 ~clk;always@(CLR) beginCLR = #125 ~CLR;
endalways@(S) beginS = #175 ~S;S = #50 ~S;
endalways@(R) beginR = #375 ~R;R = #50 ~R;
endalways@(R) beginR = #575 ~R;R = #50 ~R;
endalways@(S) beginS = #675 ~S;S = #50 ~S;
endalways@(R) beginR = #675 ~R;R = #50 ~R;
endinitial begin#800$finish;
endendmodule 
Schematic:

🚩 运行结果如下:

0x03 使用 NAND 的 RS 触发器
💬 Design source:
`timescale 1ns / 1psmodule RSFF (input clk,input S,input R,input CLR,output Q,output Qp
);reg Q;// falling edge triggered
always @(posedge !clk) beginif (CLR) Q << 1`b0;else beginQ <= ~(~(S & (~clk)) & Qp);Qp <= ~(~(R & (~cls)) & Q);end
endassign Qp = ~Q;endmodule 
Schematic:

🚩 运行结果如下:


📌 [ 笔者 ]   王亦优
📃 [ 更新 ]   2022.11.19
❌ [ 勘误 ]   /* 暂无 */
📜 [ 声明 ]   由于作者水平有限,本文有错误和不准确之处在所难免,本人也很想知道这些错误,恳望读者批评指正! 
|   📜 参考资料 Introduction to Logic and Computer Design, Alan Marcovitz, McGrawHill, 2008 Microsoft. MSDN(Microsoft Developer Network)[EB/OL]. []. . 百度百科[EB/OL]. []. https://baike.baidu.com/.  | 





