Problem 2678. Find out sum and carry of Binary adder
Find out sum and carry of a binary adder if previous carry is given with two bits (x and y) for addition.
Examples
Previous carry is 1 and x=y=1. Addition is 1 and carry is also 1.
Previous carry is 0 and x=y=1. Addition is 0 and carry is also 1.
Previous carry is 0 and x=1, y=0. Addition is 1 and carry is also 0.
Solution Stats
Problem Comments
-
3 Comments
You should maybe test all the truth table no ?
Some of the top solutions have made a solution only for test cases, This should be fixed.
???
Solution Comments
Show commentsProblem Recent Solvers1486
Suggested Problems
-
Select every other element of a vector
32986 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
3169 Solvers
-
Flag largest magnitude swings as they occur
678 Solvers
-
Calculate the area of a triangle between three points
2939 Solvers
-
330 Solvers
More from this Author70
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!