xreal_to_xbit :
An xreal-to-xbit connector.
The xreal_to_xbit
primitive converts an xreal-type signal to an xbit-type signal. The analog level of the input signal is converted to a digital level using the threshold parameters: threshold, thres0, or thres1.
The parameter threshold
sets the threshold level between logic 0 and logic 1. In other words, the output changes to logic 1 when the input rises above this threshold and to logic 1 when it falls below the threshold.
In addition, by defining the parameters thres0
and thres1
, one can set different thresholds for logic 0 and logic 1 (NOTE: not yet implemented).
Input/Output Terminals
Name | I/O | Type | Description |
out | output | xbit | xbit-type output |
in | input | xreal | xreal-type input |
Parameters
Name | Type | Default | Unit | Description |
threshold | real | 0.5 | None | threshold level |
thres0 | real | `NAN | None | threshold level for logic 0 |
thres1 | real | `NAN | None | threshold level for logic 1 |
width | integer | 1 | None | connector bit-width |