aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Magyar2020-03-25 12:33:22 -0700
committerAlbert Magyar2020-03-26 11:14:28 -0700
commit5b58936df09163ed3f0690bd66e46b307c2a9654 (patch)
treeb88ea021f0b12b107e20514b4a09a880239c27a9
parent4b3b5442bfe34502862eb070854aeef1e0cfc9c4 (diff)
Update spec to clarify sign and use 'h' for hex throughout
-rw-r--r--spec/spec.pdfbin275443 -> 276166 bytes
-rw-r--r--spec/spec.tex8
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/spec.pdf b/spec/spec.pdf
index 89197101..0874fa06 100644
--- a/spec/spec.pdf
+++ b/spec/spec.pdf
Binary files differ
diff --git a/spec/spec.tex b/spec/spec.tex
index 45c25d4b..91b33d83 100644
--- a/spec/spec.tex
+++ b/spec/spec.tex
@@ -1014,7 +1014,7 @@ Similar to unsigned integers, a literal signed integer can alternatively be crea
The bit representation contains a binary, octal or hex indicator, followed by an optional sign, followed by the value.
-If a bit width is not given, the number of bits in the bit representation is the minimal bitwidth to represent the value represented by the string. The following examples create a 8-bit integer representing the number -13.
+If a bit width is not given, the number of bits in the bit representation is the minimal bitwidth to represent the value represented by the string. The following examples create a 8-bit integer representing the number -13. For all bases, a negative sign acts as if it were a unary negation; in other words, a negative literal produces the additive inverse of the unsigned interpretation of the digit pattern.
\begin{lstlisting}
SInt("b-1101")
SInt("h-d")
@@ -1728,9 +1728,9 @@ The following characters are allowed in identifiers: upper and lower case letter
An integer literal in FIRRTL begins with one of the following, where `\#' represents a digit between 0 and 9.
\begin{itemize}
-\item `0x' : For indicating a hexadecimal number. The rest of the literal must consist of either digits or a letter between `A' and `F', or the separator `\_'.
-\item `0o' : For indicating an octal number. The rest of the literal must consist of digits between 0 and 7, or the separator `\_'.
-\item `0b' : For indicating a binary number. The rest of the literal must consist of either 0 or 1, or the separator `\_'.
+\item `h' : For indicating a hexadecimal number, followed by an optional sign. The rest of the literal must consist of either digits or a letter between `A' and `F'.
+\item `o' : For indicating an octal number, followed by an optional sign. The rest of the literal must consist of digits between 0 and 7.
+\item `b' : For indicating a binary number, followed by an optional sign. The rest of the literal must consist of digits that are either 0 or 1.
\item `-\#' : For indicating a negative decimal number. The rest of the literal must consist of digits between 0 and 9.
\item `\#' : For indicating a positive decimal number. The rest of the literal must consist of digits between 0 and 9.
\end{itemize}