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

Commit

Permalink
Add back change.
Browse files Browse the repository at this point in the history
  • Loading branch information
msoeken committed Aug 24, 2023
1 parent 737c4b1 commit 9a86ec0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,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 (you can learn more about these constants and why it works [on this article in Wikipedia](https://en.wikipedia.org/wiki/Hamming_weight#Efficient_implementation))."
"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 (you can learn more about these constants and why it works [on this article in Wikipedia](https://en.wikipedia.org/wiki/Hamming_weight#Efficient_implementation))."
]
},
{
Expand Down

0 comments on commit 9a86ec0

Please sign in to comment.