Least significant bit when there is a radix point (trivial)

  • Context: Comp Sci 
  • Thread starter Thread starter JC2000
  • Start date Start date
  • Tags Tags
    Bit Point
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 1K views
JC2000
Messages
186
Reaction score
16
Homework Statement
Convert ( 110101010.1011010) from binary to octal number system
Relevant Equations
When converting a binary number to an octal number I know that the binary digits must be grouped in sets of three. The grouping must begin from the least significant bit and additional zero's can be added beyond the most significant bit to ensure that all groups are a set of three.
However when there is a binary point where do I start grouping from? Is the rightmost bit considered the least significant bit even then?

The other possibility is to begin grouping from the least significant bit for the integral part and then separately begin grouping from the leftmost digit of the fractional part (adding a zero beyond the rightmost digit in case grouping is not even).

Which method is correct?
 
Physics news on Phys.org
JC2000 said:
Homework Statement:: Convert ( 110101010.1011010) from binary to octal number system
Relevant Equations:: When converting a binary number to an octal number I know that the binary digits must be grouped in sets of three. The grouping must begin from the least significant bit and additional zero's can be added beyond the most significant bit to ensure that all groups are a set of three.

However when there is a binary point where do I start grouping from? Is the rightmost bit considered the least significant bit even then?
Yes.
For the integer part, left of the binary point, group the bits in groups of 3, from right to left. To the right of the binary point, group the bits in groups of three, from left to right, and tack on 0 bits at the right end, as necessary. You can tack on extra 0 bits at the left end, but this doesn't seem necessary.
From your example, 110 101 010.101 101 000. (two zero bits added at right end)
In octal, this would be 652.5508, although you could omit that final 0 digit.
JC2000 said:
The other possibility is to begin grouping from the least significant bit for the integral part and then separately begin grouping from the leftmost digit of the fractional part (adding a zero beyond the rightmost digit in case grouping is not even).

Which method is correct?
No, you don't want to do this. You want groups of three bits extending from the binary point in both directions.

Note that you could convert a floating point number in binary to hexadecimal using a technique that's almost the same. The only difference would be getting groups of four bits extending left and right from the binary point.
Doing this with your example would be done this way:
1 1010 1010.1011 0100, which is 1AA.B416, or 0x1AA.B4, using the 0x prefix that is the usual convention for numbers in hex. It's worth noting, though, that floating points numbers are almost never represented this way; i.e., with a "hex point." What is normally used is a representation that follows the IEEE-754 standard for floating point numbers (https://en.wikipedia.org/wiki/IEEE_754).
 
Last edited:
  • Like
Likes   Reactions: JC2000
A way to remember/understand is to realize that each bit represents a power of 2, starting from the radix point (just like powers of 10 around the decimal point in our decimal system).

Using just the 5 bits around the radix point in your example would be:
10.101
Code:
   0   .   1      0      1
(1×21) + (0×20) . + (1×2-1) + (0×2-2) + (1×2-3)

Cheers,
Tom
 
  • Like
Likes   Reactions: JC2000