-
Notifications
You must be signed in to change notification settings - Fork 0
/
light_count.v
52 lines (46 loc) · 1.59 KB
/
light_count.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
// +FHDR------------------------------------------------------------------------
// FILE NAME : light_count.v
// DEPARTMENT : Personal Use
// AUTHOR : Ryan Thompson
// AUTHOR’S EMAIL : [email protected]
// -----------------------------------------------------------------------------
// RELEASE HISTORY
// VERSION DATE AUTHOR DESCRIPTION
// 1.0 10-19-2019 Ryan Thompson Engineering Student
// -----------------------------------------------------------------------------
// KEYWORDS : 8bit counter, light, LEDs
// -----------------------------------------------------------------------------
// PURPOSE : An eight bit counter for the MAX1000 LEDs.
// -----------------------------------------------------------------------------
// PARAMETERS
// PARAM NAME RANGE : DESCRIPTION : DEFAULT : UNITS
// f [7,0] : second counter : 0 : Seconds past in binary
// x1 [0] : arbitrary input : clk : Hz
// -----------------------------------------------------------------------------
// REUSE ISSUES
// Reset Strategy : Async
// Clock Domains : 12MHz
// Critical Timing :
// Test Features :
// Asynchronous I/F :
// Scan Methodology :
// Instantiations :
// Synthesizable (y/n) : y
// Other :
// -FHDR------------------------------------------------------------------------
module light_count(
f,
x1,
reset
);
output[7:0] f; // LED Output
input x1; // clock_in
input reset;
reg[7:0] f;
always @( negedge x1 or posedge reset ) begin
if( reset )
f <= 0;
else
f <= f + 1; // increment counter
end
endmodule