Question: 2. Binary Addition of Integers: Given two integers a and b, their binary expansions are shown below. a = (an-14n-2...2100)2, b = (bn-bn-2 ...bibo)2 To

 2. Binary Addition of Integers: Given two integers a and b,

2. Binary Addition of Integers: Given two integers a and b, their binary expansions are shown below. a = (an-14n-2...2100)2, b = (bn-bn-2 ...bibo)2 To compute the sum of a and bin binary form, add the corresponding pairs of bits with carries when they occur. . First add their rightmost bits. This gives do + bo = co2+ So, O So is the rightmost bit in the binary expansion of a + b and Co is the carry. Then add the next pair of bits and the carry. . aj + b + co=c]2+ si O si is the next bit (from the right) in the binary expansion of a +b, and O ci is the carry. . Continue this process, adding the corresponding bits in the two binary expansions and the carry, to determine the next bit from the right in the binary expansion of a + b. . At the last stage, An-1 + bn-1 + Cn-2 = Cn-1 2 + Sn-1 The leading bit of the sum is sn = Cn-1. This procedure produces the binary expansion of the sum, Cn Cn-2 CC. (an-jan-2...000 bn-1bn-2 ...bybo Sn-1 Sn-2 S, S. Write pseudocode for adding two integers in binary expansions formally. Store the two binary integers and their sum in arrays. Illustrate your algorithm using this following two integers: a = (1110)2 and b = (1011)2. You must show/explain your work. Simply stating the answers will result in 0 points awarded. (10 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!