Download NuSMV 2.5 User Manual

Transcript
where word[N] is unsigned word[N] or signed word[N]. The left-hand operand will make up
the upper bits of the new word, and the right-hand operand will make up the lower bits. The
result is always unsigned word[•]. For example, given the two words w1 := 0ub4 1101
and w2 := 0sb2 00, the result of w1::w2 is 0ub6 110100.
Word sizeof Operator
sizeof operator provides a very simple way for retrieving the width of a word. The behavior
of this operator can be described as follows:
let w be a word[N] : sizeof (w) returns N.
The signature of the operator is:
sizeof : unsigned word[•] → integer
: signed word[•] → integer
Extend Word Conversions
extend operator increases the width of a word by attaching additional bits on the left. If the
provided word is unsigned then zeros are added, otherwise if the word is signed the highest (sing)
bit is repeated corresponding number of times.
The signature of the operator is:
extend : unsigned word[N] * integer → unsigned word[N+integer ]
: signed word[N] * integer → signed word[N+integer ]
For example:
extend(0ub3 101, 2) = 0ub5 00101
extend(0sb3 101, 2) = 0sb5 11101
extend(0sb3 011, 2) = 0sb5 00011
Note that the right operand of extend has to be an integer constant greater or equal to zero.
Resize Word Conversions
resize operator provides a more comfortable way of changing the width of a word. The
behavior of this operator can be described as follows:
let w be a M bits unsigned word[•] and N be the required width: if M = N, w is returned
unmodified; if N is less than M, bits in the range [N-1:0] are extracted from w; if N is greater
than M, w is extended of (N - M) bits up to required width, padding with zeroes.
let w be a M bits signed word[•] and N be the required width: if M = N, w is returned
unmodified; if N is less than M, bits in the range [N-2:0] are extracted from w, while N-1-ith bit
is forced to preserve the value of the original sign bit of w (M-1-ith bit); if N is greater than M,
w is extended of (N - M) bits up to required width, extending sign bit.
The signature of the operator is:
resize : unsigned word[•] * integer → unsigned word[integer ]
: signed word[•] * integer → signed word[integer ]
Set Expressions
The set expression is an expression defining a set of boolean, integer and symbolic enum
values. A set expression can be created with the union operator. For example, 1 union 0
specifies the set of values 1 and 0. One or both of the operands of union can be sets. In this
18