// Gray-coded QPSK mapper. // bits[1] (MSB) sets the sign of I, bits[0] (LSB) the sign of Q: 0 -> +1, 1 -> -1. // 00 -> (+1,+1), 01 -> (+1,-1), 11 -> (-1,-1), 10 -> (-1,+1). // Neighbouring points around the circle differ in exactly one bit. `timescale 1ns / 1ps module qpsk_mapper ( input logic [1:0] bits, output logic signed [1:0] i_sym, output logic signed [1:0] q_sym ); assign i_sym = bits[1] ? -2'sd1 : 2'sd1; assign q_sym = bits[0] ? -2'sd1 : 2'sd1; endmodule