diff options
| author | azidar | 2015-03-03 13:29:37 -0800 |
|---|---|---|
| committer | azidar | 2015-03-03 13:29:37 -0800 |
| commit | 5e333ec85ebbae58686d225b7e03fcff9376d979 (patch) | |
| tree | c962377cb02cf283fe3fc98b1f1e60451a2fe898 /spec | |
| parent | 4bb3ec977ea29763af6f4a35f4cb5b236d7a10a5 (diff) | |
Updated TODO and spec
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/spec.tex | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/spec/spec.tex b/spec/spec.tex index 41838f70..489dce23 100644 --- a/spec/spec.tex +++ b/spec/spec.tex @@ -575,9 +575,9 @@ The resultant value of a divide operation has width equal to the width of the di \kws{primop} & \kws{Resultant Type} & \kws{Resultant Width} \\ \kws{mod}( \pds{op1}, \pds{op2}) & UInt|SInt & width(op1)|width(op2) - 1 \\ \kws{mod-uu}(\pds{op1}, \pds{op2}) & UInt & width(op2) \\ -\kws{mod-us}(\pds{op1}, \pds{op2}) & SInt & width(op2) - 1? \\ +\kws{mod-us}(\pds{op1}, \pds{op2}) & UInt & width(op2) - 1? \\ \kws{mod-su}(\pds{op1}, \pds{op2}) & UInt & width(op2) \\ -\kws{mod-ss}(\pds{op1}, \pds{op2}) & SInt & width(op2) - 1? \\ +\kws{mod-ss}(\pds{op1}, \pds{op2}) & UInt & width(op2) - 1? \\ \end{array} \] @@ -671,9 +671,9 @@ The resultant value is a single-bit unsigned integer. \[ \begin{array}{rll} \kws{primop} & \kws{Resultant Type} & \kws{Resultant Width} \\ -\kws{equal} (\pds{op1}, \pds{op2}) & UInt|SInt & 1 \\ +\kws{equal} (\pds{op1}, \pds{op2}) & UInt & 1 \\ \kws{equal-u}(\pds{op1}, \pds{op2}) & UInt & 1 \\ -\kws{equal-s}(\pds{op1}, \pds{op2}) & SInt & 1 \\ +\kws{equal-s}(\pds{op1}, \pds{op2}) & UInt & 1 \\ \end{array} \] The equality comparison operator accepts either two unsigned or two signed integers and checks whether they are bitwise equivalent. @@ -761,6 +761,20 @@ The resultant value has the same type as the operand. The shift amount must be less than or equal to the width of the operand. The output of a shift right operation is equal to the original signal with the least significant $num$ bits truncated, where $num$ is the shift amount. +\subsection{Convert to Signed} +\[ +\begin{array}{rll} +\kws{primop} & \kws{Resultant Type} & \kws{Resultant Width} \\ +\pd{convert} & SInt & width(op)|width(op) + 1 \\ +\pd{convert-u} & SInt & width(op) + 1 \\ +\pd{convert-s} & SInt & width(op) \\ +\end{array} +\] +The convert operation accepts either an unsigned or a signed integer. +The resultant value is always a signed integer. +The output of a convert operation will be the same arithmetic value as the input value. +The output width is the same as the input width if the input is signed, and increased by one if the input is unsigned. + \subsection{Bitwise Operations} \[ \begin{array}{rll} |
