Learn

0/8
0/6
0/6
0/6

Practice

Snowmaking Monitor

A ski resort's snow cannons only pay off below a cutoff temperature, so the slope station works in signed whole °C. The forecast unit supplies the expected drift over the next hour. Your monitor predicts the next reading, measures how far the slope sits from the cutoff, and raises two flags. None of these results may ever wrap, whatever the inputs.

Interface

PortDirectionTypeDescription
tempin8-bit signedMeasured slope temperature
risein8-bit signedForecast drift for the next hour (may be negative)
cutoffin8-bit signedSnowmaking cutoff temperature
predout9-bit signedPredicted temperature: temp + rise
devout9-bit signedDistance from the cutoff: tempcutoff
warmout1 bitHigh when temp is strictly above cutoff: pause the cannons
thawout1 bitHigh when pred is at or above 0 °C: the slope starts thawing

Behavior

  • pred is the full 9-bit sum of temp and rise; extreme pairs like 100 + 90 or −100 + −90 must come out exact, never wrapped
  • dev is the full 9-bit difference tempcutoff; extremes like 120 − (−120) = 240 must come out exact
  • warm is high exactly when temp > cutoff; at temp = cutoff it stays low
  • thaw is high exactly when pred ≥ 0; a predicted 0 °C already counts as thawing
  • All comparisons are signed: −1 is below 0, not above 255. The testbench includes pairs that expose an unsigned misreading

Constraints

OPERATORS

only +, -, and relational operators; widen with resize in VHDL or via the 9-bit target in SystemVerilog.

  • One concurrent assignment per output; no processes or always blocks
  • In VHDL, route each comparison with the '1' when ... else '0' recipe
Loading editor...

Click Run to execute your code. Output will appear here.