SpinalHDL
1 / 1
View past submissionsLeaderboard

Description

Drone Says It's Fine

A delivery drone buried itself in a billboard, but its navigation computer still reports perfect health. Management orders you to wire an independent watchdog between the heartbeat line and the emergency-landing relay.

A drone emits one heartbeat sample per cycle. A value of 1 means the navigation computer responded; a value of 0 means the heartbeat was missed.

Count consecutive missed heartbeats. Assert the alarm on the third consecutive miss, and keep it asserted for the remainder of the stream even if heartbeats resume. State is cleared by the module reset between test cases.

Hardware I/O Encoding

  • heartbeat is a stream of 1-bit samples with at most 64 elements
  • the output is a 1-bit stream with one alarm value per input sample
  • the output reflects the state after processing the corresponding input

Example

Input [1, 0, 0, 1, 0, 0, 0, 1] produces [0, 0, 0, 0, 0, 0, 1, 1].

Input

heartbeat

Stream of 1-bit Unsigned Integer (up to 64 elements)
Heartbeat samples, where 1 is received and 0 is missed.

Output

Stream of 1-bit Unsigned Integer
Latched alarm state after each heartbeat sample.