Moved ALU from simulation sources to design sources
This commit is contained in:
40
lab2CA.srcs/sources_1/new/ALU.v
Normal file
40
lab2CA.srcs/sources_1/new/ALU.v
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user