Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Add (10111)2and (11010)2by working through each

step of the algorithm for addition given in the text.

Short Answer

Expert verified

110001

Step by step solution

01

Step 1:

Note that n = 5. Initially the carry is c = 0 , and we start the for loop with j = 0. Since a0=1and b0=0, we set d to be floor of (100)/2=0then so=1+0+020which equals 1 ,and finally c = 0. At the end of the first pass , then , the right - most digit of the answer has been determined ( it's a 1 ) , and there is a carry of 0 into the next column .

Now j = 1 and we computed to be floor of a1+b1c/2=floor of (1+1+0)/2

whereupon s1becomes 1+1+021=0 and c is set to 1. Thus far we have determined that the last two bits of the answer are 01 ( from left to right ) , and there is a carry of 1 into the next column .

The next three passes through the loop are similar . As a result of the pass when j = 2 we set d = 1 , s2= 0 and then c = 1 .When c = 1, we obtain d=1,s4=1and then c = 1 . Finally , when j = 4, we obtain c=1and then s5=1. At this point the loop is terminated , and when we execute the final step , 11 0001. Thus the answer is.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free