12 // A NaN gate! Computes `Inf - max(x+y, -Inf)`.
13 // See http://tom7.org/nand/
16 input [2:0] B, output reg [2:0] Y
21 {`ANYF, `ANAN}, {`ANAN, `ANYF}: Y = `PINF;
22 {`PINF, `NINF}, {`NINF, `PINF}: Y = `PINF;
23 {`ANYF, `PINF}, {`PINF, `ANYF}: Y = `PNAN;
29 // Convert a bit into an fp3
30 module bit_to_fp3(input A, output [2:0] Y);
31 assign Y = A ? `PNAN : `PINF;
34 // Convert an fp3 into a bit
35 module fp3_to_bit(input [2:0] A, output reg Y);
38 `PNAN, `NNAN: Y = 1'b1;