aboutsummaryrefslogtreecommitdiff
path: root/src/result_mux.v
blob: 047a392c7097f90cc7bbba59ef996d813a4c67db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module result_mux (
  input [31:0] src_alu_result_buf, 
  input [31:0] src_alu_result, 
  input [31:0] src_data_buf,

  input [1:0] result_src,
  
  output reg [31:0] result
);

always @(*) begin
  case (result_src)
    2'b00:   result <= src_alu_result_buf;
    2'b01:   result <= src_data_buf;
    2'b10:   result <= src_alu_result;
    default: result <= 32'b0;
  endcase
end

endmodule