Skip to content

Main content

Random Boolean Adder Circuit Trace Generator

Generate independent half/full adder cells or an explicit least-significant-first ripple-carry trace with delegated bit answers.

Loading tool…

Description

Generate independent half/full adder cells or an explicit least-significant-first ripple-carry trace with delegated bit answers.

A generated practice exercise contains a prompt and an answer key under a specific rule set. A planted answer establishes one possible solution; only an explicit enumeration or uniqueness check establishes whether alternatives exist.

Generate independent half/full adder cells or an explicit least-significant-first ripple-carry trace with delegated bit answers.

When to use this tool

Use this generator to create reproducible boolean adder circuit trace cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.

How to use the tool and how it works

  1. Supply mode, bitCount, initialCarry in the field shapes below. Set seed when you need an explicit replay.
  2. Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
  3. Read bitOrder, steps, summary. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.

Draw Boolean input pairs and delegate half- or full-adder checks. In ripple mode feed each carry into the next bit; independent full mode draws a separate carry per cell. Return least-significant-first steps and cross-check the ripple integer total.1

Delegated operations used for this result: half adder sum carry checker; full adder majority carry checker. Their calculation or parsing conventions apply to the corresponding result fields.2, 3

Input fieldMeaning and unitsAccepted input
modeModeRequired. Text; one of "half", "full", "ripple".
bitCountBit CountRequired. Safe integer; minimum 1; maximum 32.
initialCarryInitial CarryRequired. Boolean.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
bitOrderBit OrderRequired. Text; exactly "least-significant-first".
stepsStepsRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 32.
steps[].bitIndexBit IndexRequired. Safe integer.
steps[].aARequired. Boolean.
steps[].bBRequired. Boolean.
steps[].carryInCarry InRequired. Boolean.
steps[].sumSumRequired. Boolean.
steps[].carryOutCarry OutRequired. Boolean.
summarySummaryRequired. Object; no unknown keys.
summary.leftValueLeft ValueRequired. Safe integer.
summary.rightValueRight ValueRequired. Safe integer.
summary.sumValueSum ValueRequired. Safe integer.
summary.finalCarryFinal CarryRequired. Boolean.
summary.rippleTotalRipple TotalRequired. Safe integer. or Null.
randomnessReplay source and normalized 32-bit seed, or null seed for an advancing context source.Required. Object; no unknown keys.
randomness.seedOptional safe-integer replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. Text; one of "context", "seed".

An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.

json
{
  "input": {
    "mode": "ripple",
    "bitCount": 4,
    "initialCarry": true,
    "seed": 42
  },
  "output": {
    "bitOrder": "least-significant-first",
    "steps": [
      {
        "bitIndex": 0,
        "a": true,
        "b": false,
        "carryIn": true,
        "sum": false,
        "carryOut": true
      },
      {
        "bitIndex": 1,
        "a": true,
        "b": true,
        "carryIn": true,
        "sum": true,
        "carryOut": true
      },
      {
        "bitIndex": 2,
        "a": false,
        "b": true,
        "carryIn": true,
        "sum": false,
        "carryOut": true
      },
      {
        "bitIndex": 3,
        "a": false,
        "b": true,
        "carryIn": true,
        "sum": false,
        "carryOut": true
      }
    ],
    "summary": {
      "leftValue": 3,
      "rightValue": 14,
      "sumValue": 2,
      "finalCarry": true,
      "rippleTotal": 18
    },
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • initialCarry is allowed only in ripple mode. Independent-cell sum bits are not generally the sum of two whole integers, so rippleTotal is null outside ripple mode; this does not simulate electrical timing or hardware hazards.
  • A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
  • The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.

Alternative or Complementary methods

For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.

References

  1. Tool behavior and example: Random Boolean Adder Circuit Trace Generator — tool.io

  2. Calculation or validation: logic/half-adder-sum-carry-checker — tool.io

  3. Calculation or validation: logic/full-adder-majority-carry-checker — tool.io

Similar or alternative tools

  • Random Boolean Equivalence Quiz Generator

    Generate complete aligned truth columns with an exact deliberate mismatch count and delegated equivalence keys under a declared valuation order.

  • Random Boolean Formula to CNF Exercise Generator

    Generate an exact-operator-count bounded Boolean syntax tree from supplied named variables/operators and delegate Tseitin CNF with named-variable mappings; random choices are conditional on remaining depth capacity, and auxiliary-variable CNF is equisatisfiable rather than the original-variable distributive expansion.