From 11508800cfaefc1c25a793760bf10d3fd997af80 Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Wed, 14 May 2025 19:16:38 +0300 Subject: Initial and probably final commit --- 1-b.v | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 1-b.v (limited to '1-b.v') diff --git a/1-b.v b/1-b.v new file mode 100644 index 0000000..f4aa486 --- /dev/null +++ b/1-b.v @@ -0,0 +1,36 @@ +module mux64_4_2(y0, y1, y2, y3, x, z); + input wire [63:0] y0, y1, y2, y3; + input wire [1:0] x; + output wire [63:0] z; + wire [63:0] mx0, mx1, mx2, mx3[63:0] ; + genvar i; + generate for(i = 0; i < 64; i = i + 1) + begin: gen + and(mx0[i], y0[i], ~x[0], ~x[1]); + and(mx1[i], y1[i], ~x[0], x[1]); + and(mx2[i], y2[i], x[0], ~x[1]); + and(mx3[i], y3[i], x[0], x[1]); + or(z[i], mx0[i], mx1[i], mx2[i], mx3[i]); + end; + endgenerate; +endmodule; + +/* +module test; + reg [63:0] a1, a2, a3, a4; + reg [2:0] muxselect; + wire [63:0] out; + mux64_4_2 mux(a1, a2, a3, a4, muxselect[1:0], out); + initial begin; + a1 = 69; + a2 = 420; + a3 = 727; + a4 = 1488; + for (muxselect = 2'b00; muxselect <= 2'b11; muxselect += 1) begin + #10; + $display("current thingy: %d", out); + end; + end; +endmodule; +*/ + -- cgit v1.2.3-70-g09d2