See the end of section 5.3:
Code: Select all
Note that the "-" prefix is not permitted unless b is present. Moderator: Moderators
Code: Select all
Note that the "-" prefix is not permitted unless b is present. I assume you mean to say that whenever the document says "1's complement" the two complement representation of a negative number is meant.3FG wrote:First, note that the IRP spec has an error: it uses 2's complement rather than 1's complement. However, the accompanying text makes that clear.
Not in my interpretation. In the document, 'the "-" prefix" means the prefix (not the non-positivity of the value) of the width parameter, not a prefix of the value. So X::0 is indeed to be understood as an infinite sequence (beginning with ones if X is negative, zeros if X is positive) (IrpMaster makes it a 63 bit sequence) that can not sensibly be transformed by a bitspec to a finite set of durations, but (only) to an integer expression (that will be finite). This is one flaw of the IRP spec.See the end of section 5.3:So -16::0 is not a legal construct.Code: Select all
Note that the "-" prefix is not permitted unless b is present.
As you can probably tell, I'm a newbie at IRP. Please excuse my questions that miss the mark. What I had meant to write was:3FG wrote:See the end of section 5.3:So -16::0 is not a legal construct.Code: Select all
Note that the "-" prefix is not permitted unless b is present.
Code: Select all
<-1,1|1,-1>((-16)::0)
I think the "-" prefix that is mentioned refers to the ["-"] that optionally prefixes the 2nd primary item (ie the b parameter).... Note that the "-" prefix is not permitted unless b is present.Code: Select all
bitfield = ["~"], primary item, ":", (["-"], primary item, [":", primary item] | ":", primary item);
ROTFL Well, I had a set of follow up questions about that which are now unnecessary.3FG wrote:First, note that the IRP spec has an error: it uses 2's complement rather than 1's complement. However, the accompanying text makes that clear.
Ok. Thanks. It would be good to have the specification speak to this case. It could say that implementation behaviour is undefined, or perhaps say that this case should elicit an error.3FG wrote:So my earlier post is wrong, and you should pay attention to what Barf wrote. From my (revised) point of view -16::0 is valid syntax, but it does not have a usefully defined value.
Code: Select all
<0:3|1:3|2:3|3:3|4:3|5:3|6:3|7:3>( <0:2|1:2|2:2|3:2|>(A:2) ^P <0:1|1:1>(B:1) )
Code: Select all
PROCESS buffer
BEGIN
(* This buffer is in scope of previous bitspec, if any *)
...
(* The current bitspec now was the previous bitspec on entry *)
IF current bitspec IS NOT NULL THEN
(* if an attempt has been made to push bits into its buffer, it will already have generated an error *)
PROCESS buffer OF current bitspec;
END IF;