blob: 86737075aa8e53689fc2108223f24338df681cfb [file] [log] [blame]
hamzashabbir5176d4d1bc2022-05-21 10:17:36 +05001module FPU_LZD_mux (in_pos_1, in_val_1, in_pos_2, in_val_2, out_pos, out_val);
2
3//Position of MSB set will be termed as P2
4//Position of LSB set will be termed as P1
5
6parameter layer = 1;
7
8input [layer-1 : 0] in_pos_1, in_pos_2;
9input in_val_1, in_val_2;
10
11output [layer : 0]out_pos;
12output out_val;
13
14assign out_val = in_val_1 | in_val_2;
15assign out_pos = in_val_2 ? {!in_val_2, in_pos_2} : {!in_val_2, in_pos_1} ;
16
17endmodule