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.

Parameters

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 created bit string.

Description

Formats a bit string.

Extracts the low-order width bit of v and creates a value shifted left by the number of bits given by shift.

You can basically think of it as reversing the processing of GetBits()

Revision History

2011/03/01
Initial version.

CONFIDENTIAL