Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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++
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started