
LineCoder |
ptolemy.domains.sdf.lib.LineCoder |
A line coder, which converts a sequence of booleans into symbols.
Author(s): Edward A. Lee, Steve Neuendorffer
Version:$Id: LineCoder.java,v 1.50 2005/07/08 19:58:44 cxh Exp $
Pt.Proposed Rating:Green (eal)
Pt.Accepted Rating:Yellow (cxh)
table
The code table. Its value is a token of type ArrayToken.
The array provides the symbol values to produce on the output.
The number of values in this array must be at least
2wordLength, or an exception
will be thrown. The number of tokens consumed by this actor when
it fires is log2(tableSize), where
tableSize is the length of the table. If all of these
values are false, then the first array entry is produced
as an output. If only the first one is true, then then second
array value is produced. In general, the N inputs consumed
are taken to be a binary digit that indexes the array,
where the first input is taken to be the low-order bit of the array.
The default code table has two entries, -1.0
and 1.0, so that input false values are mapped to -1.0,
and input true values are mapped to +1.0.
wordLength
The word length is the number of boolean inputs that are consumed
to construct an index into the table. Its value is an IntToken,
with default value one.