nn::math::MakeBits Function

Syntax

template <typename T>
bit32 MakeBits(
     T v,
     int width,
     int shift
);

Template Arguments

Name Description
T Type representing a bit array.

Arguments

Name Description
in v Value to operate on.
in width Range to extract.
in shift A position relative to the lowest bit.

Return Values

Returns the result yielded from applying width and shift to v.

Description

Returns a 32-bit data value (bit array) after removing everything within that value but a specified range of bits.

Moves shift bits from the lowest bit of v, and from that position extracts the range specified by width.

Revision History

2011/03/01
Initial version.

CONFIDENTIAL