Template Helpers in xf::common::utils_hw

template struct xf::common::utils_hw::PowerOf2

#include "xf_utils_hw/common.hpp"

Overview

Template to calculate power of 2.

Parameters:

_N the power to be calculated.
template <int _N>
struct PowerOf2

// fields

static const unsigned value

Fields

static const unsigned value

value of 2^(_N)

template struct xf::common::utils_hw::GCD

#include "xf_utils_hw/common.hpp"

Overview

Template to calculate Greatest Common Divisor ( GCD ) of two integers.

Parameters:

_A an integer
_B the other integer
template <
    int _A,
    int _B
    >
struct GCD

// fields

static const int value

Fields

static const int value

value of GCD of _A and _B

template struct xf::common::utils_hw::LCM

#include "xf_utils_hw/common.hpp"

Overview

Template to calculate Least Common Multiple(LCM) of two integers.

Parameters:

_A an integer
_B the other integer
template <
    int _A,
    int _B
    >
struct LCM

// fields

static const int value

Fields

static const int value

value of LCM of _A and _B