Threshold.v

This module is a binary threshold detector, that is, if the argument is below a specified power of two, a true is returned. There are four options. The argument bit width, whether it is signed, whether successive samples are to be interpreted as I and Q components, and whether the output is registered may be specified.

Ports | Parameters | Notes | Example

Ports

clkinput    The clock input. It is unused if the instance is unregistered and the input is not interpreted as successive I and Q components.
ininputThe input. These are only the uppermost bits.
lowinputThe logic output indicating a below-threshold condition.

Parameters

w4Bit width of the input.
registered   "yes"Whether the output is registered. It can be "yes" for registered, or anything else for not registered.
IQ"yes"Indicates whether successive samples are interpreted as I and Q components. Can be "yes" for I and Q compoents, or anything else for not.
sign"yes"Whether the input is interpreted as signed. Can be "yes for signed, and anything else for not signed.

Notes

Example instantiation:

wire		signed	[15:0]	data;
wire				low;
Threshold
    #(.w(4), .registered("no"), .IQ("yes"), .sign("yes"))
    lim1 (.clk(clk), .in(data[15:12]), .low(low));