0
$\begingroup$

I am trying to understand what this question is asking in terms of conversion. I know how to convert binary to decimal and vice versa, but the method you need to use has me confused.

I need to convert 010111 to decimal using only odd numbered positions while still applying the correct positional exponent in the conversion. What I did was take every odd numbered position from base 2 digit from 010111 so "111" I skipped every other number and took the digit from that position (if that makes sense) I only had three digits so I added a 0 to make it 4 bit 0111 which equals 7 in decimal. I know this is wrong but why??

This is the question: - Imagine that a processor is faulty and reads only odd-numbered positions when converting binary numbers to decimals, but it applies the correct positional exponent in the conversion. In radix 10, the binary number 010111 converted by this processor would be:

The mock test answer says the result is 2 but I cannot figure out why

$\endgroup$
  • $\begingroup$ Taking the bits from the odd numbered positions .. it's a bit ambiguous but I would interpret that as taking the bits 001. The 0'th position isn't an odd position. Was any convention for that ever mentioned? $\endgroup$ – harold Nov 6 '19 at 18:44
  • $\begingroup$ I made a mistake, the result should be 2 not 3 which is 001, but I didnt get what process do you need to do when it says "only odd numbered positions" thanks for your reply $\endgroup$ – datanegator Nov 6 '19 at 18:54
  • $\begingroup$ The question itself is not clear. It's poorly worded. I wouldn't know how to answer it. $\endgroup$ – Yuval Filmus Nov 7 '19 at 9:36
1
$\begingroup$

I'm assuming positions are counted from $1$ starting from the least significant bit.

In this case you're using the exponents as if the number was 0111. The question is asking to use the same exponents you would use for the odd-position digits of the number 010111.

To break it down, from the least to the most significant bit, the contribution to the final decimal value of each digit is:

  • First digit: $1 \cdot 2^0 = 1$.
  • Second digit: would be $1 \cdot 2^1 = 2$ but it is 0 since digits in even position are ignored.
  • Third digit: $1 \cdot 2^2 = 4$.
  • Fourth digit: ignored.
  • Fifth digit: $1 \cdot 2^4 = 16$.
  • Sixth digit: ignored.

The final result is: $16+4+1 = 21$.


Edit: Since you added that the answer should be $2$ this tells us that positions are either numbered starting from $0$, from the least to the most significant bit, or starting from $1$ from the most to the least significant bit.

In either case you would select the bits $001$ whose contribution would be $1 \cdot 2 + 0 \cdot 2^2 + 0 \cdot 2^4 = 2$.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for your reply! I made a mistake with the result so I had to edit that. I understand how 001 in binary is 2 in decimal, but what i still dont get is how you got 001 from 010111. What process do you need to do when it says "only odd numbered positions" thanking you much $\endgroup$ – datanegator Nov 6 '19 at 18:51
  • $\begingroup$ I ignored the last bit ($1$) because it appears in position $0$ (counting from the least significant bit), I kept the one-to-last bit ($1$) since it appears in position $1$, then discarded the preceding 1 (in position $2$), kept the preceding $0$ (in position $3$), discarded the 1 (in position 4), and kept the most significant bit (a $0$ in position $5$). $\endgroup$ – Steven Nov 6 '19 at 18:55
  • $\begingroup$ Thank you! I knew it was something simple lol $\endgroup$ – datanegator Nov 6 '19 at 18:56
0
$\begingroup$

If the processor is only reading odd numbered bits and we assume that the right-most bit is bit $0$ then in effect the processor is doing a bitwise AND with bit string $101010$ before converting to decimal.

$010111_2 \text{ AND } 101010_2 = 000010_2 = 2_{10}$

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.