Created
May 12, 2019 16:03
-
-
Save Shashi18/d052dc9a4682e8ec28c3e2e6f83a4bd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MUX3(a,b,sel,c); | |
input [7:0] a,b; | |
input sel; | |
output reg [7:0]c; | |
always @(*)begin | |
if(sel==0) | |
c = a; | |
else | |
c = b; | |
end | |
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module WB(mux3_select, mem_data, alu_result, mux1_in, W_data, W_add | |
); | |
input mux3_select; | |
input [3:0]mux1_in; | |
input [7:0] mem_data; | |
input [7:0] alu_result; | |
output [7:0]W_data; | |
output [3:0]W_add; | |
assign W_add = mux1_in; | |
MUX3 mul1(mem_data, alu_result, mux3_select, W_data); | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment