diff --git a/lab2CA.srcs/sim_1/new/ALU.v b/lab2CA.srcs/sim_1/new/ALU.v new file mode 100644 index 0000000..95e2828 --- /dev/null +++ b/lab2CA.srcs/sim_1/new/ALU.v @@ -0,0 +1,40 @@ +`timescale 1ns / 1ps + +module ALU( + input wire [8:0] instruction, + output wire [8:0] result + ); + + // Wires for connecting the modules to the mux + wire [8:0] A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P; + + // Please place modules in order of OPCODE, to make them easier to find + + + + + + + + // MUX chooses which result to show based on the OPCODE + mux_16_1 mux_result( + .switch(instruction[8:5]), + .A(A), + .B(B), + .C(C), + .D(D), + .E(E), + .F(F), + .G(G), + .H(H), + .I(I), + .J(J), + .K(K), + .L(L), + .M(M), + .N(N), + .O(O), + .P(P), + .out(result)); + +endmodule diff --git a/lab2CA.xpr b/lab2CA.xpr index c1369d1..917a245 100644 --- a/lab2CA.xpr +++ b/lab2CA.xpr @@ -3,7 +3,7 @@ - +