(no commit message)
[libreriscv.git] / openpower / sv / vector_ops.mdwn
index 1a69d92070cc2980debbb5d6aa30e5ee0487c546..a30694cd062a0b113e50025c83a077570d130781 100644 (file)
@@ -268,6 +268,28 @@ used not just for carry lookahead, also a special type of predication mask opera
   `((P|G)+G)^P`
 * <https://en.m.wikipedia.org/wiki/Carry-lookahead_adder>
 
+From QLSKY.png:
+
+```
+    x0 = nand(CIn, P0)
+    C0 = nand(x0, ~G0)
+
+    x1 = nand(CIn, P0, P1)
+    y1 = nand(G0, P1)
+    C1 = nand(x1, y1, ~G1)
+
+    x2 = nand(CIn, P0, P1, P2)
+    y2 = nand(G0, P1, P2)
+    z2 = nand(G1, P2)
+    C1 = nand(x2, y2, z2, ~G2)
+
+    # Gen*
+    x3 = nand(G0, P1, P2, P3)
+    y3 = nand(G1, P2, P3)
+    z3 = nand(G2, P3)
+    G* = nand(x3, y3, z3, ~G3)
+```
+
 ```
      P = (A | B) & Ci
      G = (A & B)