S
Sreya39
Guest
Hei,
Jeg ønsker å finne variansen 20 nummer .... For det første jeg nødt til å finne summen av 20 nos .....Jeg har gitt min Verilog koden nedenfor.Det er ingen syntese feil .... men jeg får ikke summen .....Betyr det fungerer hvis biblioteket fil (aritmetikk) er inkludert ...
I så fall hvordan å inkludere biblioteket fungere.
Eller det anyother måte å løse dette problemet ....
hjelpe meg behage ...
Takk og hilsen
Remya: |
<img src="http://www.edaboard.com/images/smiles/icon_neutral.gif" alt="Nøytral" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_neutral.gif" alt="Nøytral" border="0" />modul meansum (klokke, Enable, corrouti1, corrouti2, corrouti3, corrouti4, corrouti5, corrouti6, corrouti7,
corrouti8, corrouti9, corrouti10, corrouti11, corrouti12, corrouti13, corrouti14, corrouti15,
corrouti16, corrouti17, corrouti18, corrouti19, corrouti20, sum);
input clock, Aktiver;
input [9:0] corrouti1, corrouti2, corrouti3, corrouti4, corrouti5, corrouti6, corrouti7,
corrouti8, corrouti9, corrouti10, corrouti11, corrouti12, corrouti13, corrouti14, corrouti15,
corrouti16, corrouti17, corrouti18, corrouti19, corrouti20;
output [9:0] sum;
reg [14:0] sum;
innledende sum = 0;
reg [9:0] R1 [0:19];
heltall i;
alltid @ (posedge klokke) begin
if (Aktiver)
r1 [0] = corrouti1;
r1 [1] = corrouti2;
r1 [2] = corrouti3;
r1 [3] = corrouti4;
r1 [4] = corrouti5;
r1 [5] = corrouti6;
r1 [6] = corrouti7;
r1 [7] = corrouti8;
r1 [8] = corrouti9;
r1 [9] = corrouti10;
r1 [10] = corrouti11;
r1 [11] = corrouti12;
r1 [12] = corrouti13;
r1 [13] = corrouti14;
r1 [14] = corrouti15;
r1 [15] = corrouti16;
r1 [16] = corrouti17;
r1 [17] = corrouti18;
r1 [18] = corrouti19;
r1 [19] = corrouti20;
slutt
alltid @ (posedge klokke) begin
i = 0;
while (i <20) begynne
tildele sum = sum r1 ;
i = i 1;
slutt
slutt
endmodule
Jeg ønsker å finne variansen 20 nummer .... For det første jeg nødt til å finne summen av 20 nos .....Jeg har gitt min Verilog koden nedenfor.Det er ingen syntese feil .... men jeg får ikke summen .....Betyr det fungerer hvis biblioteket fil (aritmetikk) er inkludert ...
I så fall hvordan å inkludere biblioteket fungere.
Eller det anyother måte å løse dette problemet ....
hjelpe meg behage ...
Takk og hilsen
Remya: |
<img src="http://www.edaboard.com/images/smiles/icon_neutral.gif" alt="Nøytral" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_neutral.gif" alt="Nøytral" border="0" />modul meansum (klokke, Enable, corrouti1, corrouti2, corrouti3, corrouti4, corrouti5, corrouti6, corrouti7,
corrouti8, corrouti9, corrouti10, corrouti11, corrouti12, corrouti13, corrouti14, corrouti15,
corrouti16, corrouti17, corrouti18, corrouti19, corrouti20, sum);
input clock, Aktiver;
input [9:0] corrouti1, corrouti2, corrouti3, corrouti4, corrouti5, corrouti6, corrouti7,
corrouti8, corrouti9, corrouti10, corrouti11, corrouti12, corrouti13, corrouti14, corrouti15,
corrouti16, corrouti17, corrouti18, corrouti19, corrouti20;
output [9:0] sum;
reg [14:0] sum;
innledende sum = 0;
reg [9:0] R1 [0:19];
heltall i;
alltid @ (posedge klokke) begin
if (Aktiver)
r1 [0] = corrouti1;
r1 [1] = corrouti2;
r1 [2] = corrouti3;
r1 [3] = corrouti4;
r1 [4] = corrouti5;
r1 [5] = corrouti6;
r1 [6] = corrouti7;
r1 [7] = corrouti8;
r1 [8] = corrouti9;
r1 [9] = corrouti10;
r1 [10] = corrouti11;
r1 [11] = corrouti12;
r1 [12] = corrouti13;
r1 [13] = corrouti14;
r1 [14] = corrouti15;
r1 [15] = corrouti16;
r1 [16] = corrouti17;
r1 [17] = corrouti18;
r1 [18] = corrouti19;
r1 [19] = corrouti20;
slutt
alltid @ (posedge klokke) begin
i = 0;
while (i <20) begynne
tildele sum = sum r1 ;
i = i 1;
slutt
slutt
endmodule