Div and Rem act as sources of X
See original GitHub issueI ran into this problem when trying to run LEC to test examples for #1365.
From IEEE 1364-2005 (same for older standards):
For the division or modulus operators, if the second operand is a zero, then the entire result value shall be x.
I know these don’t pop up too much in practice, but it might be reasonable to control via randoms.
z <= a / b; // source of X
z <= a % b; // source of X
z <= (b == 0) ? _RAND_0 : a % b; // no X
z <= (b == 0) ? _RAND_0 : a / b; // no X
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
<div>: The Content Division element - HTML - MDN Web Docs
The <div> HTML element is the generic container for flow content. It has no effect on the content or layout until styled in...
Read more >How to perform an integer division, and separately get the ...
Either use trunc instead of floor (thereby permitting negative remainders) or use subtraction to get the remainder ( rem = y - div...
Read more >Introduction to Ionizing Radiation
Ionizing Radiation: Any electromagnetic or particulate radiation capable of producing ion pairs by interaction with matter. Scope limited to X and gamma rays, ......
Read more >Euclidean division: div , rem and friends #9283
For any two real numbers x and y, Euclidean division is the problem of finding an integer q (the quotient) and number r...
Read more >Function Reference: rem - Octave Forge - SourceForge
Return the remainder of the division x / y . The remainder is computed using the expression. x - y .* fix (x...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry I didn’t specify; this would be simulation only – the
_RAND_
signals are generally only used in simulation. This would fit in our existing set of conditional compilation modes that cover things like register initialization.Can use an ifdef-guard in the same manner as out-of-bounds array indices, so that the new Verilog only affects simulation, letting the synthesis tool do as it pleases.
On Thu, Feb 13, 2020 at 10:18 AM John Wright notifications@github.com wrote: