| 1 |
\DOC wordn_NWORD_CONV |
| 2 |
|
| 3 |
\TYPE {wordn_NWORD_CONV : conv} |
| 4 |
|
| 5 |
\LIBRARY wordn |
| 6 |
|
| 7 |
\SYNOPSIS |
| 8 |
Derives a theorem stating the representation of a natural number in |
| 9 |
an n-bit word. |
| 10 |
|
| 11 |
\DESCRIBE |
| 12 |
{wordn_NWORD_CONV} takes a term in the form {"NWORDn m"} and derives a |
| 13 |
theorem stating the n-bit word representing the natural number {m} as |
| 14 |
below: |
| 15 |
{ |
| 16 |
|- NWORDn m = #... |
| 17 |
} |
| 18 |
If {m} is greater than the maximium that an n-bit word can represent, |
| 19 |
{m MOD (2 EXP n)} will be used to work out the n-bit word instead. By |
| 20 |
virtue of the theorem returned by {prove_NWORD_MOD}, the above theorem |
| 21 |
is still valid. |
| 22 |
|
| 23 |
\FAILURE |
| 24 |
Fails if the type {:wordn} or the function {NWORDn} has not been defined. |
| 25 |
|
| 26 |
\EXAMPLE |
| 27 |
The HOL session below illustrates the use of this conversion: |
| 28 |
{ |
| 29 |
# wordn_NWORD_CONV "NWORD3 6";; |
| 30 |
|- NWORD3 6 = #110 |
| 31 |
|
| 32 |
# wordn_NWORD_CONV "NWORD3 16";; |
| 33 |
|- NWORD3 16 = #000 |
| 34 |
} |
| 35 |
|
| 36 |
\SEEALSO |
| 37 |
{define_wordn_type}, {define_word_val}, {prove_NWORD_MOD}, {wordn_NVAL_CONV}. |
| 38 |
|
| 39 |
\ENDDOC |