OpenCores
URL https://opencores.org/ocsvn/iso7816_3_master/iso7816_3_master/trunk

Subversion Repositories iso7816_3_master

[/] [iso7816_3_master/] [trunk/] [test/] [FiDiAnalyzer.v] - Blame information for rev 5

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 acapola
`timescale 1ns / 1ps
2
`default_nettype none
3
 
4
module FiDiAnalyzer(
5
        input wire [3:0] fiCode,
6
        input wire [3:0] diCode,
7
        output wire [12:0] fi,
8
        output wire [7:0] di,
9
        output wire [12:0] cyclesPerEtu, //truncate values to 'floor' integer value
10
        output wire [7:0] fMax                           //in 0.1MHz units
11
        );
12
 
13
wire [13+8] fiStuff;
14
assign {fi,fMax} = fiStuff;
15
always @(*) begin:fiBlock
16
        case(fiCode)
17
                4'b0000: fiStuff = {12'd0372,8'd040};
18
                4'b0001: fiStuff = {12'd0372,8'd050};
19
                4'b0010: fiStuff = {12'd0372,8'd060};
20
                4'b0011: fiStuff = {12'd0372,8'd080};
21
                4'b0100: fiStuff = {12'd0372,8'd120};
22
                4'b0101: fiStuff = {12'd0372,8'd160};
23
                4'b0110: fiStuff = {12'd0372,8'd200};
24
                4'b0111: fiStuff = {12'd0000,8'd000};
25
                4'b1000: fiStuff = {12'd0000,8'd000};
26
                4'b1001: fiStuff = {12'd0372,8'd050};
27
                4'b1010: fiStuff = {12'd0372,8'd075};
28
                4'b1011: fiStuff = {12'd0372,8'd100};
29
                4'b1100: fiStuff = {12'd0372,8'd150};
30
                4'b1101: fiStuff = {12'd0372,8'd200};
31
                4'b1110: fiStuff = {12'd0000,8'd000};
32
                4'b1111: fiStuff = {12'd0000,8'd000};
33
        endcase
34
end
35
 
36
always @(*) begin:diBlock
37
        case(diCode)
38
                4'b0000: di = 0;
39
                4'b0001: di = 1;
40
                4'b0010: di = 2;
41
                4'b0011: di = 4;
42
                4'b0100: di = 8;
43
                4'b0101: di = 16;
44
                4'b0110: di = 32;
45
                4'b0111: di = 64;
46
                4'b1000: di = 0;
47
                4'b1001: di = 12;
48
                4'b1010: di = 20;
49
                4'b1011: di = 0;
50
                4'b1100: di = 0;
51
                4'b1101: di = 0;
52
                4'b1110: di = 0;
53
                4'b1111: di = 0;
54
        endcase
55
end
56
 
57
always @(*) begin:cyclesPerEtuBlock
58
        case({fiCode,diCode})
59
                8'h01: cyclesPerEtu = 372/1;
60
                8'h02: cyclesPerEtu = 372/2;
61
                8'h03: cyclesPerEtu = 372/4;
62
                8'h04: cyclesPerEtu = 372/8;
63
                8'h05: cyclesPerEtu = 372/16;
64
                8'h06: cyclesPerEtu = 372/32;
65
                8'h07: cyclesPerEtu = 372/64;
66
                8'h09: cyclesPerEtu = 372/12;
67
                8'h0A: cyclesPerEtu = 372/20;
68
 
69
                8'h11: cyclesPerEtu = 372/1;
70
                8'h12: cyclesPerEtu = 372/2;
71
                8'h13: cyclesPerEtu = 372/4;
72
                8'h14: cyclesPerEtu = 372/8;
73
                8'h15: cyclesPerEtu = 372/16;
74
                8'h16: cyclesPerEtu = 372/32;
75
                8'h17: cyclesPerEtu = 372/64;
76
                8'h19: cyclesPerEtu = 372/12;
77
                8'h1A: cyclesPerEtu = 372/20;
78
 
79
                8'h21: cyclesPerEtu = 558/1;
80
                8'h22: cyclesPerEtu = 558/2;
81
                8'h23: cyclesPerEtu = 558/4;
82
                8'h24: cyclesPerEtu = 558/8;
83
                8'h25: cyclesPerEtu = 558/16;
84
                8'h26: cyclesPerEtu = 558/32;
85
                8'h27: cyclesPerEtu = 558/64;
86
                8'h29: cyclesPerEtu = 558/12;
87
                8'h2A: cyclesPerEtu = 558/20;
88
 
89
                8'h31: cyclesPerEtu = 744/1;
90
                8'h32: cyclesPerEtu = 744/2;
91
                8'h33: cyclesPerEtu = 744/4;
92
                8'h34: cyclesPerEtu = 744/8;
93
                8'h35: cyclesPerEtu = 744/16;
94
                8'h36: cyclesPerEtu = 744/32;
95
                8'h37: cyclesPerEtu = 744/64;
