Skip to content

Commit

Permalink
Merge pull request #1192 from 0xPolygonMiden/bobbin-field-docs
Browse files Browse the repository at this point in the history
Explanation of field arithmetic
  • Loading branch information
bobbinth authored Jan 11, 2024
2 parents 78608e5 + 88779a1 commit b0e8450
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/src/user_docs/assembly/field_operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ If the error code is omitted, the default value of $0$ is assumed.

### Arithmetic and Boolean operations

The arithmetic operations below are performed in a 64-bit [prime filed](https://en.wikipedia.org/wiki/Finite_field) defined by modulus $p = 2^{64} - 2^{32} + 1$. This means that overflow happens after a value exceeds $p$. Also, the result of divisions may appear counter-intuitive because divisions are defined via inversions.

| Instruction | Stack_input | Stack_output | Notes |
| ------------------------------------------------------------------------------ | ----------- | ------------- | ------------------------------------------------------------------------------------------------------------ |
| add <br> - *(1 cycle)* <br> add.*b* <br> - *(1-2 cycle)* | [b, a, ...] | [c, ...] | $c \leftarrow (a + b) \mod p$ |
Expand Down

0 comments on commit b0e8450

Please sign in to comment.