Nicholas
Nicholas

Reputation: 679

tricky binary multiplication

I attempted to multiply binary 1111 as first input and 1111 as second input. When I multiply as usual I came across having to do the addition below I encounter having to carry the 1 with the three 1's which would mean 4 in binary with 2 bits. But that's impossible to represent 4 in 2 bits for this multiplication problem.

Upvotes: 1

Views: 1525

Answers (2)

Guffa
Guffa

Reputation: 700372

If you want to add multiple binary values, then you just carry whatever is left over after adding a column, regardless of how many bits you need to represent the carry.

It's just like doing the decimal add 99+99+99+99+99+99+99+99+99+99+99+99, when adding the least significant column, you end up with 108, so you carry 10 eventhough it's too large to fit in a single digit.

Likewise, if you add the binary 11+11+11+11+11 you end up with 101 when adding the least significant column, so you carry 10.

However, normally you only add two binary numbers at a time, as that lets you get away with using a single bit for carry.

Upvotes: 2

starwing123
starwing123

Reputation: 3543

What you have to do is carry the numbers over another digit.

Take the scenario: 11 +11 +11


you would have 1001 as your answer because 4 in binary is 100. Simply carry over the 1s into the correct place.

Upvotes: 1

Related Questions