This is a reasonable answer from a mathematical point of view, but not a great answer from computer science point of view. To understand this you want to look at the most common two's complement binary math https://notesformsc.org/2s-complement-subtraction/. This also overlaps an interesting subject in math, modular arithmetic (since register sizes are fixed) used to prevent rollover issues when doing timing math see http://www.gammon.com.au/forum/?id=12127.
The C++ program below shows that if you interpret the number as time subtracting T2-T1 works even if the counter has rolled over (gone from large to small) once. It also shows that if you allow promotion to large types you get, what may be initially, unexpected values.
#include <iostream> #include <cmath> #include <bitset> void take_short_diff(unsigned short T1, unsigned short T2) { //Force all math to happen without promotion unsigned char diff = (unsigned char)(T2 - T1); //Ints below are just so it doesn't print as characters, they don't impact the problem std::cout << "\n\nT1 =" << (int)T1 << "\nT2 =" << (int)T2 << "\ndiff=" << (int)diff; //Show the binary pattern std::cout << "\nT1 =" << std::bitset<8>(T1) << "\nT2 =" << std::bitset<8>(T2) << "\ndiff=" << std::bitset<8>(diff); //Allow promotion to short short diff_short = T2 - T1; std::cout << "\ndiff short=" << diff_short; std::cout << "\n" << std::bitset<16>(diff_short); //Allow promotion to unsigned short unsigned short diff_short_u = T2 - T1; std::cout << "\ndiff short unsigned=" << diff_short_u; std::cout << "\n" << std::bitset<16>(diff_short_u); } void main() { take_short_diff(0, 2); take_short_diff(253, 255); take_short_diff(254, 1); }