Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
bitblock.hpp File Reference
#include <cstdint>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <string>
#include <universal/internal/uint128/uint128.hpp>
#include <universal/utility/boolean_logic_operators.hpp>
#include <universal/internal/bitblock/exceptions.hpp>

Classes

class  sw::universal::internal::bitblock< nbits >
struct  sw::universal::internal::round_t< tgt_size, src_size >
struct  sw::universal::internal::round_t< 0, src_size >

Namespaces

namespace  sw
 required std libraries
namespace  sw::universal
namespace  sw::universal::internal

Functions

template<unsigned nbits>
bool sw::universal::internal::twosComplementLessThan (const bitblock< nbits > &lhs, const bitblock< nbits > &rhs)
template<unsigned nbits>
bool sw::universal::internal::operator== (const bitblock< nbits > &lhs, const bitblock< nbits > &rhs)
template<unsigned nbits>
bool sw::universal::internal::operator< (const bitblock< nbits > &lhs, const bitblock< nbits > &rhs)
template<unsigned nbits>
bool sw::universal::internal::operator<= (const bitblock< nbits > &lhs, const bitblock< nbits > &rhs)
template<unsigned nbits>
bool sw::universal::internal::operator> (const bitblock< nbits > &lhs, const bitblock< nbits > &rhs)
template<unsigned nbits>
bool sw::universal::internal::operator>= (const bitblock< nbits > &lhs, const bitblock< nbits > &rhs)
template<unsigned nbits>
bool sw::universal::internal::increment_bitset (bitblock< nbits > &number)
template<unsigned nbits>
bool sw::universal::internal::increment_unsigned (bitblock< nbits > &number, unsigned nrBits=nbits - 1)
template<unsigned nbits>
bool sw::universal::internal::decrement_bitset (bitblock< nbits > &number)
template<unsigned nbits>
bool sw::universal::internal::add_unsigned (bitblock< nbits > a, bitblock< nbits > b, bitblock< nbits+1 > &sum)
template<unsigned nbits>
bool sw::universal::internal::subtract_unsigned (bitblock< nbits > a, bitblock< nbits > b, bitblock< nbits+1 > &dif)
template<unsigned nbits>
bool sw::universal::internal::add_signed_magnitude (bitblock< nbits > a, bitblock< nbits > b, bitblock< nbits > &sum)
template<unsigned nbits>
bool sw::universal::internal::subtract_signed_magnitude (bitblock< nbits > a, bitblock< nbits > b, bitblock< nbits > &diff)
template<unsigned nbits>
bitblock< nbits > sw::universal::internal::extract_23b_fraction (uint32_t _23b_fraction_without_hidden_bit)
template<unsigned nbits>
bitblock< nbits > sw::universal::internal::extract_52b_fraction (uint64_t _52b_fraction_without_hidden_bit)
template<unsigned nbits>
bitblock< nbits > sw::universal::internal::extract_63b_fraction (uint64_t _63b_fraction_without_hidden_bit)
template<unsigned nbits>
bitblock< nbits > sw::universal::internal::extract_long_double_fraction (uint128 &_112b_fraction_without_hidden_bit)
template<unsigned nbits>
bitblock< nbits > sw::universal::internal::copy_integer_fraction (unsigned long long _fraction_without_hidden_bit)
template<unsigned src_size, unsigned tgt_size>
void sw::universal::internal::copy_into (const bitblock< src_size > &src, unsigned shift, bitblock< tgt_size > &tgt)
template<unsigned src_size, unsigned tgt_size>
void sw::universal::internal::copy_slice_into (bitblock< src_size > &src, bitblock< tgt_size > &tgt, unsigned begin=0, unsigned end=src_size, unsigned shift=0)
template<unsigned from, unsigned to, unsigned src_size>
bitblock< to - from > sw::universal::internal::fixed_subset (const bitblock< src_size > &src)
template<unsigned src_size, unsigned tgt_size>
bool sw::universal::internal::accumulate (const bitblock< src_size > &addend, bitblock< tgt_size > &accumulator)
template<unsigned operand_size>
void sw::universal::internal::multiply_unsigned (const bitblock< operand_size > &a, const bitblock< operand_size > &b, bitblock< 2 *operand_size > &result)
template<unsigned src_size, unsigned tgt_size>
bool sw::universal::internal::subtract (bitblock< tgt_size > &accumulator, const bitblock< src_size > &subtractand)
template<unsigned operand_size>
void sw::universal::internal::integer_divide_unsigned (const bitblock< operand_size > &a, const bitblock< operand_size > &b, bitblock< 2 *operand_size > &result)
template<unsigned operand_size, unsigned result_size>
bool sw::universal::internal::divide_with_fraction (const bitblock< operand_size > &a, const bitblock< operand_size > &b, bitblock< result_size > &result)
template<unsigned src_size, unsigned tgt_size>
void sw::universal::internal::truncate (bitblock< src_size > &src, bitblock< tgt_size > &tgt)
template<unsigned tgt_size, unsigned src_size>
bitblock< tgt_size > sw::universal::internal::round (const bitblock< src_size > &src, unsigned n)
 Round off n last bits of bitset src.
template<unsigned nbits>
int sw::universal::internal::findMostSignificantBit (const bitblock< nbits > &bits)
template<unsigned nbits>
bitblock< nbits > sw::universal::internal::ones_complement (bitblock< nbits > number)
template<unsigned nbits>
bitblock< nbits > sw::universal::internal::twos_complement (bitblock< nbits > number)
template<unsigned nbits, class Type>
bitblock< nbits > sw::universal::internal::convert_to_bitblock (Type number)
template<unsigned nbits>
std::string sw::universal::internal::to_bit_string (bitblock< nbits > bits, bool separator=true)
template<unsigned nbits>
std::string sw::universal::internal::to_hex (bitblock< nbits > bits, bool nibbleMarker=false, bool hexPrefix=true)
template<unsigned nbits>
std::string sw::universal::internal::sign_magnitude_to_string (bitblock< nbits > bits)
template<unsigned nbits>
bitblock< nbits > sw::universal::internal::flip_sign_bit (bitblock< nbits > number)
template<unsigned nbits>
bool sw::universal::internal::anyAfter (const bitblock< nbits > &bits, int msb)