Forum Discussion
ALTERA_FP_FUNCTIONS Single Precision Multiplier doesn't seem to support subnormal numbers
- 6 years ago
Yes, I got the problem.
However Altera floating-point IP cores do not support denormal/subnormal number inputs. If the input is a denormal value, the IP core forces the value to zero and treats the value as a zero before going through any operation.
Hence we are seeing output zero.
Regards
Anand
Hi Ahmad,
Check your testbench rest signal. Its is not properly handled and also reset is active high.
without testbench IP works as expected.
Regards
Anand
- ZAhma16 years ago
New Contributor
Hi Anand,
I don't understand what you mean by "reset is not properly handled". The testbench applies an active high reset at the start after which the test begins and reset is pulled low. I see you've done the same thing in your test.
Also if you see the testbench there are three tests. Test 1 is *supposed* to pass. This is the same output in your run and my testbench.
report( lf & "------------------ TEST 1 ------------------------" & lf & " This should pass" ); wait until falling_edge(s_clk); s_a <= X"3fc00000"; -- 1.5 s_b <= X"3fc00000"; -- 1.5 expected_q := X"40100000"; -- 2.25Test 2 and 3 fail with the IP. These are the tests that show the IP doesn't support subnormal numbers. But you don't seem to have run these tests.
report( lf & "------------------ TEST 2 ------------------------" & lf & " Multiply subnormal number to a regular number" & lf & " The output should be a regular number, but will likely be 0" & lf & " This will probably fail" ); wait until falling_edge(s_clk); s_a <= X"00781136"; -- 1.10264e-38 (subnormal) s_b <= X"3fc00000"; -- 1.5 (not subnormal) expected_q := X"01ba0cf5"; -- 6.83442e-38 (not subnormal)report( lf & "------------------ TEST 3 ------------------------" & lf & " Multiply two regular numbers that should produce a subnormal number" & lf & " The output should be a subnormal number, but will likely be 0" & lf & " This will probably fail" ); wait until falling_edge(s_clk); s_a <= X"1ff7f0d6"; -- 1.05007e-19 (not subnormal) s_b <= X"1ff7f0d6"; -- 1.05007e-19 (not subnormal) expected_q := X"00781150"; -- 1.10265e-38 (subnormal)