Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I use Excel to convert from decimal to twos complement notation?

0
Posted

How do I use Excel to convert from decimal to twos complement notation?

0

Excel has a limited Binary capability. There is no direct conversion for 2’s compliment, there is not even an invert or exclusive or (XOR) function… Realize that two’s compliment is used to perform subtraction of a binary number by using addition of a two’s compliment number…. So do the following in Excel: The A column will be used for decimals and the B column for Binary in cell A1 enter 255 in cell B1 enter the formula =DEC2BIN(A1) Copy cells A1 & B1 into the next three rows Realize that to invert bits in an 8 bit word you would perform an XOR of your number 180(b10110100) with 255 (b11111111) Since Excel doesn’t have an XOR you can do a subtraction to get the same bit result an XOR would have provided. 255 – 180 = 75 cell A1 = 255 Cell A2 = your 0 – 255 Number (180) and in binary b11111111 b10110100 ————- b01001011 note leading zero as place holder This answer is in cell A3 using formula = A1-A2 You have just performed a bit inversion…

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123