-
Notifications
You must be signed in to change notification settings - Fork 0
/
Input_2_32bit.v
130 lines (124 loc) · 2.44 KB
/
Input_2_32bit.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995-2013 Xilinx, Inc. All rights reserved.
////////////////////////////////////////////////////////////////////////////////
// ____ ____
// / /\/ /
// /___/ \ / Vendor: Xilinx
// \ \ \/ Version : 14.7
// \ \ Application :
// / / Filename : xil_5396_29
// /___/ /\ Timestamp : 11/11/2014 18:33:02
// \ \ / \
// \___\/\___\
//
//Command:
//Design Name:
//
`timescale 1ns / 1ps
module Input_2_32bit(disp_ctr,
push_out,
Ai,
Bi,
blinke,
state);
input [4:0] disp_ctr;
input [2:0] push_out;
output reg [31:0] Ai=32'h87654321;
output reg [31:0] Bi=32'h12345678;
output reg [3:0] blinke;
output reg [1:0] state = 01;
always @(posedge push_out[0]) //ÒÆλ
begin
if(disp_ctr[4:2] <= 3'b001)
if(!push_out[1])
state <= state-1;
else state <= state+1;
else state <= state;
end
always
if(disp_ctr[4:2]<3'b010) //ÉÁ˸
case(state[1:0])
2'b00: blinke<=4'b0001;
2'b01: blinke<=4'b0010;
2'b10: blinke<=4'b0100;
2'b11: blinke<=4'b1000;
endcase
else blinke<=4'b0000;
always @(posedge push_out[2]) //Ôö¼õ
begin
if(disp_ctr[4:2] == 3'b000)
begin
case({disp_ctr[1], state})
3'b000:
begin
Ai[3:0] <= Ai[3:0]+1;
end
3'b001:
begin
Ai[7:4] <= Ai[7:4]+1;
end
3'b010:
begin
Ai[11:8] <= Ai[11:8]+1;
end
3'b011:
begin
Ai[15:12] <= Ai[15:12]+1;
end
3'b100:
begin
Ai[19:16] <= Ai[19:16]+1;
end
3'b101:
begin
Ai[23:20] <= Ai[23:20]+1;
end
3'b110:
begin
Ai[27:24] <= Ai[27:24]+1;
end
3'b111:
begin
Ai[31:28] <= Ai[31:28]+1;
end
endcase
end
else if(disp_ctr[4:2]==3'b001)
begin
case({disp_ctr[1], state})
3'b000:
begin
Bi[3:0] <= Bi[3:0]+1;
end
3'b001:
begin
Bi[7:4] <= Bi[7:4]+1;
end
3'b010:
begin
Bi[11:8] <= Bi[11:8]+1;
end
3'b011:
begin
Bi[15:12] <= Bi[15:12]+1;
end
3'b100:
begin
Bi[19:16] <= Bi[19:16]+1;
end
3'b101:
begin
Bi[23:20] <= Bi[23:20]+1;
end
3'b110:
begin
Bi[27:24] <= Bi[27:24]+1;
end
3'b111:
begin
Bi[31:28] <= Bi[31:28]+1;
end
endcase
end
end
endmodule