CircuitGate Type
This type provides basic gates for implementing circuits of finite type Quartz expressions. For the encoding of NatExpr and IntExpr, we use radix-2 and 2-complement numbers which are represented by lists of boolean variables [b[0],...,b[n-1]] where b[0] is the least significant bit. We also have word-level gates that obtain bitvectors with the same type. The outputs of these gates are generated by their abbreviation in the circuit map which associates each gate with a BoolExpr list which are its outputs. In particular, we have:
- NOT(b) = [!b]
- AND(b1,b2) = [b1∧b2]
- XOR(b1,b2) = [b1⊕b2]
- OR(b1,b2) = [b1∨b2]
- HA(b1,b2) = [b1⊕b2;b1∧b2]
- FA(b1,b2,cIn) = [b1⊕b2⊕cIn;b1∧b2∨cIn∧(b1⊕b2)]
- PG(g1,p1,g2,p2) = [g2∨(p2∧g1);p2∧p1]
- BvNOT(bv) = [!bv[0]..!bv[n-1]]
- BvAND(bv1,bv2) = [b1[0]∧b2[0]..b1[n-1]∧b2[n-1]]
- BvXOR(bv1,bv2) = [b1[0]⊕b2[0]..b1[n-1]⊕b2[n-1]]
- BvOR(bv1,bv2) = [b1[0]∨b2[0]..b1[n-1]∨b2[n-1]]
- bv2nat(BvHA(bv1,bv2)) = bv2nat(bv1)+bv2nat(bv2)
- bv2nat(BvFA(bv1,bv2,cIn)) = bv2nat(bv1)+bv2nat(bv2)+bv2nat(cIn)
- MX(c,bv0,bv1) = [(c?bv1[0]:bv0[0]);...;(c?bv1[n-1]:bv0[n-1]);]
- SW(c,bv0,bv1) = [(c?bv1[0]:bv0[0]);...;(c?bv1[n-1]:bv0[n-1]); (c?bv0[0]:bv1[0]);...;(c?bv0[n-1]:bv1[n-1])]
Instance members
| Instance member |
Description
|
Full Usage:
this.IsAND
Returns: bool
|
|
Full Usage:
this.IsBvAND
Returns: bool
|
|
Full Usage:
this.IsBvFA
Returns: bool
|
|
Full Usage:
this.IsBvHA
Returns: bool
|
|
Full Usage:
this.IsBvNOT
Returns: bool
|
|
Full Usage:
this.IsBvOR
Returns: bool
|
|
Full Usage:
this.IsBvXOR
Returns: bool
|
|
Full Usage:
this.IsFA
Returns: bool
|
|
Full Usage:
this.IsHA
Returns: bool
|
|
Full Usage:
this.IsMX
Returns: bool
|
|
Full Usage:
this.IsNOT
Returns: bool
|
|
Full Usage:
this.IsOR
Returns: bool
|
|
Full Usage:
this.IsPG
Returns: bool
|
|
Full Usage:
this.IsSW
Returns: bool
|
|
Full Usage:
this.IsXOR
Returns: bool
|
|
F#
Averest