Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 47345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:06:30+00:00 2026-05-10T16:06:30+00:00

curious if anyone might have some insight in how I would do the following

  • 0

curious if anyone might have some insight in how I would do the following to a binary number:

convert

   01+0 -> 10+1 (+ as in regular expressions, one or more)     01 -> 10       10 -> 01   

so,

10101000010100011100 01010100101010100010 

and to clarify that this isn’t a simple inversion:

000000100000000000 000001010000000000 

I was thinking regex, but I’m working with binary numbers and want to stay that way. The bit twiddling hacks page hasn’t given me any insight either. This clearly has some essence of cellular automata. So, anyone have a few bit operations that can take care of this? (no code is necessary, I know how to do that).

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:06:30+00:00Added an answer on May 10, 2026 at 4:06 pm

    Let’s say x is your variable. Then you’d have:

    unsigned myBitOperation(unsigned x) {     return ((x<<1) | (x>>1)) & (~x); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick one: I'm curious if anyone knows of certain circumstances under which $_SERVER['REQUEST_URI'] would
I am curious to know whether anyone out there have tried mixing node.js headless
Does anyone know any more details about google's web-crawler (aka GoogleBot)? I was curious
Curious if anyone has opinions on which method would be better suited for asp.net
I am curious if anyone has some thoughts on whether or not moving to
I'm curious if anyone knows of any downloadable Objective C sample code for the
I am curious if anyone has done a comparison between the different options out
I'm curious if anyone knows of a way to easily get a double border
I was curious if anyone knows of any good examples of plugins that I
So I'm just learning Forth and was curious if anyone could help me understand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.