【HDLbits|Circuits--Sequential Logic--Latches and Flip-Flops--Edgecapture】网址:https://hdlbits.01xz.net/wiki/Edgecapture
module top_module (
input clk,
input reset,
input [31:0] in,
output [31:0] out
);
reg [31:0] r_in;
always@(posedge clk)
begin
r_in = in;
endalways@(posedge clk)begin
if(reset)begin
out <= 32'd0;
end
else begin
out <= ~in & r_in | out;
end
endendmodule
推荐阅读
- HDLbits|Circuits--Sequential Logic--Latches and Flip-Flops--Dualedge
- HDLbits|Circuits--Sequential Logic--Shift Registers--Lfsr32
- HDLbits|Circuits--Sequential Logic--Latches and Flip-Flops--Exams/2014 q4a
- HDLbits|Circuits--Sequential Logic--Latches and Flip-Flops--Edgedetect2
- FPGA|基于FPGA(多目标运动检测(手把手教学①))
- 服务器|【SOC】经典输出hello world
- Verilog|if-else(if判断语句和执行语句之间相差1个时钟周期吗(并行执行吗?有优先级吗?))
- FPGA|Xilinx FPGA 使用Microblaze实现串口命令行
- #|【数字IC】深入浅出理解AXI协议