Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk3 min

Constant-Ratio Code: Meaning, Examples, and Error-Checking Limits

A constant-ratio code gives every valid bit pattern a fixed balance of 1s and 0s, making single-bit errors easy to detect but not all multi-bit errors.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A constant-ratio code is a digital code in which every valid codeword has a fixed ratio of 1 bits to 0 bits. A receiver can check a character by counting its bits: a count that breaks the rule marks the codeword as invalid. This simple check detects every single-bit inversion, but it can miss some errors involving multiple bits.

How a constant-ratio code works

The code assigns data only to bit patterns that meet a prescribed balance rule. In common fixed-weight codes, each codeword has the same number of 1s. If all codewords have the same length, they consequently have the same number of 0s as well.

As an Amazon Associate I earn from qualifying purchases.

For example, if a code requires four 1s in every eight-bit character, the receiver counts the 1s in each received character. Four 1s satisfies the count rule; any other count fails it. This is a validity check, not a way to decode an arbitrary pattern into data: only the designated valid patterns represent characters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What errors the count detects

Single-bit inversions

Changing one bit from 0 to 1 increases the number of 1s by one; changing one from 1 to 0 decreases it by one. Either change breaks the fixed-weight rule, so every single-bit inversion in a character is detected.

Multiple-bit errors

Some multiple-bit errors also change the count and are detected. But if an error changes a 0 to 1 and a 1 to 0, the total number of 1s stays the same. Such a pattern can turn one valid codeword into another valid codeword and pass the count check. The method detects odd-numbered bit errors within a character, but some even-numbered errors remain undetected.

Detection is not correction

A failed count tells the receiver that the character violates the rule; it does not identify which bit is wrong. The count check alone therefore cannot correct the character. And when an error changes one valid codeword into another, the check provides no indication that an error occurred.

Examples: 4-of-8 and 3-of-7

The number of valid fixed-weight patterns depends on which bit positions carry 1s. For a word of length n with k ones, the number of possible patterns is the number of ways to choose k positions from n, written n choose k.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Code Rule for each valid word Valid patterns
4-of-8 Eight bits: four 1s and four 0s 70
3-of-7 Seven bits: three 1s and four 0s 35

These counts are the number of available codewords, not measurements of real-world error rates. They illustrate the capacity cost: a fixed-ratio rule makes only some of the possible bit patterns available for representing characters.

The capacity trade-off

With no constraint, an n-bit word can represent 2n patterns. A fixed-weight rule keeps only the patterns with the required number of 1s. For example, a 4-of-8 code has 70 valid patterns rather than all 256 possible eight-bit patterns. The restriction gives the receiver a simple built-in check, but leaves fewer patterns for data.

For a given set of symbols, that can mean transmitting more bits per character than an unconstrained representation, or accepting a smaller set of representable characters at a fixed word length. The appropriate comparison with another error-checking method is therefore not just whether it detects errors, but which error patterns it catches, whether it can locate or correct an error, how much redundancy it uses, and how many symbols remain representable.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Terminology

“Constant-ratio code” and “fixed-ratio code” describe the constraint on the balance of the bit values. Fixed-weight examples are a common form: every codeword has a fixed number of 1s. The USPTO’s Class 714, subclass 806, uses the term “Constant-ratio code (m/n)” for subject matter using a constant ratio between two logic states to enable error or fault detection.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.