Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

binary.h File Reference

binary.h File Reference

Go to the source code of this file.

Data Structures

struct  max_value_for_nbits< NBITS >
 Maximum value that can be contained in N bits. More...
struct  max_value_for_nbits< 0 >
 Specialisation for when NBITS == 0. More...
struct  bit< POSITION >
 Gets the value of the bit at POSITION Starts from LSB. More...

Namespaces

namespace  etl
 

A multimap with the capacity defined at compile time.


Enumerations

enum  binary_constant
 

8 bit binary constants.

More...

Functions

template<typename T >
rotate_left (T value)
 Rotate left.
template<typename T >
rotate_left (T value, size_t distance)
 Rotate left.
template<typename T >
rotate_right (T value)
 Rotate right.
template<typename T >
rotate_right (T value, size_t distance)
 Rotate right.
template<typename T >
rotate (T value, typename etl::make_signed< size_t >::type distance)
 Rotate.
uint8_t reverse_bits (uint8_t value)
 Reverse 8 bits.
uint16_t reverse_bits (uint16_t value)
 Reverse 16 bits.
uint32_t reverse_bits (uint32_t value)
 Reverse 32 bits.
uint64_t reverse_bits (uint64_t value)
 Reverse 64 bits.
uint8_t reverse_bytes (uint8_t value)
 Reverse bytes.
uint16_t reverse_bytes (uint16_t value)
 Reverse bytes 16 bit.
uint32_t reverse_bytes (uint32_t value)
 Reverse bytes 32 bit.
uint64_t reverse_bytes (uint64_t value)
 Reverse bytes 64 bit.
template<typename T >
binary_to_gray (T value)
 Converts binary to Gray code.
uint8_t gray_to_binary (uint8_t value)
 Converts Gray code to binary.
uint16_t gray_to_binary (uint16_t value)
 Converts Gray code to binary.
uint32_t gray_to_binary (uint32_t value)
 Converts Gray code to binary.
uint64_t gray_to_binary (uint64_t value)
 Converts Gray code to binary.
uint_least8_t count_bits (uint8_t value)
 Count set bits. 8 bits.
uint_least8_t count_bits (uint16_t value)
 Count set bits. 16 bits.
uint_least8_t count_bits (uint32_t value)
 Count set bits. 32 bits.
uint_least8_t count_bits (uint64_t value)
 Count set bits. 64 bits.
uint_least8_t parity (uint8_t value)
 Parity. 8bits. 0 = even, 1 = odd.
uint_least8_t parity (uint16_t value)
 Parity. 16bits. 0 = even, 1 = odd.
uint_least8_t parity (uint32_t value)
 Parity. 32bits. 0 = even, 1 = odd.
uint_least8_t parity (uint64_t value)
 Parity. 64bits. 0 = even, 1 = odd.
template<typename TReturn , const size_t NBITS, typename TValue >
TReturn fold_bits (TValue value)
 Fold a binary number down to a set number of bits using XOR.
template<typename TReturn , const size_t NBITS, typename TValue >
TReturn sign_extend (TValue value)
 Sign extend.
template<typename TReturn , const size_t NBITS, const size_t SHIFT, typename TValue >
TReturn sign_extend (TValue value)
 Sign extend.
template<typename TReturn , typename TValue >
TReturn sign_extend (TValue value, const size_t NBITS)
 Sign extend.
template<typename TReturn , typename TValue >
TReturn sign_extend (TValue value, const size_t NBITS, const size_t SHIFT)
 Sign extend.
uint_least8_t count_trailing_zeros (uint8_t value)
 Count trailing zeros.
uint_least8_t count_trailing_zeros (uint16_t value)
 Count trailing zeros.
uint_least8_t count_trailing_zeros (uint32_t value)
 Count trailing zeros.
uint_least8_t count_trailing_zeros (uint64_t value)
 Count trailing zeros.
template<typename T >
uint_least8_t first_set_bit_position (T value)
 Find the position of the first set bit.
template<typename T >
uint_least8_t first_clear_bit_position (T value)
 Find the position of the first clear bit.
template<typename T >
uint_least8_t first_bit_position (bool state, T value)
 Find the position of the first bit that is clear or set.

Detailed Description

Definition in file binary.h.