xreal_to_bit

xreal_to_bit :
An xreal-to-bit connector.

The xreal_to_bit primitive converts an xreal-type signal to a bit-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. The parameter strength defines the driving strength of the bit-type output signal (e.g. 4 for weak, 5 for pull, 6 for strong, and 7 for supply).

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 wire bit-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
strength integer 6 None driving strength (0~7)
width integer 1 None connector bit-width
« xbit_to_xreal_var
xreal_to_bit_var »