96
                8'h39: cyclesPerEtu = 744/12;
97
                8'h3A: cyclesPerEtu = 744/20;
98
 
99
                8'h41: cyclesPerEtu = 1116/1;
100
                8'h42: cyclesPerEtu = 1116/2;
101
                8'h43: cyclesPerEtu = 1116/4;
102
                8'h44: cyclesPerEtu = 1116/8;
103
                8'h45: cyclesPerEtu = 1116/16;
104
                8'h46: cyclesPerEtu = 1116/32;
105
                8'h47: cyclesPerEtu = 1116/64;
106
                8'h49: cyclesPerEtu = 1116/12;
107
                8'h4A: cyclesPerEtu = 1116/20;
108
 
109
                8'h51: cyclesPerEtu = 1488/1;
110
                8'h52: cyclesPerEtu = 1488/2;
111
                8'h53: cyclesPerEtu = 1488/4;
112
                8'h54: cyclesPerEtu = 1488/8;
113
                8'h55: cyclesPerEtu = 1488/16;
114
                8'h56: cyclesPerEtu = 1488/32;
115
                8'h57: cyclesPerEtu = 1488/64;
116
                8'h59: cyclesPerEtu = 1488/12;
117
                8'h5A: cyclesPerEtu = 1488/20;
118
 
119
                8'h61: cyclesPerEtu = 1860/1;
120
                8'h62: cyclesPerEtu = 1860/2;
121
                8'h63: cyclesPerEtu = 1860/4;
122
                8'h64: cyclesPerEtu = 1860/8;
123
                8'h65: cyclesPerEtu = 1860/16;
124
                8'h66: cyclesPerEtu = 1860/32;
125
                8'h67: cyclesPerEtu = 1860/64;
126
                8'h69: cyclesPerEtu = 1860/12;
127
                8'h6A: cyclesPerEtu = 1860/20;
128
 
129
                8'h91: cyclesPerEtu = 512/1;
130
                8'h92: cyclesPerEtu = 512/2;
131
                8'h93: cyclesPerEtu = 512/4;
132
                8'h94: cyclesPerEtu = 512/8;
133
                8'h95: cyclesPerEtu = 512/16;
134
                8'h96: cyclesPerEtu = 512/32;
135
                8'h97: cyclesPerEtu = 512/64;
136
                8'h99: cyclesPerEtu = 512/12;
137
                8'h9A: cyclesPerEtu = 512/20;
138
 
139
                8'hA1: cyclesPerEtu = 768/1;
140
                8'hA2: cyclesPerEtu = 768/2;
141
                8'hA3: cyclesPerEtu = 768/4;
142
                8'hA4: cyclesPerEtu = 768/8;
143
                8'hA5: cyclesPerEtu = 768/16;
144
                8'hA6: cyclesPerEtu = 768/32;
145
                8'hA7: cyclesPerEtu = 768/64;
146
                8'hA9: cyclesPerEtu = 768/12;
147
                8'hAA: cyclesPerEtu = 768/20;
148
 
149
                8'hB1: cyclesPerEtu = 1024/1;
150
                8'hB2: cyclesPerEtu = 1024/2;
151
                8'hB3: cyclesPerEtu = 1024/4;
152
                8'hB4: cyclesPerEtu = 1024/8;
153
                8'hB5: cyclesPerEtu = 1024/16;
154
                8'hB6: cyclesPerEtu = 1024/32;
155
                8'hB7: cyclesPerEtu = 1024/64;
156
                8'hB9: cyclesPerEtu = 1024/12;
157
                8'hBA: cyclesPerEtu = 1024/20;
158
 
159
                8'hC1: cyclesPerEtu = 1536/1;
160
                8'hC2: cyclesPerEtu = 1536/2;
161
                8'hC3: cyclesPerEtu = 1536/4;
162
                8'hC4: cyclesPerEtu = 1536/8;
163
                8'hC5: cyclesPerEtu = 1536/16;
164
                8'hC6: cyclesPerEtu = 1536/32;
165
                8'hC7: cyclesPerEtu = 1536/64;
166
                8'hC9: cyclesPerEtu = 1536/12;
167
                8'hCA: cyclesPerEtu = 1536/20;
168
 
169
                8'hD1: cyclesPerEtu = 2048/1;
170
                8'hD2: cyclesPerEtu = 2048/2;
171
                8'hD3: cyclesPerEtu = 2048/4;
172
                8'hD4: cyclesPerEtu = 2048/8;
173
                8'hD5: cyclesPerEtu = 2048/16;
174
                8'hD6: cyclesPerEtu = 2048/32;
175
                8'hD7: cyclesPerEtu = 2048/64;
176
                8'hD9: cyclesPerEtu = 2048/12;
177
                8'hDA: cyclesPerEtu = 2048/20;
178
 
179
                default: cyclesPerEtu = 0;//RFU
180
        endcase
181
end
182
 
183
endmodule
184
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.