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 8847681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:14:52+00:00 2026-06-14T12:14:52+00:00

I need to convert symbols to bits so that every 2 symbols = 1

  • 0

I need to convert symbols to bits so that every 2 symbols = 1 byte = 8 bits.
For example, if user input is RR then there should be 00001100 as result. (just an example)

  • 1 1 Answer
  • 0 Views
  • 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. Editorial Team
    Editorial Team
    2026-06-14T12:14:54+00:00Added an answer on June 14, 2026 at 12:14 pm

    So, if I understood your question, there’re two options to resolve then: The easy or the hard way.

    Easy:

    • First of all, you need know if the literal to be used is a hexademical value.
    • You can create a Sorted map that’s represent the ASCII table, using the key 0-9 | A-H and the value represent your binary number.

    Example:

    SortedMap<Character, String>
    lo_binary = new TreeMap<Character, String>();
    lo_binary.put('0', "0000");
    lo_binary.put('1', "0001");
    lo_binary.put('2', "0010");
    lo_binary.put('3', "0011");
    lo_binary.put('4', "0100");
    lo_binary.put('5', "0101");
    lo_binary.put('6', "0110");
    lo_binary.put('7', "0111");
    lo_binary.put('8', "1000");
    lo_binary.put('9', "1001");
    lo_binary.put('A', "1010");
    lo_binary.put('B', "1011");
    lo_binary.put('C', "1100");
    lo_binary.put('D', "1101");
    lo_binary.put('E', "1110");
    lo_binary.put('F', "1111");
    
    • Read the two symbols and try find your binary code into Sorted Map.
    • Stores the result into a String

      String ls_symbols = “AA”;
      String ls_result = ” “;

      for (int ln=0; ln < ls_symbols.lenght(); ln++) {
      ls_result += lo_binary.get(ls_symbols.charAt(ln));
      }

      System.out.println(ls_result); // AA -> 10101010

    Hard:

    • First of all, you need know if the literal to be used is a hexademical value.
    • Converts a literal with hexadecimal characters to byte[].
    • Converts the byte[] to boolean[]
    • The result is true = 1 and false = 0

    Example:

    // Do you have a literal A. This literal represents in binary the value 1010. Do you have // use the operator >>> and & to change the binary value to boolean value

    1010
    boolean = (1010 & 1000) == 1000 // (1000 = represents 0x80)
    boolean = true (1);
    
    1010 >>> 0100
    boolean = (0100 & 1000) == 0000
    boolean = false (0);
    
    0100 >>> 1000
    boolean = (1000 & 1000) == 1000
    boolean = true (1);
    
    1000 >>> 0000
    boolean = (0000 & 1000) == 0000
    boolean = false (0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UTF8 string that contains non-English symbols. I need to convert them
I need to convert a column data into single row with multiple columns Example
I need to convert a byte[] of size 4 to type long for my
I need to convert values of type T into JsArray . For example, I
I need to convert any special symbols coming through in my json file to
I have a string contains 64 binary symbols. I need to convert it into
I need to convert an picture to an object file(.o) use sde-objcopy, then I
I have a number of byte[] array variables I need to convert to string
I need convert arabic letters in htmlentities symbols. Codepage: ISO-8859-1. سك - this is
I need to convert a list of ticker symbols: T GOOG KO PEP as

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.