-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimeParameter.v
More file actions
45 lines (33 loc) · 911 Bytes
/
TimeParameter.v
File metadata and controls
45 lines (33 loc) · 911 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
41
42
43
44
45
`timescale 1ns / 1ps
module TimeParameter(
input [1:0] Selector,
input [3:0] Time_value,
input Prog_Sync,
input [1:0] interval,
input clk,
output reg [3:0] value
);
reg[3:0] tbase = 4'b0110, // interval value = 00
textended = 4'b0011, // interval value = 01
tyellow = 4'b0010; // interval value = 10
always@(posedge clk) begin
case (interval)
2'b00: value = tbase;
2'b01: value = textended;
2'b10: value = tyellow;
2'b11: value = 2*tbase;
endcase
if (Prog_Sync) begin
case (Selector)
2'b00: begin
tbase = 4'b0110; // interval value = 00
textended = 4'b0011; // interval value = 01
tyellow = 4'b0010; // interval value = 10
end
2'b01: tbase = Time_value;
2'b10: textended = Time_value;
2'b11: tyellow = Time_value;
endcase
end
end
endmodule