Description
Multiply elementCount by elementBytes using exact integers and add baseAddress.
Address calculations distinguish an occupied last byte from an exclusive end, and alignment rounds to a defined boundary. Element counts and byte counts are not interchangeable.
Multiply elementCount by elementBytes using exact integers and add baseAddress.
When to use this tool
Use Microcontroller: DMA Circular Buffer End Address when you need an explicit address, alignment, page, or transfer-count mapping.
How to use the tool and how it works
- Enter baseAddress, elementCount, elementBytes, addressBits. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Multiply elementCount by elementBytes using exact integers and add baseAddress. Require endExclusive at most 2^addressBits; return the final byte address or baseAddress with empty true for zero elements.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| baseAddress | Base Address | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| elementCount | Element Count | Required. Safe integer. |
| elementBytes | Element Bytes | Required. Safe integer. |
| addressBits | Address Bits | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.endExclusive | End boundary excluded from the represented span. | Calculated result member: string. |
| result.lastByteAddress | Last occupied byte address; equals baseAddress as a placeholder when empty is true. | Calculated result member: string. |
| result.empty | Whether the represented collection or span has no occupied elements. | Calculated result member: boolean. |
{
"input": {
"baseAddress": "100",
"elementCount": 4,
"elementBytes": 2,
"addressBits": 16
},
"output": {
"result": {
"endExclusive": "108",
"lastByteAddress": "107",
"empty": false
}
}
} Limitations and assumptions
- An exclusive end may equal the address-space limit. For an empty buffer, lastByteAddress is a placeholder and does not identify an occupied byte.
- Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Validate the resulting span against actual memory bounds and device-specific access and transfer rules.
References
Similar or alternative tools
- DMA Fixed Source Increment Target Address
Keep the nonnegative source address fixed.
- Microcontroller: DMA Element Count Vs Byte Count
Divide byteCount by bytesPerElement for completeElements and remainingBytes.