Building a PC

I will awlays remember December 2022 as the month I built my first PC from components, such as a CPU, GPU, and motherboard. It was an enriching experience, and every computer architect must build a PC to truly understand the impact of their work and get empathy towards their customers. If this is your first time, you will likely underestimate the amount of optimization, patience, and rigor involved in building a PC. However, do not let that discourage you; creating a PC is a lot of fun!

Here is how you make one:

  • Determine what is your primary application (AI, gaming, HPC, etc.) and budget ($)

  • PCpartpicker has multiple build guides you can choose from. However, it is more fun to select all the parts yourself. For example, I wanted to build an Intel CPU and Intel GPU PC, and I did not see any existing builds for that, so I made a new one.

  • You can add different components, such as CPU, cooling mechanism, RAM, SSD/HDD, Video card (GPU), and case. The website will give you some notes on compatibility, and then you can ask specific questions on the forum. Please share your list in the forum and ask for feedback. I was told to use a white cooler instead of black, and that was an excellent suggestion because my entire PC was white (Sometimes we miss simple things!).

  • Now the fun part: Order all your computer parts online or go to a local store to pick them up.

  • Once you receive them, start building your PC without the case. We will add the items to the case once everything is working (at least until BIOS boot).

  • Remember! Manuals are your friend. The motherboard, case, and power supply manual are the most important ones to read.

Here is a link to my PC build.

Need for Feedback to Stabilize Unstable Systems

This post addresses the following question with the help of an example:

Question: Is it possible to practically stabilize an unstable system without feedback?

Let us consider an unstable system with transfer function $P = \frac{1}{s-1}$. This plant has a pole on the right hand side plane in the s-domain, which means it is unstable. A naive (and incorrect way) to stabilize this system will be to employ a controller $K = \frac{s-1}{s+1}$ without any feedback. One might argue that the open loop transfer function $P\times K = \frac{1}{s+1}$ and the new pole now occurs at left hand plane of the s-domain, so this system must become stable. Unfortunately, it does not, due to at least two reasons:

The disturbances in the plant input and output can completely throw away the stability. This can only be corrected using feedback. Even in a disturbance free ideal world, all numbers are finite precision and have errors. So while computing $P \times K$, the $s-1$ terms in the numerator and denominator cannot completely cancel each other.

Answer: No.

I will put the response of such a system using Matlab to show instability in a future post.

Managing References in BibTex

Properly formatting references in a paper is important. I use Latex for typesetting all my papers and that is why BibTeX is a major part of adding references to the paper. Well, the challenge is that I want to have one master copy of a bib file that has all the references from all my papers. This is useful for writing a thesis as well as other papers that may reuse some of the references from an older paper. I tried several reference management software like Mendeley but never ended up using them for a long time. I wanted something simple and I thought of writing the code for parsing the bib entries myself. Then, I found Jabref software. It is a very simple software and has all the functionality that I need for reference management. Note, I am not advocating for any one software over the other, just writing about what I liked in Jabref.

  1. It is easy to merge two bib files. It can find duplicates. You can merge the duplicates or choose to keep any one version.

  2. I use the bib keys in the following format: [name][year][veryshorttitle] This is the same format how Google scholar produces keys.

  3. The title field needs to be in curly brackets to keep them initial capitalized. This can be checked using reference integrity checker. I was really surprized by this feature.

Computing A Signal Variance in Real Time

The standard way to compute the variance of a data set is using the sqaure of the standard deviation. When we have scalar values $x_1, x_2, x_3, …, x_N$, the mean $\mu_N$ standard deviation $\sigma_N$ for all the N values is computed as follows:

\[\mu_N = \frac{\sum_{k=1}^N x_k}{N} ... (1)\] \[\sigma_N = \frac{\sqrt{\sum_{k=1}^N (x_k - \mu_N) }}{N} ... (1)\]

I already described in my previous blog post how to compute the mean in real time using the following algorithm at runtime:

\[\begin{align} & \mu_0 = 0; \nonumber \\\ & \mathrm{for} \hspace{2mm} k = 1:1:N \nonumber \\\ & \hspace{4mm} \mu_k = \left( \frac{k-1}{k} \right) \mu_{k-1} + \frac{x_k}{k}; \nonumber \\\ & \mathrm{endfor} \nonumber \end{align}\]

This saves memory and is more elegent.

Similarly, we can compute the variance of a data set using another recursive algorithm:

\[\begin{align} & \mu_0 = 0; \nonumber \\\ & S_0 = 0; \nonumber \\\ & \mathrm{for} \hspace{2mm} k = 1:1:N \nonumber \\\ & \hspace{4mm} \mu_k = \left( \frac{k-1}{k} \right) \mu_{k-1} + \frac{x_k}{k}; \nonumber \\\ & \hspace{4mm} S_k = S_{k-1} + \left( (x_k - \mu_k)(x_k - \mu_{k-1}) \right); \nonumber \\\ & \hspace{4mm} \sigma_k = \sqrt\frac{S_k}{k} ; \nonumber \\\ & \hspace{4mm} Var_k = \sigma _k^2 = \frac{S_k}{k}; \nonumber \\\ & \mathrm{endfor} \nonumber \end{align}\]

Note that, to compute the variance, we also require to compute the mean.

References:

Link

Pick's Theorem

I recently came across Pick’s theorem, which looks like a neat way to compute the area of a polygon drawn with its edges on a regular grid. The area of the polygon can be expressed using the number of points that lie on the boundaries of the polygon ($n_B$) and the number of points lying inside of the polygon ($n_I$) as follows:

\[Area = \frac{n_B}{2} + n_I - 1\]

Reference: Introduction Proof