Question: Java* Two binary numbers can be added digit by digit, performing the calculation from the right to the left, almost like decimal numbers. The addition
Java*
Two binary numbers can be added digit by digit, performing the calculation from the right to the left, almost like decimal numbers. The addition rules required are 0 + 0 = 0, 0 + 1 = 1 + 0 = 1, 1 + 1 = 0 and a carry of 1 to the next column, and 1 + 1 + 1 = 1 and a carry of 1 to the next column. Write a program to read 40 0s and 1s representing two 20-bit binary numbers, add these numbers together, and print out the result in binary. For example, demonstrate that if the two numbers are 00101010101101111001 and 00101110110110100110 then the result should be 01011001100100011111
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
