📄 factor_rom_i.v
字号:
module factor_rom_I
(
clk,
addr,
data
);
input clk;
input [5:0] addr;
output [15:0] data;
reg [15:0] data;
function [15:0] romout;
input [5:0] addr;
// 1位整数,14位小数
case (addr)
0 : romout = 16'h4000;
1 : romout = 16'h3FFB;
2 : romout = 16'h3FEC;
3 : romout = 16'h3FD3;
4 : romout = 16'h3FB1;
5 : romout = 16'h3F84;
6 : romout = 16'h3F4E;
7 : romout = 16'h3F0E;
8 : romout = 16'h3EC5;
9 : romout = 16'h3E71;
10 : romout = 16'h3E14;
11 : romout = 16'h3DAE;
12 : romout = 16'h3D3E;
13 : romout = 16'h3CC5;
14 : romout = 16'h3C42;
15 : romout = 16'h3BB6;
16 : romout = 16'h3B20;
17 : romout = 16'h3A82;
18 : romout = 16'h39DA;
19 : romout = 16'h392A;
20 : romout = 16'h3871;
21 : romout = 16'h37AF;
22 : romout = 16'h36E5;
23 : romout = 16'h3612;
24 : romout = 16'h3536;
25 : romout = 16'h3453;
26 : romout = 16'h3367;
27 : romout = 16'h3274;
28 : romout = 16'h3179;
29 : romout = 16'h3076;
30 : romout = 16'h2F6B;
31 : romout = 16'h2E5A;
32 : romout = 16'h2D41;
33 : romout = 16'h2C21;
34 : romout = 16'h2AFA;
35 : romout = 16'h29CD;
36 : romout = 16'h2899;
37 : romout = 16'h275F;
38 : romout = 16'h261F;
39 : romout = 16'h24DA;
40 : romout = 16'h238E;
41 : romout = 16'h223D;
42 : romout = 16'h20E7;
43 : romout = 16'h1F8B;
44 : romout = 16'h1E2B;
45 : romout = 16'h1CC6;
46 : romout = 16'h1B5D;
47 : romout = 16'h19EF;
48 : romout = 16'h187D;
49 : romout = 16'h1708;
50 : romout = 16'h158F;
51 : romout = 16'h1413;
52 : romout = 16'h1294;
53 : romout = 16'h1111;
54 : romout = 16'h0F8C;
55 : romout = 16'h0E05;
56 : romout = 16'h0C7C;
57 : romout = 16'h0AF1;
58 : romout = 16'h0964;
59 : romout = 16'h07D5;
60 : romout = 16'h0645;
61 : romout = 16'h04B5;
62 : romout = 16'h0323;
63 : romout = 16'h0192;
default : romout = 16'hxxxx;
endcase
endfunction
always @ (posedge clk)
begin
data <= romout(addr);
end
//assign data = romout(addr);
endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -