Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sonia Lopez <74979440+SoniaLopezBravo@users.noreply.github.com>
  • Loading branch information
msoeken and SoniaLopezBravo authored Aug 21, 2023
1 parent 9d7abcb commit 2bd9d50
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"metadata": {},
"source": [
"Finally, we are creating an entry point for resource estimation, in which we are\n",
"calling the carry-lookahead adder for a given bitwidth, which can be provided as\n",
"calling the ripple-carry adder for a given bitwidth, which can be provided as\n",
"an input argument. (We are considering the $n+1$ output register in this\n",
"notebook.)"
]
Expand Down Expand Up @@ -181,7 +181,7 @@
"\n",
"For example, the first carry bit can be computed as $c_1 = g_0 \\oplus (p_0 \\land c_0)$, since either it is generated from bits $x_0$ and $y_0$ (when both are 1, and therefore $g_0 = 1$) or the carry bit $c_0$ is propagated (if either $x_0$ or $y_0$ is 1, and therefore $p_0 = 1$). More significant carry bits are computed in a similar way, for example $c_3 = g_2 \\oplus (g_1 \\land p_2) \\oplus (g_0 \\land p_1 \\land p_2) \\oplus (c_0 \\land p_0 \\land p_1 \\land p_2)$. That is, $c_3$ is either generated from bits at index 2, or generated from bits at index 1 _and_ propagated from bits at index 2, and so on.\n",
"\n",
"In order to minimize AND gates, these intermediate products can be computed in a clever way, as well as in logarithmic depth. We are now looking at an implementation of the carry-lookahead adder in Q#, and start by implementing a helper function to compute the number of 1-bits an an integer, also called Hamming weight, using a compact implementation based on a sequence of bitwise manipulations."
"In order to minimize AND gates, these intermediate products can be computed in a clever way, as well as in logarithmic depth. We are now looking at an implementation of the carry-lookahead adder in Q#, and start by implementing a helper function to compute the number of 1-bits in an integer, also called Hamming weight, using a compact implementation based on a sequence of bitwise manipulations."
]
},
{
Expand Down

0 comments on commit 2bd9d50

Please sign in to comment.