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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:59:30+00:00 2026-05-30T21:59:30+00:00

With unsigned char you can store a number from 0 to 255 255 (b10)

  • 0

With unsigned char you can store a number from 0 to 255

255(b10) = 11111111(b2)             <=    that’s 1 byte

This will make it easy to preform operations like +,-,*…

Now how about:

255(b10) = 10101101(b2)

Following this method will make it possible to represent up to 399 using unsigned char?

399(b10) = 11111111(b2)

Can someone propose an algorithm to preform addition using the last method?

  • 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-05-30T21:59:31+00:00Added an answer on May 30, 2026 at 9:59 pm

    With eight bits there are only 256 possible value (28), no matter how you slice and dice it.

    Your scheme to encode digits in a 2-3-3 form like:

    255 = 10 101 101
    399 = 11 111 111
    

    ignores the fact that those three-bit sequences in there can only represent eight values (0-7), not ten (ie, that second one would be 377, not 399).

    The trade-off is that this means you gain the numbers '25[6-7]' (2 values) '2[6-7][0-7]' (16 values) and '3[0-7][0-7]' (64 values) for a total of 82 values.

    Your sacrifice for that gain is that you can no longer represent any numbers containing 8 or 9: '[8-9]' (2 values), '[1-7][8-9]' (14 values), '[8-9][0-9]' (20 values), '1[0-7][8-9]' (16 values), '1[8-9][0-9]' (20 values) or '2[0-4][8-9]' (10 values), for a total of 82 values.

    The balance there (82 vs. 82) shows that there are still only 256 possible values for an eight-bit data type.

    So your encoding scheme is based on a flawed premise, which makes the second part of your question (how to add them) irrelevant, I’m afraid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i got a question about unsigned char array. How can i store an integer
when I read from stdin like this: size_t bufSize = 1024; unsigned char inputBuffer[bufSize];
How can I convert the following struct to unsigned char* ? typedef struct {
I have unsigned char* , want to convert it to std::string . Can you
I can understand the difference between a signed char and an unsigned one. But
I have a incoming stream of bytes (unsigned char) from either a file or
I need to store large amounts of unsigned char s and/or int s (potentially
I've got these two structs that I need to store in files. I can't
I've got these two structs that I need to store in files. I can't
I want to initialize an unsigned char * buffer of length 1500 so that

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.