Rotator.v

Generates an I/Q phaser from an either absolute or relative phase input, in the relative case referenced to another I/Q input pair. The phase is specified as binary input, where full scale wraps to zero phase. There are also negative outputs, as well as a I, Q, -I, -Q ... output referenced to a quadrant input.

Ports | Parameters | Notes | Example

Ports

clkinputThe clock input.
resetinputThe reset input.
goinputA multi-bit trigger to start conversions.
gonowoutputWhen go is a multi-bit vector providing a multi-level trigger, the gonow output is asserted for one clock cycle when all trigger events have occurred. This pulse initiates the Cordic rotation.
phaseinputA multi-bit trigger to start conversions.
phaseininputThe phase to which the phase of the output I/Q vector is to be set or shifted by.
Iin, QininputThe input I/Q pair. In the the relative mode where the parameter mag > 0, the output phase is the phase of this pair shifted by phase.
Iout, QoutoutputThe output I/Q pair. The phase of this pair is phase in absolute mode, and the phase of Iin/Qin in relative mode.
IoutN, QoutNoutputThe twos-complement negative of Iout and Qout.
quadinputA two-bit quadrant counter used to generate the upconverted out output from Iout, Qout, IoutN, and QoutN
busyoutputWhen asserted, indicates that a Cordic rotation is underway.
doneoutputWhen asserted, always for one clock pulse, indicates that the Cordic rotation has finished and that data are valid on the Iout, Qout, IoutN, and QoutN outputs.
outoutputThe up-converted (I, Q, −I, −Q ... ) data stream.

Parameters

Parameters, their defaults, and descriptions:

wd15The bit width of the inputs Iin and Qin. Through the Cordic rotation, this vector grows by the factor 1.6468. For this reason, the outputs Iout, Qout, IoutN, and QoutN have one addition bit of width (wd+1) than the inputs.
wc4The width of the counter timing the Cordic rotation. The condition 2wc ≥ wd must be met.
wpwdThe width of the phase input timing the Cordic rotation. The condition 2wc ≥ wd must be met.
gobits1The number of bits of the go trigger vector.
registered"no"Selects whether the output is registered. If registered, then the timing of the outputs is delayed by one clock cycle.
mag32500When nonzero, then the absolute-phase mode is selected, and mag sets the magnitude of the starting phaser for the Cordic rotation. It must be in the range 0 to 2wd-1-1. In this mode, the inputs Iin and Qin are not used. If mag is zero, then the relative-phase mode is selected and the starting phaser for the Cordic rotation is set by the inputs Iin and Qin.

Performance

These plots are of a simulated spectrum obtained from the Xilinx ISim simulator showing a single dominant channel. No windowing functions is used; instead, the length of the array from which this spectrum was computed was chosen to be an integral number of signal periods.

Spectrum 1 Spectrum 2

Notes

Example instantiation:

localparam		wd = 16;
wire	signed	[wd:0]	Iout1, Qout1, IoutN1, QoutN1, out1;
wire			busy1, done1;
Rotator #(.wd(wd), .wc(4), .registered("yes")) cr1 (
    .clk(clk),			.reset(reset),
    .go(go2),
    .phasein(phase1),
    .Iout(Iout1),		.Qout(Qout1),
    .IoutN(IoutN1),		.QoutN(QoutN1),
    .quad(quad),
    .out(out1),
    .busy(busy1),		.done(done1), 
    .preg(preg)
);