CheckEmoji Community · the emoji forum
🏠 Home 🆕 What's new ❓ Unanswered 🔥 Popular 📡 RSS Members 👥 0 online log in · register
Home › IT › IT Support › Two's Complement Explained

Two's Complement Explained

Started by Taylor Miller2 · · 👁 3 views · 1 reply

📡 Subscribe to replies

Participants Taylor Miller2feralskipper5
Taylor Miller2 Taylor Miller2 NewcomerOP
1 message
joined Dec 2017
#1 ·
Anyone know how to tackle this one?

If we're using 6 bits for two's complement representation, what's the result of 25+27?
feralskipper5 feralskipper5 Newcomer
5 messages
joined Nov 2017
#2 ·
011001
011011+
110100
->using two's complement, that first bit is just the sign bit—so in this case, we're looking at -32
basically 110100 = -32+16+4 = -12
or if you prefer the other way, just pick whichever method feels faster once you get the hang of it—both work fine
Here’s the drill: flip all the bits, add one, then swap the sign at the end
1. 001011+1=001100 and then flip the sign to get -001100, which is -12 in decimal

WATCH OUT: you might end up with a number that actually needs more than 6 bits to store—meaning you hit an overflow—in that case, just toss that extra bit and carry on like normal

You must log in or register to reply here.

Log in Register

🔗 Similar threads