Type Alias hazardflow_designs::std::value::U

source ·
pub type U<const N: usize> = Array<bool, N>;
Expand description

An unsigned integer with bitwidth N.

The lower bits of the integer are represented by the lower index of the array, and vice versa. In other words, the least significant bit of the integer is the 0th element of the array, and the most significant bit is the (N - 1)-th element.

Aliased Type§

struct U<const N: usize> { /* private fields */ }

Implementations§

source§

impl<const N: usize> U<N>

source

pub fn trunk_add(self, rhs: Self) -> Self

Adds two U<N>s and truncate the result to U<N>.

source§

impl<const N: usize> U<N>

source

pub fn unsigned_max() -> U<N>

Returns the maximum value of an N bit unsigned value. (i.e., 2^N - 1)

Trait Implementations§

source§

impl<const N: usize> Add for U<N>

§

type Output = Array<bool, { N + 1 }>

The resulting type after applying the + operator.
source§

fn add(self, _rhs: U<N>) -> U<{ _ }>

Performs the + operation. Read more
source§

impl From<LocalAddr> for U<32>

source§

fn from(value: LocalAddr) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<S<N>> for U<N>

source§

fn from(value: S<N>) -> U<N>

Converts to this type from the input type.
source§

impl From<bool> for U<1>

source§

fn from(_value: bool) -> U<1>

Converts to this type from the input type.
source§

impl<const N: usize> From<i32> for U<N>

source§

fn from(_value: i32) -> U<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u128> for U<N>

source§

fn from(_value: u128) -> U<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u32> for U<N>

source§

fn from(_value: u32) -> U<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<usize> for U<N>

source§

fn from(_value: usize) -> U<N>

Converts to this type from the input type.
source§

impl<const N: usize, const M: usize> Mul<Array<bool, M>> for U<N>

§

type Output = Array<bool, { N + M }>

The resulting type after applying the * operator.
source§

fn mul(self, _other: U<M>) -> Self::Output

Performs the * operation. Read more
source§

impl<const N: usize> Not for U<N>

§

type Output = Array<bool, N>

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl<const N: usize> PartialOrd for U<N>

source§

fn partial_cmp(&self, _other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, _other: &Self) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, _other: &Self) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, _other: &Self) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, _other: &Self) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<const N: usize, const M: usize> Shl<Array<bool, M>> for U<N>

§

type Output = Array<bool, N>

The resulting type after applying the << operator.
source§

fn shl(self, _lhs: U<M>) -> Self::Output

Performs the << operation. Read more
source§

impl<const N: usize> Shl<usize> for U<N>

§

type Output = Array<bool, N>

The resulting type after applying the << operator.
source§

fn shl(self, _lhs: usize) -> Self::Output

Performs the << operation. Read more
source§

impl<const N: usize, const M: usize> Shr<Array<bool, M>> for U<N>

§

type Output = Array<bool, N>

The resulting type after applying the >> operator.
source§

fn shr(self, _rhs: U<M>) -> Self::Output

Performs the >> operation. Read more
source§

impl<const N: usize> Shr<usize> for U<N>

§

type Output = Array<bool, N>

The resulting type after applying the >> operator.
source§

fn shr(self, _rhs: usize) -> Self::Output

Performs the >> operation. Read more
source§

impl<const N: usize> Sub for U<N>

§

type Output = Array<bool, N>

The resulting type after applying the - operator.
source§

fn sub(self, _other: U<N>) -> U<N>

Performs the - operation. Read more