-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathf3_with_50dt.v
More file actions
40 lines (35 loc) · 775 Bytes
/
Copy pathf3_with_50dt.v
File metadata and controls
40 lines (35 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
`timescale 1ns / 1ps
module f3_with_50dt(
input clk,rst,enb,output f3_with_50dt
);
reg [1:0] counter;
reg enb1,enb2;
always@(posedge clk)
begin
if(rst)
begin
counter <= 0;
enb1 <= 0;
enb2 <= 0;
end
else if(enb && counter == 2)
counter <= 0;
else if(enb && counter < 2)
counter <= counter + 1'b1;
end
always@(posedge clk)
begin
if(counter == 0)
enb1 <= 1'b1;
else
enb1 <= 1'b0;
end
always@(negedge clk)
begin
if(counter == 0)
enb2 <= 1'b1;
else
enb2 <= 1'b0;
end
assign f3_with_50dt = enb1 | enb2;
endmodule