Why is the error waveform of an ADC a sawtooth wavefrom?

The analog to digital converter has a staircase waveform. But the error waveform of this staircase signal is a sawtooth waveform. Why does this happen?

I have come to know that, the sawtooth signal is the difference between the quantized output signal (solid) and the analog input signal (dashed). But when I look at the graph, it seems to be like a triangular waveform. How does this turn out to be a sawtooth waveform?

Just for the note, I have found out the RMS value of this error signal which is a triangular waveform.

Take a random signal that has been converted to digital values then imagine those digital values were taken back into the analogue realm so they could be compared: -

The difference between the blue and red signals in the top graph is shown magnified in the bottom graph - this is the quantization error caused by the process of digitization.

Now look at this sinewave and in particular concentrate on the rising and falling slopes: -

Can you now see why that when the waveform is rising or falling near-linearly the error looks like a sawtooth?

The sawtooth wave on the right is derived by subtracting the quantized output (solid line on the left) from the ideal output (dashed line on the left). The constant values between steps cause the slowly rising segments, and the sudden jumps from one step to the next cause the sudden drops.

Whatever it seems to you, the difference is a sawtooth signal.

You can calculate the difference yourself, I am not going to do that here because this board is about electronics and not mathematics or calculus.

What I find unbelievable is the total lack of rigour your book seem to have.

The left plot is ok, it is the typical ADC transfer function. Then you have that 'rotate the page by 45deg' thingy. This is wrong.

Quantization error is defined as the difference between the input signal and the output quantized signal. Rotating a plot does not calculate any difference at all.

And moreover you get a new player in the second plot: time! Where in heaven is this coming from? Nobody knows.

Again, quantization noise is the difference between input and output, and is a function of the input, not of time. The rightmost graph you have is the quantization error you would get if you feed your ADC with a ramp, varying in time.

I strongly suggest to change your book, or at least to be much more critic while parsing it. The rotate thing is just unbelievable.