Loading simulator…
The predefined circuit already contains the required gates, fanout Nodes, inputs, and outputs. Complete the missing connections as follows.
FRAC_NONZERO.Connect FRAC_ZERO and CONST_1 to the XOR gate labeled FRAC_NONZERO.
FRAC_NONZERO = FRAC_ZERO XOR 1
XOR with logic 1 inverts FRAC_ZERO. Therefore:
FRAC_ZERO = 1 → FRAC_NONZERO = 0
FRAC_ZERO = 0 → FRAC_NONZERO = 1
This provides both fraction conditions needed by the class decoder.
Connect EXP_ZERO and EXP_ONES to the OR gate labeled EXP_SPECIAL.
EXP_SPECIAL = EXP_ZERO OR EXP_ONES
EXP_SPECIAL becomes HIGH whenever the exponent is either all zeros or all ones.
Next, connect EXP_SPECIAL and CONST_1 to the XOR gate labeled EXP_NORMAL.
EXP_NORMAL = EXP_SPECIAL XOR 1
This inverts EXP_SPECIAL, so EXP_NORMAL is HIGH only when the exponent is neither all zeros nor all ones. The EXP_NORMAL output is already connected to Normal.
Fan out EXP_ZERO to the CLASS_ZERO and CLASS_SUBNORMAL AND gates.
For CLASS_ZERO, connect FRAC_ZERO to the remaining AND-gate input:
Zero = EXP_ZERO AND FRAC_ZERO
Zero is therefore detected when both the exponent and fraction are zero.
For CLASS_SUBNORMAL, connect FRAC_NONZERO to the remaining input:
Subnormal = EXP_ZERO AND FRAC_NONZERO
A subnormal value therefore has a zero exponent but a nonzero fraction.
Fan out EXP_ONES to the CLASS_INFINITY and CLASS_NAN AND gates.
For CLASS_INFINITY, connect FRAC_ZERO to the remaining input:
Infinity = EXP_ONES AND FRAC_ZERO
Infinity is detected when the exponent is all ones and the fraction is zero.
For CLASS_NAN, connect FRAC_NONZERO to the remaining input:
NaN = EXP_ONES AND FRAC_NONZERO
NaN is detected when the exponent is all ones and the fraction is nonzero.
The completed decoder therefore implements:
Zero = EXP_ZERO AND FRAC_ZERO
Subnormal = EXP_ZERO AND NOT(FRAC_ZERO)
Normal = NOT(EXP_ZERO OR EXP_ONES)
Infinity = EXP_ONES AND FRAC_ZERO
NaN = EXP_ONES AND NOT(FRAC_ZERO)
Because EXP_ZERO and EXP_ONES are mutually exclusive and FRAC_ZERO/FRAC_NONZERO are complementary, exactly one class output is HIGH for every legal input combination.