Question: programming languages: C++ In this assignment you must not use your programming language support (nor any libraries) for arbitrary length arithmetic. Design and implement an

programming languages: C++

programming languages: C++ In this assignment you must not use your programming

In this assignment you must not use your programming language support (nor any libraries) for arbitrary length arithmetic. Design and implement an algorithm that takes two non-negative binary integers x and y and adds them up producing a binary number x + y. The binary numbers should be represented as vectors (sequences) of digits. Each entry of the vector should represent a single digit the leftmost being the least significant one. For example, the vector [0, 1, 1, 0, 0, 0, 1, 1, 1] represents the binary number 111000110. Test your program by adding the following pairs of numbers: 1. x = [0, 1, 1, 0, 0, 0, 1, 1, 1] and y = [1, 1, 1, 1, 0, 1 ,1, 0, 1] 2. x = [1, 0, 0, 1 , 1 ,0, 0, 0, 1, 1, 1] and y = [0, 1, 1, 0, 1] 3. x = [1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 ,0, 1, 1, 1] and y = [1, 0, 1, 0, 1, 0, 1, 0 1, 0, 1, 0 1, 0, 1]

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!