diff --git a/docs/assets/images/1-bit-fa b/docs/assets/images/1-bit-fa new file mode 100644 index 0000000..549874f Binary files /dev/null and b/docs/assets/images/1-bit-fa differ diff --git a/docs/assets/images/ripple-adder b/docs/assets/images/ripple-adder new file mode 100644 index 0000000..bdecdd4 Binary files /dev/null and b/docs/assets/images/ripple-adder differ diff --git a/src/AoC_2024/Dazbo's_Advent_of_Code_2024.ipynb b/src/AoC_2024/Dazbo's_Advent_of_Code_2024.ipynb index 3fd3e5c..228a06c 100644 --- a/src/AoC_2024/Dazbo's_Advent_of_Code_2024.ipynb +++ b/src/AoC_2024/Dazbo's_Advent_of_Code_2024.ipynb @@ -9203,10 +9203,26 @@ " = 55098960190400\n", "```\n", "\n", - "I think this is too big to brute force!\n", + "This is too big to brute force!\n", "\n", "#### Solution Approach\n", "\n", + "Instead, we need to understand what the input data is telling us. The input data contains many AND, OR and XOR instructions, where each instruction takes two input values and produces an output value. Many of these outputs are intermediate inputs to subsequent instructions.\n", + "\n", + "It turns out that these instructions are demonstrating a _ripple adder circuit_. A ripple carry adder is a series of 1-bit adders, where each adder:\n", + "\n", + "- Takes two 1 bit inputs (let's call them `x` and `y`) and a carry input (Cin).\n", + "- Generates a single _sum_ output.\n", + "- Generates a single carry output (Cout).\n", + "\n", + "A single adder looks like this:\n", + "\n", + "\"Full\n", + "\n", + "So we can implement a multi-bit ripple adder like this:\n", + "\n", + "\"Ripple\n", + "\n", "Let's turn our input data into single line readable instructions, for each output. We can use this to look for anomalies.\n", "\n", "And we can visualise it too.\n" @@ -9214,7 +9230,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 79, "metadata": {}, "outputs": [], "source": [