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

Subversion Repositories priority_encoder

[/] [priority_encoder/] [trunk/] [prio_encoder.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 UA3MQJ
module prio_encoder(in, out);
2
 
3
parameter LINES=128;
4
parameter WIDTH=$clog2(LINES);
5
 
6
input wire [(LINES-1):0] in;
7
output wor [(WIDTH-1):0] out;
8
 
9
genvar gi, gj;
10
generate
11
for(gi = 0; gi < LINES; gi = gi + 1 ) begin : bi_gen
12
        for(gj = 0; gj < WIDTH; gj = gj + 1 ) begin : bj_gen
13
                if (gi[gj]) begin
14
                        assign out[gj] = in[gi];
15
                end
16
        end
17
end
18
endgenerate
19
 
20
endmodule

powered by: WebSVN 2.1.0

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