aboutsummaryrefslogtreecommitdiff
path: root/src/alu_a_src_mux.v
blob: b51dd5bedfab8b5fb543cf4bdb18eca5353d2eaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module alu_a_src_mux (
  input [31:0] src_pc, 
  input [31:0] src_pc_buf, 
  input [31:0] src_rd1_buf,

  input [1:0] alu_a_src,

  output reg [31:0] alu_a
);

always @(*) begin
  case (alu_a_src)
    2'b00:   alu_a <= src_pc;
    2'b01:   alu_a <= src_pc_buf;
    2'b10:   alu_a <= src_rd1_buf;
    default: alu_a <= 32'b0;
  endcase
end

endmodule