Quantum error correction is of crucial importance for fault-tolerant quantum computers. As an essential step toward the implementation of quantum error-correcting codes, quantum nondemolition measurements are needed to efficiently detect the state of a logical qubit without destroying it. Here we implement quantum nondemolition measurements in a Si/SiGe two-qubit system, with one qubit serving as the logical qubit and the other serving as the ancilla. Making use of a two-qubit controlled-rotation gate, the state of the logical qubit is mapped onto the ancilla, followed by a destructive readout of the ancilla. Repeating this procedure enhances the logical readout fidelity from 75.5±0.3% to 94.5±0.2% after 15 ancilla readouts. In addition, we compare the conventional thresholding method with an improved signal processing method called soft decoding that makes use of analog information in the readout signal to better estimate the state of the logical qubit. We demonstrate that soft decoding leads to a significant reduction in the required number of repetitions when the readout errors become limited by Gaussian noise, for instance, in the case of readouts with a low signal-to-noise ratio. These results pave the way for the implementation of quantum error correction with spin qubits in silicon.