nand2/01_Boolean_Logic/Or8Way.v

29 lines
487 B
Verilog

/**
* 8-way Or:
* out = (in[0] or in[1] or ... or in[7])
*/
`default_nettype none
module Or8Way(
input [7:0] in,
output out
);
// Put your code here:
wire outA;
wire outB;
wire outC;
wire outD;
wire outE;
wire outF;
Or OR0(in[0], in[1], outA);
Or OR2(in[2], outA, outB);
Or OR3(in[3], outB, outC);
Or OR4(in[4], outC, outD);
Or OR5(in[5], outD, outE);
Or OR6(in[6], outE, outF);
Or OR7(in[7], outF, out);
endmodule