-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mux5.v
44 lines (40 loc) · 854 Bytes
/
Mux5.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 10/11/2018 11:35:00 PM
// Design Name:
// Module Name: Mux5
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module Mux5(
input rst,
input RegDst,
input clk,
input [2:0] Rtype,
input [2:0] Itype,
output reg [2:0] WriteReg
);
always @(RegDst or Rtype or Itype or WriteReg or rst)
begin
if (rst) WriteReg <= 0;
else begin
case (RegDst)
1'b0 : WriteReg <= Itype;
1'b1 : WriteReg <= Rtype;
default: WriteReg <= WriteReg;
endcase
end
end
endmodule