Skip to content

Add unit-test for LRM 3.0 Section 8.7 "Bit sizes for numeric expressions" #39

@LeeKaiXuan

Description

@LeeKaiXuan

Rules

Expression Bit size Comments
Unsized constant number At least 32 Suggest 65 bits
Sized constant number As specified
i op j, where op is: + - * / % & | ^ max(L(i),L(j))
op i, where op is: + - ~ L(i)
op i, where op is: & | ^ 1
i op j, where op is: >> << ** L(i) j is self-determined
i ? j : k max(L(j),L(k)) i must be Boolean
cast, where casting_type is an integer type L(casting_type)
  • Unsized unbased decimal and octal numbers are signed.
  • Unsized unbased hexadecimal numbers are unsigned.
  • Based numbers are unsigned, except when they are designated as signed with the 's notation (e.g., 4'sd12).
  • Bit-select results are unsigned, regardless of the operands.
  • Part-select results are unsigned, regardless of the operands, even if the part-select specifies the entire width.
  • If any context-determined operand of an expression is unsigned, the result is unsigned regardless of the operators.
  • If all context-determined operands of an expression are signed, the result is signed regardless of the operators, unless specified otherwise.

Metadata

Metadata

Assignees

Labels

testAdding new or improve test case

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions