-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStrobeController.v
executable file
·67 lines (60 loc) · 1.58 KB
/
StrobeController.v
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 11/03/2015 03:27:03 PM
// Design Name:
// Module Name: StrobeController
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module StrobeController(
input CLK10HZ,
input FLAG,
output STROBE_CONTROL
);
reg[23:0] COUNTER;
reg STROBE_CONTROL;
reg INTERNAL_FLAG = 1'b0;
reg INTERNAL_COUNTER = 1'b0;
always @ (posedge CLK10HZ)
begin
case (FLAG)
1'b0:
begin
if (COUNTER == 24'd1000000000)
begin
INTERNAL_COUNTER <= 1'b0;
STROBE_CONTROL = 1'b0;
COUNTER = 24'd1;
end
else
begin
COUNTER = COUNTER + 24'd1;
end
end
1'b1:
begin
if (INTERNAL_COUNTER == 1'b1)
begin
end
else
begin
COUNTER <= 24'd1;
STROBE_CONTROL <= 1'b1;
INTERNAL_COUNTER <= 1'b1;
end
end
endcase
end
endmodule