Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
zkevm-circuits
zkevm-circuits
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

新注册的用户请输入邮箱并保存,随后登录邮箱激活账号。后续可直接使用邮箱登录!

  • zkp
  • zkevm-circuitszkevm-circuits
  • Wiki
    • Zkevm docs
    • 4 core
  • core add

core add · Changes

Page history
docs: update the core addmod section --story=1018296 authored Jul 26, 2024 by chenxuanhui's avatar chenxuanhui
Hide whitespace changes
Inline Side-by-side
Showing with 18 additions and 18 deletions
+18 -18
  • zkevm-docs/4-core/core-add.markdown zkevm-docs/4-core/core-add.markdown +18 -18
  • No files found.
zkevm-docs/4-core/core-add.markdown
View page @ ff76e4dd
......@@ -6,24 +6,7 @@
具体操作:从栈顶弹出两个值a和b,进行整数加法(mod 2^256),将结果存进栈。
示例具体操作流程如下:
**初始状态**:
- 栈内容:`[a, b]`
- 其中,`a` 和 `b` 是256位整数,`a` 在栈顶,`b` 在栈顶下方。
**操作步骤**:
- **弹出值**:从栈中弹出两个值 `a` 和 `b`。此时栈变为空。
- **计算**:执行加法操作:`result = (a + b) % 2^256`。这个操作确保结果始终保持在256位整数范围内。
- **推入结果**:将计算得到的结果 `result` 推入栈中。
**最终状态**:
- 栈内容:`[result]`
evm中trace示例:
trace示例:
```code
// Example 1
......@@ -41,6 +24,23 @@ ADD
由于在evm中`ADD`指令会自动从栈中弹出两个操作数并将结果推入栈中,所以在trace中没有显式的`POP`操作。
示例具体操作流程如下:
**初始状态**:
- 栈内容:`[a, b]`
- 其中,`a` 和 `b` 是256位整数,`a` 在栈顶,`b` 在栈顶下方。
**操作步骤**:
- **弹出值**:从栈中弹出两个值 `a` 和 `b`。此时栈变为空。
- **计算**:执行加法操作:`result = (a + b) % 2^256`。这个操作确保结果始终保持在256位整数范围内。
- **推入结果**:将计算得到的结果 `result` 推入栈中。
**最终状态**:
- 栈内容:`[result]`
### Witness Core Row
core row中的表格设计如下:
......
Clone repository
  • basics
    • evm
    • halo2
  • code notes
    • binary_number_with_real_selector
    • how to use macro
    • simple_lt
    • simple_lt_word
  • Home
  • image
  • zkevm docs
    • 1 introduction
    • 10 public
    • 11 fixed
    • 12 exp
    • 13 keccak
    • 14 comparisons
    • 15 differences
View All Pages

Copyright © 2024 ChainWeaver Org. All Rights Reserved. 版权所有。

京ICP备2023035722号-3

京公网安备 11010802044225号