<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Notes by Noor]]></title><description><![CDATA[Purely a reflection of my evolving journey throughout the tech world, currently focusing on the Hardware Logic and Design but as learning stands with evolving a]]></description><link>https://noorfarhan.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 09:52:34 GMT</lastBuildDate><atom:link href="https://noorfarhan.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[FPGAs: The Zero Jitter and Deterministic Latency Solution for Real-Time Closed Loop Systems]]></title><description><![CDATA[Before getting started with the fancy terminologies, let’s revise the basic ones: • Latency: How much time it takes to execute or complete a single…]]></description><link>https://noorfarhan.hashnode.dev/fpgas-the-zero-jitter-and-deterministic-latency-solution-for-real-time-closed-loop-systems</link><guid isPermaLink="true">https://noorfarhan.hashnode.dev/fpgas-the-zero-jitter-and-deterministic-latency-solution-for-real-time-closed-loop-systems</guid><category><![CDATA[fpga]]></category><category><![CDATA[embedded systems]]></category><category><![CDATA[computer architecture]]></category><category><![CDATA[hardware]]></category><category><![CDATA[systemverilog]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Noor Farhan]]></dc:creator><pubDate>Sun, 22 Nov 2026 18:56:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b02cc2e63c212ecffad8d6f/c7642074-070e-432c-8543-87236dd39628.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Before getting started with the fancy terminologies, let’s revise the basic ones:</p>
<p>• <strong>Latency</strong>: How much time it takes to execute or complete a single instruction.</p>
<p>• <strong>Throughput</strong>: Total number of instructions exexcuted in a specified time let’s say, in a second for instance .</p>
<p>• <strong>Jitter</strong>: The unpredictability of the execution time between two instructions.</p>
<p>Let’s understand it using an <strong>example</strong>,</p>
<p><em>If instruction A takes 10 ns, instruction B takes 50 ns without any specific reason, then we say we are having high jitter.</em></p>
<p>This article discusses and compares three architectures: <strong>CPUs, GPUs and FPGAs</strong>, in terms of the best performance in real-time closed loop systems. A <strong>closed loop system</strong> refers to the concept where a device or machine senses it’s environment, computes or calculates the relevant action and sends the command to the motor (actuator).</p>
<p>Lets start with the word of the mouth, <strong>CPUs</strong> which process and execute instructions sequentially, but do they ever feel like these do? No, because these do context switching and programs are given a specific time slice to execute. This context switching and interrupt handling nature of the architecture introduces <strong>jitter as an issue</strong>. When one task has to wait for the processor, it’s <strong>latency increases</strong> resulting in high jitter. CPU Schedulers can spike the <strong>average latency ( P50) to tail latency (P99 or P99.9)</strong> which increases the latency <strong>10x</strong> for a task.</p>
<p>GPUs, on the other hand have <strong>high throughput and high latency</strong>. As, GPUs uses the <strong>SIMT</strong> (Single Instruction Multiple Tasks) model for data parallelism it tends to fully utilize it’s <strong>Streaming Multiprocessors (SMs)</strong>. So, GPUs uses <strong>high batch sizes</strong> to start processing and the applications which needs low volume and instant responses have to wait and deal with the queue waiting times. This batching for the parallelism becomes the reason for high latency in GPUs. So, these offer high throughput but with high latency as well.</p>
<p>The third one to compare these with are <strong>FPGAs (Field Programmable Gate Arrays)</strong>, are different from CPUs and GPUs which execute software instructions line by line from the memory. FPGA is a <strong>reconfigurable electronic chip</strong>. This chip consists of hardware blocks which can be programmed according to the user needs using <strong>Logic Gates</strong>. So, the Temporal instruction fetching (used in CPUs, GPUs) is replaced by <strong>Spatial Data Flow Architecture</strong> . In this architecture, the data flows through the various pipeline stages of the chip which are defined in the specific design without any interrupts or software dealings.</p>
<h1>How an FPGA looks like from the inside</h1>
<p>The building blocks of an FPGA are:</p>
<p>• LUTs</p>
<p>• Flip-Flops</p>
<p>• Block Ram</p>
<p>• DSP Slices</p>
<p>1. <strong>LUTs (Look-Up Tables)</strong>: These store the <strong>pre-computed outputs</strong> for certain input data. Instead of storing specific Logic Gates for each mathematical equation, we use LUTs for ones which are repetitive or maybe too basic to reduce power and multipliers.</p>
<p>2. <strong>Flip-Flops</strong>: These store <strong>1-bit value</strong> (which can be 0 or 1) until it gets updated at the next <strong>clock cycle</strong>. These are basically holders for the previous pipeline stage to hold the calculated bit so it won’t get lost or changed before the clock period.</p>
<p>3. <strong>Block RAM</strong>: As the name suggests, Block Ram is used to <strong>store large tables or data structures</strong> so the chip hardware doesn’t have to flip back to the core processor to fetch the data or instructions from the secondary storage which causes latency or delay. Instead, FPGAs has BRAM next to the mathematical circuits to hold the needed data for the calculations.</p>
<p>4. <strong>DSP Slices</strong>: The terminology stands for <strong>Digital Signal Processing</strong>. These are pre-build components into the silicon grid with the LUTs. Their function is to perform the <strong>MAC operations</strong>. Multiply-Accumulate Operations are applied on the specific data based on the equations they are related to. These perform the core mathematical calculations on the hardware for image/video processing, trajectory planning , AI/ML based searches and more tasks for which the hardware is intended to be used.</p>
<h2>FPGAs: Immutable Latency and Subsequently Zero Jitter Devices</h2>
<p>Unlike CPUs and GPUs, FPGAs have no Operating System scheduling, interrupts or runtime driver queues, data reaches to the processing components at every clock cycle. <strong>Latency</strong> is a function of <strong>pipeline depth</strong> in FPGAs.</p>
<p><strong>Pipeline Depth (N)</strong> refers to the overall number of processing stages throughout the entire processing pipeline on an FPGA. Each stage processes the input data according to the hard logic wired to it using the Logic Gates.</p>
<p><strong>Latency Analogy:</strong></p>
<p>If an FPGA has a pipeline depth of 20, clock frequency (which refers to clocks per second and is measured in Hz) of 500 MHz then,</p>
<p><code>One clock cycle = 1/ 500,000,000 = 0.000000002 s</code></p>
<p>Which can be converted to <em>2 ns</em> (ns refers to nanoseconds).</p>
<blockquote>
<p><code>Latency= 20 cycles * 2 ns</code></p>
<p><code>= 40 ns</code></p>
</blockquote>
<p>So, the each input takes an <strong>immutable (unchangeable)</strong> latency of 40 ns with <strong>zero jitter</strong>.</p>
<h3>Why the Deterministic Latency with No Jitter ?</h3>
<p>The latency of FPGA is immutable or deterministic means it stays the same for every input unlike CPUs or GPUs. The reason for this is the <strong>no software interruption</strong> or it’s pure hardware logic which only consists of the blocks needed for the calculation. Every input passes through each pipeline taking a clock cycle which is the latency it takes to complete execution. As, <strong>latency is immutable so there is no chance of jitter</strong> which is the real advantage for the <strong>real-world embedded systems</strong> where jitter can cause serious delays and real-time control issues. So, FPGAs have an edge over CPUs and GPUs over deterministic latency with no jitter.</p>
<h3>CPUs vs. GPUs vs. FPGAs : When to Choose Which</h3>
<p>We can compare these on a few factors like :</p>
<p>• Latency Predictability</p>
<p>• Power Efficiency</p>
<p>• Parallism</p>
<p>• Development Effort</p>
<p>1. <strong>Latency Predictability</strong>: As, discussed in the article <strong>FPGA wins</strong> in this. With fixed pipeline depth and hardwired logic gates, the input is processed and move in the same order without any interrupts or queues. Whereas <strong>CPUs and GPUs</strong> remain <strong>low to moderate</strong> in this domain because of the scheduling, sofware interrupts, network interrupts and driver queues.</p>
<p>2. <strong>Power Efficiency</strong>: <strong>FPGAs have extremely high power efficiency</strong> because of the direct hardware logic blocks and low level control. Whereas <strong>GPUs</strong> also have <strong>high power efficiency</strong> for parallel mathematical operations. But <strong>CPUs</strong> remains <strong>low to moderate</strong> on the list because of memory instruction fetching, decoding and all taking and consuming more power per watt than the actual operation.</p>
<p>3. <strong>Parallism</strong>: <strong>CPUs</strong> have <strong>task parallelism</strong> with 4 to 64 cores on average shared between the independent tasks . On the other hand, <strong>GPUs</strong> have <strong>data parallelism</strong> with the same operation being applied on different data using independent threads. And <strong>FPGAs</strong>, have <strong>pipeline and spatial parallelism</strong> with different parts of a process being executed on various physical pipelines with multiple parallel pipelines possible side by side to process data.</p>
<p>4. <strong>Development Effort</strong>: <strong>CPUs</strong> have the <strong>easiest and fastest</strong> development effort while <strong>FPGAs</strong> with the <strong>hardest and slowest one</strong>. With the <strong>high-level programming languages</strong> like C++, Java and Python available to develop the CPU, it’s the easiest to develop. For <strong>FPGAs</strong>, <strong>hardware description languages (HDLs)</strong> are used to describe the physical hardware of the circuit. These include <strong>SystemVerilog</strong> or <strong>VHDL</strong>. These include managing every basic thing from clock cycles to compile the design onto the chip. Talking about <strong>GPUs</strong>, their development process is <strong>moderate</strong>. These require <strong>parallel programming frameworks</strong> like CUDA, OpenCL or PyTorch.</p>
<p>So, ending it with the <em><strong>use cases</strong></em> in real-world. <strong>CPUs</strong> excel at <strong>general purpose computing</strong>, then <strong>3D graphics and video rendering tasks</strong> inclusive of <strong>AI training</strong> heavily involves <strong>GPUs</strong>. <strong>FPGAs</strong>, whereas aren’t generally ideal for software based execution of instructions like these. Their core hardware nature makes them ideal for <strong>real-time closed loops, radar/telecom signal processing and related embedded tasks</strong>.</p>
<h3><em>References</em></h3>
<p>1. Hennessy, J. L., &amp; Patterson, D. A. Computer Architecture: A Quantitative Approach (6th ed.). Morgan Kaufmann. <a href="https://books.google.com/books/about/Computer_Architecture.html?id=cM8mDwAAQBAJ">https://books.google.com/books/about/Computer_Architecture.html?id=cM8mDwAAQBAJ</a></p>
<p>2. Dean, J., &amp; Barroso, L. A. (2013). The tail at scale. Communications of the ACM, 56(2), 74–80. <a href="https://doi.org/10.1145/2408776.2408794">https://doi.org/10.1145/2408776.2408794</a></p>
<p>3. Digilent. Field-Programmable Gate Arrays Explained (Reference Guide). <a href="https://files.digilent.com/reference/Field_Programmable_Gate_Arrays_Explained.pdf">https://files.digilent.com/reference/Field_Programmable_Gate_Arrays_Explained.pdf</a></p>
<p>4. Åström, K. J., &amp; Wittenmark, B. Computer-Controlled Systems: Theory and Design (3rd ed.). Dover Publications. <a href="https://books.google.com/books/about/Computer_Controlled_Systems.html?id=9Y6D5vviqMgC">https://books.google.com/books/about/Computer_Controlled_Systems.html?id=9Y6D5vviqMgC</a></p>
<p>5. Kirk, D. B., &amp; Hwu, W. W. Programming Massively Parallel Processors: A Hands-on Approach (4th ed.). Morgan Kaufmann. <a href="https://www.cse.iitd.ac.in/~rijurekha/col730_2022/cudabook.pdf">https://www.cse.iitd.ac.in/~rijurekha/col730_2022/cudabook.pdf</a></p>
]]></content:encoded></item></channel></rss>