0 votes 0 votes The number of 1’s present in binary representation of 3 * 4096 – 4 + 6 * 512 is ______ CO and Architecture co-and-architecture number-representation + – Shadan Karim asked Dec 25, 2018 • retagged Jul 25, 2022 by Shubham Sharma 2 Shadan Karim 413 views answer comment Share Follow See 1 comment See all 1 1 comment reply MiNiPanda commented Dec 25, 2018 reply Follow Share I am elaborating the explanation given by Made Easy: $3*4096-4+6*512$ $=3*(2^{12}) - 4 +6*(2^9)$ $=3*(2^3)^4 - 4 + 6*(2^3)^3$ $=3*8^4+6*8^3-4*8^0$ $=(36000)8 - (00004)_8$ Now, $-(0004)_8$ = 8's complement of $(00004)_8$ 8's complement of $(00004)_8$ = 7's complement of $(00004)_8$ + 1 7's complement of $(00004)_8$ = $(77777)_8 - (00004)_8 = (77773)_8$ 8's complement of $(00004)_8$ = $(77773)_8+1 = (77774)_8$ So, $=(36000)_8 - (00004)_8 = (36000)_8 + (77774)_8$ 3 6 0 0 0 7 7 7 7 4 __________ 3 5 7 7 4 How? the last 3 bits addition is okay. 6+7=13 = 1*8^1 + 5*8^0 so $(15)_8$, 5 is the sum and 1 is the carry here. 1+3+7=11= 1*8^1+3*8^3 = $(13)_8$ where 3 is the sum 1 is the carry. Discard the carry. So, $(35774)_8$ Now expanding it in binary, 011 101 111 111 100 , we have 11 1's. Reason to discard the carry https://stackoverflow.com/questions/22049866/why-should-i-discard-carry-out-in-adding-binary-numbers Correct me if I am wrong 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes Given $3*4096-4+6*512$ Rewrite it as $3*8^{4}+6*8^{3}-4*8^{0}$ $(36000){_{8}}-(4){_{8}} $ $=(35774){_{8}}$ Convert it into binary $=(011 \ 101\ 111\ 111\ 100){_{2}}$ Number of 1's is 11 Ashwani Kumar 2 answered Dec 25, 2018 Ashwani Kumar 2 comment Share Follow See all 0 reply Please log in or register to add a comment.