dp_regmx16.v
1.03 KB
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
/*
*************************************************************************
* *
* Project Reality *
* *
* module: dp_regmx16.v *
* description: 16 bit register with 4 to 1 mux to implement *
* 2 to 1 data mux, reset and clock enable functionalty. *
* If both selects are low or both high then register *
* its old value. *
* *
* The mux cell used is the high performance j_me41 cells.*
* *
* designer: Brian Ferguson *
* date: 3/17/95 *
* *
*************************************************************************
*/
module dp_regmx16 ( clk, reset_l, input0, input1, select, output_data );
input clk;
input reset_l;
input [15:0] input0;
input [15:0] input1;
input [1:0] select;
output [15:0] output_data;
reg [15:0] output_data;
always @(posedge clk)
begin
if(reset_l == 1'b0)
output_data <= 16'd0;
else if (&select)
output_data <= 16'd0;
else if(select[0])
output_data <= input0;
else if(select[1])
output_data <= input1;
end
endmodule // dp_regmx16