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
  • 8 arithmetic

8 arithmetic · Changes

Page history
style: adjustment format authored Jan 08, 2024 by xiaoranlu's avatar xiaoranlu
Hide whitespace changes
Inline Side-by-side
Showing with 10 additions and 8 deletions
+10 -8
  • zkevm-docs/8-arithmetic.markdown zkevm-docs/8-arithmetic.markdown +10 -8
  • No files found.
zkevm-docs/8-arithmetic.markdown
View page @ cd9a1573
...@@ -159,14 +159,16 @@ define ...@@ -159,14 +159,16 @@ define
- c = if pop2.is_zero() { pop1 } else { push } - c = if pop2.is_zero() { pop1 } else { push }
- d = pop1 - d = pop1
``` ```
- a_abs,b_abs,c_abs,d_abs a_abs,b_abs,c_abs,d_abs
```
关于补码的相关约束如下 ```
- x_abs_lo == lo when x >= 0 关于补码的相关约束如下
- x_abs_hi == hi when x >= 0 - x_abs_lo == lo when x >= 0
- sum == 0 when x < 0 (小于0证明存在补码,同时我们有x+x_abs = 1 <<256。x + x_abs 约束请参考add部分) - x_abs_hi == hi when x >= 0
- carry_hi == 1 when x < 0 - sum == 0 when x < 0 (小于0证明存在补码,同时我们有x+x_abs = 1 <<256。x + x_abs 约束请参考add部分)
``` - carry_hi == 1 when x < 0
```
- mul_add_words (请参考mul部分约束内容) - mul_add_words (请参考mul部分约束内容)
- abs(remainder) < abs(divisor) when divisor != 0 - abs(remainder) < abs(divisor) when divisor != 0
- mul_add_words中的carry_hi == 0 - mul_add_words中的carry_hi == 0
......
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号