Hi All,
I am learning SVA and i would like to know is it possible to write an assertion to check that the entered number is BCD,or Hexa-decimal or octal.
Thanks in advance
Hi All,
I am learning SVA and i would like to know is it possible to write an assertion to check that the entered number is BCD,or Hexa-decimal or octal.
Thanks in advance
In reply to Mechanic:
The magic here is in the algorithm in making that determination.
It has NOTHING to do with SVA.
Ben SystemVerilog.us
In reply to ben@SystemVerilog.us:
In reply to Mechanic:
The magic here is in the algorithm in making that determination.
It has NOTHING to do with SVA.
Ben SystemVerilog.us
Ben could you please elaborate the highlighted statement. I am not able to get how the algorithm are related in this topic.
In reply to Mechanic:
Forget about assertions. How do you decide that a number is octal or hexadecimal? Digital hardware is always binary.
In reply to dave_59:
In reply to Mechanic:
Forget about assertions. How do you decide that a number is octal or hexadecimal? Digital hardware is always binary.
we will use code converters right in order to verify that code converter can’t we use SVA
Please let me know.
In reply to Mechanic:
Mechanic,
You seem to have something in mind with respect to interpreting whether a “number” is BCD, hex, octal, etc… But it’s not clear to us just what your definition is, so we can’t help you.
For most use cases one has, for example, and 8-bit wire:
wire [7:0] dataval;
Now how to interpret this “dataval” is purely a function of context. There’s no clear general purpose assertion one can apply to “dataval” in order to state that it’s value is “octal”, or “hex”, etc. It could twos-complement value going into an ALU. It could be a set of 8 independent status flags. It could be anything - context determines definition. All that “dataval” is, in general, is a simple variable holding 256 possible distinct states…
Further, one normally uses radix as just a debug tool for the human debugging the design to more easily interpret things. The radix one displays in the waveforms isn’t of any consequence to the actual design operation. It’s just a helpful crutch for us pesky humans who don’t read strings of 1s and 0s easily…
So, again, what’s your definition of the function which defines whether a “number” is “hexidecimal”?
Regards,
Mark
In reply to Mark Curry:
Mechanic, _B_inary _C_oded _D_ecimal is different concept from a radix. BCD is a binary representation of a decimal number where you have groups of 4-bit binary values from 0000 to 1001. 1111 would be an illegal BCD encoding. But there’s no such thing as binary coded octal or hex, unless you are referring to conversion for ASCII codes to binary, or binary to 7-segment LCD displays. Forget about SVA for a moment, you need to explain a lot more what it is you need to check.