How to Convert a Binary Number to 6 Significant figures

  • I
  • Thread starter Dada
  • Start date
  • #1
10
1
1203.201 which is 0100|1011|0011.0011|0011

How to round the binary representation to 6 significant figures and 12 significant figures? And what is the rounding rule for base 2?

If it was rounded to 6 significant figure, such as 0100|10 {2}, then it changes its initial value, doesn't it?

So, what am I supposed to?

Thank You!
 

Answers and Replies

  • #2
phinds
Science Advisor
Insights Author
Gold Member
16,836
7,711
Well, if you mean round the binary to 6 significant figures (which are bits in binary), I think you get

010011000000

but I assume that's not what you mean. SO ... if you mean to do the rounding in decimal then DO it in decimal (1203.20) and re-convert to binary. Rounding in decimal and rounding in binary just aren't going to be the same because binary has about 3 times the granularity of decimal.
 
  • Like
Likes Klystron, scottdave and Dada
  • #3
10
1
Thank you, phinds! You solved my doubt! I actually meant the first situation you explained since I was confused whether I should add 0's at the end of the 6th digit. And it is great that you provided me a second situation!
 
  • #4
12,764
6,640
The real rounding should be in the base chosen. For base 2, then you'd decide based on the digit to the right.

.000010 --> rounds to .00001 (ie we just truncate and drop the 0 bit)

and

.000011 --> rounds to .00001+.00001 --> .00010 (ie we truncate and add one to the last bit)

Converting back to decimal means you are rounding in a decimal sense.
 
  • #5
10
1
The real rounding should be in the base chosen. For base 2, then you'd decide based on the digit to the right.

.000010 --> rounds to .00001 (ie we just truncate and drop the 0 bit)

and

.000011 --> rounds to .00001+.00001 --> .00010 (ie we truncate and add one to the last bit)

Converting back to decimal means you are rounding in a decimal sense.

Thank you for clearing my question about rounding rule and explaining so clear, jedishrfu!
 
  • #6
phinds
Science Advisor
Insights Author
Gold Member
16,836
7,711
Converting back to decimal means you are rounding in a decimal sense.
I disagree that rounding something in binary and then converting it to decimal is "rounding in the decimal sense" because as I pointed out (and I'm sure you realize) binary and decimal do not have the same granularity.
 
  • #7
Merlin3189
Homework Helper
Gold Member
1,660
773
... I was confused whether I should add 0's at the end of the 6th digit.
I hope when you round numbers in any base you add the necessary zeros.
If you round 299 792 458 m/sec to 6 sig fig, I hope it doesn't become 299 792 m/sec
 
  • Haha
Likes Dada and phinds
  • #8
10
1
I hope when you round numbers in any base you add the necessary zeros.
If you round 299 792 458 m/sec to 6 sig fig, I hope it doesn't become 299 792 m/sec
Thank you for your reminder, Merlin3189!
 
  • #9
12,764
6,640
I disagree that rounding something in binary and then converting it to decimal is "rounding in the decimal sense" because as I pointed out (and I'm sure you realize) binary and decimal do not have the same granularity.
I was responding with a clarification to your earlier excellent post. So that the OP wouldn’t think that binary rounding meant converting a binary representation back to decimal to do the rounding and then back to binary.
 
  • #10
phinds
Science Advisor
Insights Author
Gold Member
16,836
7,711
I was responding with a clarification to your earlier excellent post. So that the OP wouldn’t think that binary rounding meant converting a binary representation back to decimal to do the rounding and then back to binary.
Ah. I misunderstood. Thanks for that clarification.
 
  • #11
Merlin3189
Homework Helper
Gold Member
1,660
773
I'm not sure what people found so funny about my comment? It was meant to be serious.
Not so much a reminder, as an illustration of why it has to be so.

The thing that puzzled me for a while about the OP was, why rounding to 6 figs should be any different from rounding to 12 figs.
 
  • #12
12,764
6,640
I think it was a great comment. It clarified that the digits don't go away ie the number as a whole doesn't get reduced by a factor of a million.

123,456,123,456 = would round to 123,456,000,000 and not 123,456

I think in scientific notation you wouldn't have noticed this:

123,456,123,456 = 1.23456123456 E12 = 1.23456 E12 rounded
 
Last edited:
  • #13
phinds
Science Advisor
Insights Author
Gold Member
16,836
7,711
I'm not sure what people found so funny about my comment? It was meant to be serious.
Not so much a reminder, as an illustration of why it has to be so.

The thing that puzzled me for a while about the OP was, why rounding to 6 figs should be any different from rounding to 12 figs.
Personally, I didn't doubt for a minute that you were serious but I just found it humorous that someone would need to be reminded of that.
 
  • #14
10
1
I'm not sure what people found so funny about my comment? It was meant to be serious.
Not so much a reminder, as an illustration of why it has to be so.

The thing that puzzled me for a while about the OP was, why rounding to 6 figs should be any different from rounding to 12 figs.
Thank you for your clarification, Merlin3189! I am sorry that I used the unappropriated wording!

This question comes from my textbook, so when I copied it, I mistakenly included the 12 figs question.
 
Last edited:

Related Threads on How to Convert a Binary Number to 6 Significant figures

  • Last Post
Replies
2
Views
2K
Replies
1
Views
2K
Replies
9
Views
1K
Replies
5
Views
27K
Replies
18
Views
4K
Replies
13
Views
15K
Top