A clear understanding of data variability recorded in space is vital for scientists and space mission controllers. Consequently, automatic tools designed to extract relevant key-descriptors of variability are extremely useful. Nevertheless, solutions to adapt such algorithms for on-board computers are still rare. In this paper we describe an algorithm that detects directional discontinuities of in situ measured variables, and its implementation on Field-Programmable Gate Array (FPGA) devices with an application on directional discontinuities of the interplanetary magnetic field (IMF).The abrupt changes in the orientation of the IMF, referred to as directional discontinuities (DDs), are known to trigger geomagnetic storms and substorms, with significant impact on ground-based and spaceborne technologies (e.g., Tsurutani et al., 2011, and references therein). DDs are important when estimating the solar wind propagation time from an upstream solar wind monitor to a downstream target (e.g., Haaland et al., 2010;Mailyan et al., 2008;Munteanu et al., 2013). IMF discontinuities play a key role in understanding the micro-scale structure of the solar wind and have been shown to be associated with energetic particle acceleration (e.g., Bandyopadhya et al., 2020;Tessein et al., 2013), and plasma heating (e.g., Osman et al., 2012;Qudsi et al., 2020). With an average occurrence rate of one or two per hour, IMF discontinuities are abundant structures in the solar wind (e.g., Newman et al., 2020) and represent an omnipresent source of variability for the terrestrial plasma environment.Two general classes of idealized Magnetohydrodynamic (MHD) discontinuities can be distinguished: stationary structures, that is, discontinuities that do not propagate with respect to the ambient plasma (tangential discontinuities (TDs) and contact discontinuities), and propagating discontinuities (rotational discontinuities (RDs) and shocks). The most frequent small-scale discontinuities in the interplanetary space are the abrupt changes in the direction of the magnetic field, predominantly expected for TDs and RDs (e.g., Paschmann et al., 2013).Two main classes of algorithms to detect solar wind discontinuities are proposed in the literature. The first class includes algorithms searching for changes in the magnetic field direction (