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

  • Home
  • SEARCH
  • 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 9207773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:27:41+00:00 2026-06-18T00:27:41+00:00

I have a 16 bit field in flash memory in which to store an

  • 0

I have a 16 bit field in flash memory in which to store an 8-bit number (more specifically, a value in the closed range from 0 to 254). I’d like to use the extra 8+ bits for error checking (error correction not needed), and the most obvious approach is simply repeat the value twice. Only slightly less obvious is the XMODEM packet number approach: store the number in the first octet, and 255 minus the number in the second octet.

Are there any better options that will provide more robust error detection in the available space and that are simple to implement and fast to execute? Perhaps the fact that flash bits are more likely to go from 1 to 0 than 0 to 1 can be taken advantage of?

  • 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-18T00:27:42+00:00Added an answer on June 18, 2026 at 12:27 am

    Note up front: I think the XMODEM approach is reasonable, so I’d take that and get to work on something more important. Anyhow, you tagged this question with algorithm, so you can also approach this in a way that proves this…

    Since you want error detection, the most important part is that any changing a single bit can be detected, so two representations of the number must not be just a single bit apart, preferable they are as far apart as possible. Further, not every change to a bit is equally likely to occur.

    If you model this as a graph, you will get vertices identified by a 16-bit number and directed edges between two vertices that define the probability of that transition. This will be a complete graph, so think about how you store it (if you store it at all instead of computing it on demand). What you are now searching for is a circular path of exactly 255 vertices with a maximum weight.

    For that, just search for any circular path with 255 vertices, using DFS with a tendency to heavy edges. From this circle, take its lightest edge and remove all non-heavier edges from the graph. Then, repeat searching for a graph in the resulting (possibly disconnected!) graph, until you can’t find one any more.

    Finally, map your input values to vertex IDs of (one of) the remaining circles to store them in your flash memory.

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

Sidebar

Related Questions

I have a bit of an interesting predicament. I have an :ingredients field which
In a sql table I have a bit field and the value is displayed
Let's say i have this bit field value: 10101001 How would i test if
I have a bit field consisting of 64 bits: long bitfield = 0; I
Bit of an unusual question, but I have setup a field inside a MySQL
Have a bit of confusion here. I added a few objects from a class
I have a uint32 variable for some bit field flag state and an enum
Question says it all. If I have this for a 96-bit field: uint32_t flags[3];
In TCP/IP, the port number is specified by a 16-bit field, yielding a total
I have a bit of code where you can add a new field using

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.