Image processing - RDP algorithm

Introduction Recently I am working on a small to process hand written curve and come up with the RDP algorithm, which stands for Ramer–Douglas–Peucker algorithm. This is the iterative method to simpify the curve by recursively calculateing the distance between the curve, and leave the points that are far away from the curve, and this alogrith ends when the there are no points left. The input is a vector of points, and each step we search for all the points distance, and find hte maximum distance one, and then we recursively call the function for two sides. ...

March 20, 2026 · 3 min

Gdb skills - part 2

Keep sharing some gdb skills, more advanced. x.gdb Writing the gdb commands inside the x.gdb file so that we don’t need to spedify the commands every time. set logging on Usually the gdb outcome would not be stored, we can use set loging on, then the output would be stored in gdb.txt, this is useful when we need to print a lot of things, we can print them all in the log, then review the output later, or we can compare log in different runs. ...

March 17, 2026 · 2 min

Gdb skills - part 1

Today I like to share some gdb skills that I’ve learned in the pass few years. Break I think the most widely use is the breakpoint. We can do break in some function (as b funcA), or break at some line (as b classA.cpp:99). Some times adding hte condition for breaking is also useful (as b funcA if cnt == 10). Also this can ne done by cond, say this breakpoint is the third, we can do cond 3 cnt ==10. ...

March 13, 2026 · 2 min

Copilot with MCP & Skills

Recently I’m playing withe the copilot CLI (an agent), other counterparts include codeX CLI, claude code ,and gemini CLI. I’ve studied and played with AI agnet in n8n in my [https://linkingmon.github.com/n8n/](n8n repo) with n8n, and I think the most inportant compenents are: AI model: the model to do planning and understand the semantic of the input/output. memory: to store the contect for the converstaion. tools: this would conncets all kinds of tools like wolfram to do arhitmetric compuation, to query data from the wikipedia, etc. output schema: to deifne hte format for the output, this would allow to connect to next level API. I thin kthe AI-agent is the same, tje AI model stills remain the same, and the memory is implmented internally or it can also be stored in Skills.md or intrictions.md (some agent like codex called agents.md). The tools are connected with mcp server (most of the useful tools server can be found on the web). ...

March 10, 2026 · 3 min

IC Design - Part 9: 2020 Contest — Optimizing a Job Assignment Engine

This is a review of my experience in the 2020 IC Design Contest final. It was several years ago, so some details are based on memory and may not exactly match what I thought at the time. I also remember the main scoring objective as area, with a relatively generous timing constraint. The version later shown on the contest website used a power–execution-time metric. For this post, I will explain our decisions from the perspective I remember: minimizing area. ...

July 21, 2023 · 4 min · AI translation-rewrite, human-reviewed

IC Design - Part 8: 2021 Contest — Detecting Waveform Delay

I want to start this review with one criticism: I did not think the 2021 contest problem was designed very well. As I understood the rules, we only needed to pass the provided test cases, without hidden tests. That encouraged teams to find a solution that overfit the known waveforms, rather than design a robust general-purpose circuit. Problem overview Each waveform contained 150 discrete samples. Every sample was 8 bits wide, with values from 0 to 255. ...

July 17, 2023 · 3 min · AI translation-rewrite, human-reviewed

IC Design - Part 7: 2022 Contest — Building an ECG QRS Detector

This post reviews how I approached the 2022 IC Design Contest final. The problem was to process an ECG waveform and identify the positions of its Q, R, and S components. Problem overview The proposed processing flow had three stages: A 16-tap moving average: MV(n)=x(n)+x(n−1)+⋯+x(n−15)16MV(n)=\frac{x(n)+x(n-1)+\cdots+x(n-15)}{16} DC-bias removal: DelDC(n)=x(n)−MV(n)DelDC(n)=x(n)-MV(n) A 15-tap windowing filter, with symmetric triangular weights: WF(n)=DelDC(n−7)+2DelDC(n−6)+⋯+8DelDC(n)+⋯+DelDC(n+7)64WF(n)=\frac{DelDC(n-7)+2DelDC(n-6)+\cdots+8DelDC(n)+\cdots+DelDC(n+7)}{64} Hardware architecture Interface Signal Description din 10-bit input data busy The host can send data when this is 0 Q, R, S 12-bit position values, output together valid Indicates that the Q, R, and S positions are valid Implementing the moving average A direct 16-tap moving average sums 16 samples, which suggests a fairly large adder network. I wanted to avoid that. ...

July 11, 2023 · 4 min · AI translation-rewrite, human-reviewed

IC Design - Part 6: Minimizing the Area–Time Product Through Resource Sharing

In Estimating Execution Time Before Writing RTL, I described why the clock period matters. For many architecture choices, however, I first focus on the total number of cycles. If the clock periods are similar, the area–time product (AT) is closely related to the amount of computation and the hardware needed to perform it. Reducing the amount of computation Suppose we need to add 16 values. We could build one adder and reuse it over many cycles, or build four adders and finish in fewer cycles. Ignoring clock-period differences and extra control or storage overhead, these choices can have similar AT products. ...

July 7, 2023 · 3 min · AI translation-rewrite, human-reviewed

IC Design - Part 5: Minimizing Hardware Area Under a Timing Constraint

In this post, I want to discuss a specific goal: minimize hardware area while meeting a timing constraint. In some IC design competitions, the time limit is given as a maximum number of cycles. This limit can be fairly generous, so even a straightforward architecture may meet it. When that happens, using fewer cycles is not necessarily helpful. We should instead spend the available cycles to reduce area. One common technique is to relax the clock-period constraint as much as the specification allows. A less aggressive timing target can give synthesis more room to optimize area. ...

July 5, 2023 · 3 min · AI translation-rewrite, human-reviewed

IC Design - Part 4: Estimating Power Consumption in RTL Design

Power consumption is another metric I want to estimate before committing to a hardware architecture. Where does power come from? RTL power reports commonly separate power into three categories: Internal power Switching power Leakage power In the terminology commonly taught in class, internal and switching power belong to dynamic power, while leakage power belongs to static power. Dynamic power A common first-order model is: Pdynamic=αCV2f P_{dynamic} = \alpha C V^2 f Here, α\alpha represents switching activity, CC is capacitance, VV is voltage, and ff is operating frequency. ...

June 28, 2023 · 3 min · AI translation-rewrite, human-reviewed