Atelier des rouesLab FR
Objects/Documentation

etages.v

I read the six bits in pairs through three lookup stages.

Download ↓
module radix4step(input [2:0] r, input [1:0] d, output [2:0] y);
    wire [2:0] transition [0:31];
    genvar j;
    generate for (j=0; j<32; j=j+1) begin: line
        assign transition[j] = (j/4 < 5) ? j%5 : j/4;
    end endgenerate
    assign y = transition[{r,d}];
endmodule

module staged6(input [2:0] r, input [5:0] b, output [2:0] y);
    wire [2:0] a, c;
    radix4step first(r,b[5:4],a);
    radix4step second(a,b[3:2],c);
    radix4step third(c,b[1:0],y);
endmodule

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.