Question

I'm wondering if my math here is correct. If my baud rate is 9600 then that means 9600 bits are sent every second, right? If so, then:

9600 bit/sec <=> 1000 ms/ 9600 bit = 0.1042 ms/bit

So, sending 32KB should take:

32,000*(8+2) bits = 320,000 bits -- (8+2) because 8 data bits + 1 start bit + 1 stop bit
320,000 bits*0.1042 ms/bit = 33344 ms = 33.344 sec

Is that correct?

Was it helpful?

Solution

Indeed but you have lost precision by multiplying your approximation of the bit width, such that then specifying the time to three decimal places is incorrect.

To avoid loss of precision, do not use a rounded intermediate expression, but rather:

bytes x bits_per_character / bits_per_second

So in your case:

32000 x 10 / 9600 = 33.333(recurring) seconds.

Traditionally however 32Kb refers to 32 x 1024 bytes, so in that case:

32 x 1024 x 10 / 9600 = 34.1333(recurring) seconds.

OTHER TIPS

If you need to roughly check the magnitude (whether it's 3s or 30 or 300), remember that 9600 kbps ~ 1KB/second (10 bits if you have 2 extra parity/stop bits), so 32KB -> around 32 seconds.

I'm wondering if my math here is correct. If my baud rate is 9600 then that means 9600 bits are sent every second, right? If so, then:

9600 bit/sec <=> 1000 ms/ 9600 bit = 0.1042 ms/bit

So, sending 32KB should take:

32,000*(8+2) bits = 320,000 bits -- (8+2) because 8 data bits + 1 start bit + 1 stop bit 320,000 bits*0.1042 ms/bit = 33344 ms = 33.344 sec

Is that correct?

No. It's more like 3.33 seconds.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top