A circuit arrangement for calibrating a circuit in an integrated circuit device, the circuit arrangement comprising: a main circuit configured to receive input data at a first input and generate output data at a first output, wherein the output data is based upon the input data and a function of the main circuit; a replica circuit configured to receive calibration data at a second input and generate calibration output data, based upon the calibration data, at a second output, wherein the replica circuit provides a replica function of the function of the main circuit; and a calibration circuit configured to: receive the output data from the main circuit and the calibration output data from the replica circuit during a foreground calibration mode to determine an initial replica correction code, and the calibration output data from the replica circuit during a background calibration mode to determine an updated replica correction code; determine a difference in the initial replica correction code and the updated replica correction code; and provide corrected control signals to the main circuit and the replica circuit during the background calibration mode based on an initial calibration correction code for the main circuit and the determined difference in the initial replica correction code and the updated replica correction code to correct the main circuit wherein the foreground calibration mode is performed before a function of the main circuit is performed and the background calibration mode is performed whilst the function of the main circuit is performed. a main circuit configured to receive input data at a first input and generate output data at a first output, wherein the output data is based upon the input data and a function of the main circuit; a replica circuit configured to receive calibration data at a second input and generate calibration output data, based upon the calibration data, at a second output, wherein the replica circuit provides a replica function of the function of the main circuit; and a calibration circuit configured to: receive the output data from the main circuit and the calibration output data from the replica circuit during a foreground calibration mode to determine an initial replica correction code, and the calibration output data from the replica circuit during a background calibration mode to determine an updated replica correction code; determine a difference in the initial replica correction code and the updated replica correction code; and provide corrected control signals to the main circuit and the replica circuit during the background calibration mode based on an initial calibration correction code for the main circuit and the determined difference in the initial replica correction code and the updated replica correction code to correct the main circuit receive the output data from the main circuit and the calibration output data from the replica circuit during a foreground calibration mode to determine an initial replica correction code, and the calibration output data from the replica circuit during a background calibration mode to determine an updated replica correction code; determine a difference in the initial replica correction code and the updated replica correction code; and provide corrected control signals to the main circuit and the replica circuit during the background calibration mode based on an initial calibration correction code for the main circuit and the determined difference in the initial replica correction code and the updated replica correction code to correct the main circuit wherein the foreground calibration mode is performed before a function of the main circuit is performed and the background calibration mode is performed whilst the function of the main circuit is performed. <EOS>