`include "wally-config.vh" // FOpCtrlE values // 111 min // 101 max // 010 equal // 001 less than // 011 less than or equal module fcmp ( input logic FmtE, // precision 1 = double 0 = single input logic [2:0] FOpCtrlE, // see above table input logic XSgnE, YSgnE, // input signs input logic [`NE-1:0] XExpE, YExpE, // input exponents input logic [`NF:0] XManE, YManE, // input mantissa input logic XZeroE, YZeroE, // is zero input logic XNaNE, YNaNE, // is NaN input logic XSNaNE, YSNaNE, // is signaling NaN input logic [`FLEN-1:0] FSrcXE, FSrcYE, // original, non-converted to double, inputs output logic CmpNVE, // invalid flag output logic [`FLEN-1:0] CmpResE // compare resilt ); logic LT, EQ; // is X < or > or = Y // X is less than Y: // Signs: // X Y answer // pos pos idk - keep checking // pos neg no // neg pos yes // neg neg idk - keep checking // Exponent // - if XExp < YExp // - if negitive - no // - if positive - yes // - otherwise keep checking // Mantissa // - XMan < YMan then // - if negitive - no // - if positive - yes // note: LT does -0 < 0 assign LT = XSgnE^YSgnE ? XSgnE : XExpE==YExpE ? ((XManE