We propose a simple approach to manipulating the constellation of a multilevel modulation signal in the optical domain. By exploiting degenerate four-wave mixing (FWM) in highly nonlinear fibers and adopting 16-ary quadrature amplitude modulation (16-QAM) signal, we demonstrate 10-Gbaud/s optical variable symbol-wise hexadecimal coding/decoding assisted by a continuous-wave (CW) pump or a phase-modulated pump. The former takes the coding through the phase conjugation of degenerate FWM, and the latter offers enhanced coding via the combined contributions from the phase modulation of the pump and the phase-conjugated FWM. The penalty of optical signal-to-noise ratio for coding/decoding is measured to be
dB with a CW pump and
dB with a
phase-modulated pump at a bit-error rate of 2e-3 (enhanced forward error correction threshold). The dependence of coding/decoding performance on the phase modulation depth of the pump and the signal/pump misalignment is also investigated. Moreover, considering that a hexadecimal number denotes four binary numbers, we develop the symbol-wise hexadecimal coding/decoding to general binary coding/decoding, i.e., 10-Gbaud/s symbol-wise hexadecimal coding/decoding is accompanied by 40-Gbit/s binary coding/ decoding.