Home › Practice › RTL Design › 2-stage pipelined mid-price check

2-stage pipelined mid-price check

MediumRTLHFTsequentialpipelining

To keep high clock speed (throughput) when computing a mid-price (bid + ask) / 2 and checking it against a risk limit, split the work across two pipeline stages.

Concept first. In Stage 1 (cycle 1), add bid + ask into a 9-bit sum (so two 8-bit prices up to 255 never overflow!) and take the integer average sum[8:1], while passing valid and limit into pipeline registers. In Stage 2 (cycle 2), compare the registered mid-price against the registered limit and drive ok_v and ok. After passing, click Check area and speed to inspect the OpenSTA clock speed.

Solve in your browser →

No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.

More in this track

← Tick-to-trade price triggerMultiply and keep a running total (MAC) →