Skip to content

Commit

Permalink
Update PC_MUX.sv
Browse files Browse the repository at this point in the history
  • Loading branch information
QueMona98 authored Apr 24, 2022
1 parent d44aa0b commit a8e27d3
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions PC_MUX.sv
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 04/19/2022 09:22:48 PM
// Design Name:
// Module Name: PC_MUX
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////


module PC_MUX(

);
module PC_MUX(MUX_SEL, MUX_OUT, PC_4, JALR, BRANCH, JAL);

// Options of 0-3, use two bits to select
input [1:0]MUX_SEL;

// Inputs of MUX
input [31:0] PC_4, JALR, BRANCH, JAL;

// Output of MUX going to PC
output logic [31:0]MUX_OUT;

always_comb begin
case (MUX_SEL) //Choices for MUX, dependent on 3 bit input
2'b00: MUX_OUT = PC_4;
2'b01: MUX_OUT = JALR;
2'b10: MUX_OUT = BRANCH;
2'b11: MUX_OUT = JAL;
default: MUX_OUT = 16'hDEAD; //Default case is a large value,
//Helps when it comes to debugging code

endcase
end

endmodule

0 comments on commit a8e27d3

Please sign in to comment.