-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmux.v
39 lines (36 loc) · 1.01 KB
/
mux.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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: Santa Clara University
// Engineer: Jonathan Trinh
//
// Create Date: 01/08/2019 02:21:28 PM
// Design Name:
// Module Name: mux
// Project Name: COEN122_project_1
// Target Devices:
// Tool Versions:
// Description: This module defines a 4:1 mux select
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module mux(
A, B, C, D, sel, out
);
input [31:0] A, B, C, D; // define inputs
input [1:0] sel;
output reg [31:0] out; // define output
always @(*) // define combinational logic
begin
case(sel) // depending on what select is, we change the output so we use case statement
2'b00: out = A;
2'b01: out = B;
2'b10: out = C;
2'b11: out = D;
endcase
end
endmodule