For the last numeral IV in MCCXXXIV, the subtraction rule comes into play, because here the I is a smaller symbol in front of the larger V. The I is thus subtracted from the V:
IV = 5 -1 = 4