X plus binary inverted x - MATLAB Cody - MATLAB Central

Problem 43103. X plus binary inverted x

Difficulty:Rate

Given a n-bits number x, what is the sum of x to the binary inverted version of x? (this might be more simple than you think :-) )

in example:

 n = 8
 x = 1 (00000001)
 n-bit binary inverted x = 254 (11111110)
 then y = 255

Solution Stats

74.68% Correct | 25.32% Incorrect
Last Solution submitted on Jul 19, 2025

Solution Comments

Show comments

Problem Recent Solvers46

Suggested Problems

More from this Author25

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!