Download ModelSim SE Command Reference

Transcript
CR-20
Syntax and conventions
Numbering conventions
Numbers in ModelSim can be expressed in either VHDL or Verilog style. You can use two
styles for VHDL numbers and one for Verilog.
VHDL numbering conventions
VHDL Style 1
The first of two VHDL number styles is:
[ - ] [ radix # ] value [ # ]
Element
Description
-
indicates a negative number; optional
radix
can be any base in the range 2 through 16 (2, 8, 10, or 16); by default,
numbers are assumed to be decimal; optional
value
specifies the numeric value, expressed in the specified radix; required
#
is a delimiter between the radix and the value; the first # sign is
required if a radix is used, the second is always optional
A ‘-’ can also be used to designate a "don’t care" element when you search for a signal value
or expression in the List or Wave window. If you want the ‘-’ to be read as a "don’t care"
element, rather than a negative sign, be sure to enclose the number in double quotes. For
instance, you would type "-0110--" as opposed to -0110--. If you don’t include the double
quotes, ModelSim will read the ‘-’ as a negative sign.
Examples
16#FFca23#
2#11111110
-23749
VHDL Style 2
The second VHDL number style is:
base "value"
Element
Description
base
specifies the base; binary: B, octal: O, hex: X; required
value
specifies digits in the appropriate base with optional underscore
separators; default is decimal; required
Examples
B"11111110"
X"FFca23"
ModelSim SE Command Reference