Binary Number System Homework: Counting 1s in 162*9+162*7+16*5+3

  • Thread starter Thread starter RajChakrabrty
  • Start date Start date
  • Tags Tags
    Binary System
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
5 replies · 5K views
RajChakrabrty
Messages
27
Reaction score
0

Homework Statement



Number of 1 in the binary representation of the expression 162*9+162*7+16*5+3

Homework Equations





The Attempt at a Solution



obviously, anyone can add these numbers up and then convert to binary
but what is the actual procedure for this type of format?
 
Physics news on Phys.org
Notice that 162*9+162*7+16*5+3 can be rewritten as 162*16+16*5+3=167*16+5. Converting this to hexademical, then to binary, should be much easier than computing the decimal result and converting that to binary.
 
wonderful.
Thanks a lot.
 
UH ... I think you've missed the point here. The solution is obvious without doing ANY calcs.

Just notice that each of the products has an even term in it, and the product of any even integer with ANY integer is an even number, so you have the sum of 3 even numbers and THAT is an even number, so what's the low-order bit in a binary representation of ANY even number? I think that's the point of the exercise because if you understand that, then the answer is trivial.
 
I read this problem statement as "Find the number of ones in the binary representation..."--not "what is the value of the LSB". Maybe OP can clarify.
 
lewando said:
I read this problem statement as "Find the number of ones in the binary representation..."--not "what is the value of the LSB". Maybe OP can clarify.

Yeah, now you mention it and I re-read it, I see your point. I just glossed over the problem statement so quickly that my brain said "value of the 1 bit", which is NOT, as you point out, quite what it says and your interpretation seems more likely.