Module multi_bit_logic

Source
Expand description

§Multi-bit logic

This module defines jets that operate on strings of bits.

Functions§

all_8
Check if the value is u8::MAX.
all_16
Check if the value is u16::MAX.
all_32
Check if the value is u32::MAX.
all_64
Check if the value is u64::MAX.
and_1
Bitwise AND of two 1-bit values.
and_8
Bitwise AND of two 8-bit values.
and_16
Bitwise AND of two 16-bit values.
and_32
Bitwise AND of two 32-bit values
and_64
Bitwise AND of two 64-bit values
ch_1
Bitwise CHOICE of a bit and two 1-bit values. If the bit is true, then take the first value, else take the second value.
ch_8
Bitwise CHOICE of a bit and two 8-bit values. If the bit is true, then take the first value, else take the second value.
ch_16
Bitwise CHOICE of a bit and two 16-bit values. If the bit is true, then take the first value, else take the second value.
ch_32
Bitwise CHOICE of a bit and two 32-bit values. If the bit is true, then take the first value, else take the second value.
ch_64
Bitwise CHOICE of a bit and two 64-bit values. If the bit is true, then take the first value, else take the second value.
complement_1
Bitwise NOT of a 1-bit value.
complement_8
Bitwise NOT of an 8-bit value.
complement_16
Bitwise NOT of a 16-bit value.
complement_32
Bitwise NOT of a 32-bit value.
complement_64
Bitwise NOT of a 64-bit value.
eq_1
Check if two 1-bit values are equal.
eq_8
Check if two 8-bit values are equal.
eq_16
Check if two 16-bit values are equal.
eq_32
Check if two 32-bit values are equal.
eq_64
Check if two 64-bit values are equal.
eq_256
Check if two 256-bit values are equal.
full_left_shift_8_1
Helper for left-shifting bits. The bits are shifted from a 1-bit value into a 8-bit value. Return the shifted value and the 1 bit that was shifted out.
full_left_shift_8_2
Helper for left-shifting bits. The bits are shifted from a 2-bit value into a 8-bit value. Return the shifted value and the 2 bits that were shifted out.
full_left_shift_8_4
Helper for left-shifting bits. The bits are shifted from a 4-bit value into a 8-bit value. Return the shifted value and the 4 bits that were shifted out.
full_left_shift_16_1
Helper for left-shifting bits. The bits are shifted from a 1-bit value into a 16-bit value. Return the shifted value and the 1 bit that was shifted out.
full_left_shift_16_2
Helper for left-shifting bits. The bits are shifted from a 2-bit value into a 16-bit value. Return the shifted value and the 2 bits that were shifted out.
full_left_shift_16_4
Helper for left-shifting bits. The bits are shifted from a 4-bit value into a 16-bit value. Return the shifted value and the 4 bits that were shifted out.
full_left_shift_16_8
Helper for left-shifting bits. The bits are shifted from a 8-bit value into a 16-bit value. Return the shifted value and the 8 bits that were shifted out.
full_left_shift_32_1
Helper for left-shifting bits. The bits are shifted from a 1-bit value into a 32-bit value. Return the shifted value and the 1 bit that was shifted out.
full_left_shift_32_2
Helper for left-shifting bits. The bits are shifted from a 2-bit value into a 32-bit value. Return the shifted value and the 2 bits that were shifted out.
full_left_shift_32_4
Helper for left-shifting bits. The bits are shifted from a 4-bit value into a 32-bit value. Return the shifted value and the 4 bits that were shifted out.
full_left_shift_32_8
Helper for left-shifting bits. The bits are shifted from a 8-bit value into a 32-bit value. Return the shifted value and the 8 bits that were shifted out.
full_left_shift_32_16
Helper for left-shifting bits. The bits are shifted from a 16-bit value into a 32-bit value. Return the shifted value and the 16 bits that were shifted out.
full_left_shift_64_1
Helper for left-shifting bits. The bits are shifted from a 1-bit value into a 64-bit value. Return the shifted value and the 1 bit that was shifted out.
full_left_shift_64_2
Helper for left-shifting bits. The bits are shifted from a 2-bit value into a 64-bit value. Return the shifted value and the 2 bits that were shifted out.
full_left_shift_64_4
Helper for left-shifting bits. The bits are shifted from a 4-bit value into a 64-bit value. Return the shifted value and the 4 bits that were shifted out.
full_left_shift_64_8
Helper for left-shifting bits. The bits are shifted from a 8-bit value into a 64-bit value. Return the shifted value and the 8 bits that were shifted out.
full_left_shift_64_16
Helper for left-shifting bits. The bits are shifted from a 16-bit value into a 64-bit value. Return the shifted value and the 16 bits that were shifted out.
full_left_shift_64_32
Helper for left-shifting bits. The bits are shifted from a 32-bit value into a 64-bit value. Return the shifted value and the 32 bits that were shifted out.
full_right_shift_8_1
Helper for right-shifting bits. The bits are shifted from a 1-bit value into a 8-bit value. Return the shifted value and the 1 bit that was shifted out.
full_right_shift_8_2
Helper for right-shifting bits. The bits are shifted from a 2-bit value into a 8-bit value. Return the shifted value and the 2 bits that were shifted out.
full_right_shift_8_4
Helper for right-shifting bits. The bits are shifted from a 4-bit value into a 8-bit value. Return the shifted value and the 4 bits that were shifted out.
full_right_shift_16_1
Helper for right-shifting bits. The bits are shifted from a 1-bit value into a 16-bit value. Return the shifted value and the 1 bit that was shifted out.
full_right_shift_16_2
Helper for right-shifting bits. The bits are shifted from a 2-bit value into a 16-bit value. Return the shifted value and the 2 bits that were shifted out.
full_right_shift_16_4
Helper for right-shifting bits. The bits are shifted from a 4-bit value into a 16-bit value. Return the shifted value and the 4 bits that were shifted out.
full_right_shift_16_8
Helper for right-shifting bits. The bits are shifted from a 8-bit value into a 16-bit value. Return the shifted value and the 8 bits that were shifted out.
full_right_shift_32_1
Helper for right-shifting bits. The bits are shifted from a 1-bit value into a 32-bit value. Return the shifted value and the 1 bit that was shifted out.
full_right_shift_32_2
Helper for right-shifting bits. The bits are shifted from a 2-bit value into a 32-bit value. Return the shifted value and the 2 bits that were shifted out.
full_right_shift_32_4
Helper for right-shifting bits. The bits are shifted from a 4-bit value into a 32-bit value. Return the shifted value and the 4 bits that were shifted out.
full_right_shift_32_8
Helper for right-shifting bits. The bits are shifted from a 8-bit value into a 32-bit value. Return the shifted value and the 8 bits that were shifted out.
full_right_shift_32_16
Helper for right-shifting bits. The bits are shifted from a 16-bit value into a 32-bit value. Return the shifted value and the 16 bits that were shifted out.
full_right_shift_64_1
Helper for right-shifting bits. The bits are shifted from a 1-bit value into a 64-bit value. Return the shifted value and the 1 bit that was shifted out.
full_right_shift_64_2
Helper for right-shifting bits. The bits are shifted from a 2-bit value into a 64-bit value. Return the shifted value and the 2 bits that were shifted out.
full_right_shift_64_4
Helper for right-shifting bits. The bits are shifted from a 4-bit value into a 64-bit value. Return the shifted value and the 4 bits that were shifted out.
full_right_shift_64_8
Helper for right-shifting bits. The bits are shifted from a 8-bit value into a 64-bit value. Return the shifted value and the 8 bits that were shifted out.
full_right_shift_64_16
Helper for right-shifting bits. The bits are shifted from a 16-bit value into a 64-bit value. Return the shifted value and the 16 bits that were shifted out.
full_right_shift_64_32
Helper for right-shifting bits. The bits are shifted from a 32-bit value into a 64-bit value. Return the shifted value and the 32 bits that were shifted out.
high_1
Return u1::MAX = 1.
high_8
Return u8::MAX.
high_16
Return u16::MAX.
high_32
Return u32::MAX.
high_64
Return u64::MAX.
left_extend_1_8
Extend a 1-bit value to an 8-bit value by padding its left with the MSB.
left_extend_1_16
Extend a 1-bit value to a 16-bit value by padding its left with the MSB.
left_extend_1_32
Extend a 1-bit value to a 32-bit value by padding its left with the MSB.
left_extend_1_64
Extend a 1-bit value to a 64-bit value by padding its left with the MSB.
left_extend_8_16
Extend an 8-bit value to a 16-bit value by padding its left with the MSB.
left_extend_8_32
Extend an 8-bit value to a 32-bit value by padding its left with the MSB.
left_extend_8_64
Extend an 8-bit value to a 64-bit value by padding its left with the MSB.
left_extend_16_32
Extend a 16-bit value to a 32-bit value by padding its left with the MSB.
left_extend_16_64
Extend a 16-bit value to a 64-bit value by padding its left with the MSB.
left_extend_32_64
Extend a 16-bit value to a 64-bit value by padding its left with the MSB.
left_pad_high_1_8
Extend a 1-bit value to an 8-bit value by padding its left with ones.
left_pad_high_1_16
Extend a 1-bit value to a 16-bit value by padding its left with ones.
left_pad_high_1_32
Extend a 1-bit value to a 32-bit value by padding its left with ones.
left_pad_high_1_64
Extend a 1-bit value to a 64-bit value by padding its left with ones.
left_pad_high_8_16
Extend an 8-bit value to a 16-bit value by padding its left with ones.
left_pad_high_8_32
Extend an 8-bit value to a 32-bit value by padding its left with ones.
left_pad_high_8_64
Extend a 1-bit value to a 64-bit value by padding its left with ones.
left_pad_high_16_32
Extend a 16-bit value to a 32-bit value by padding its left with ones.
left_pad_high_16_64
Extend a 16-bit value to a 64-bit value by padding its left with ones.
left_pad_high_32_64
Extend a 32-bit value to a 64-bit value by padding its left with ones.
left_pad_low_1_8
Extend a 1-bit value to an 8-bit value by padding its left with zeroes.
left_pad_low_1_16
Extend a 1-bit value to a 16-bit value by padding its left with zeroes.
left_pad_low_1_32
Extend a 1-bit value to a 32-bit value by padding its left with zeroes.
left_pad_low_1_64
Extend a 1-bit value to a 64-bit value by padding its left with zeroes.
left_pad_low_8_16
Extend an 8-bit value to a 16-bit value by padding its left with zeroes.
left_pad_low_8_32
Extend an 8-bit value to a 32-bit value by padding its left with zeroes.
left_pad_low_8_64
Extend an 8-bit value to a 64-bit value by padding its left with zeroes.
left_pad_low_16_32
Extend a 16-bit value to a 32-bit value by padding its left with zeroes.
left_pad_low_16_64
Extend a 16-bit value to a 64-bit value by padding its left with zeroes.
left_pad_low_32_64
Extend a 32-bit value to a 64-bit value by padding its left with zeroes.
left_rotate_8
Left-rotate an 8-bit value by the given amount.
left_rotate_16
Left-rotate a 16-bit value by the given amount.
left_rotate_32
Left-rotate a 32-bit value by the given amount.
left_rotate_64
Left-rotate a 64-bit value by the given amount.
left_shift_8
Left-shift an 8-bit value by the given amount. Bits are filled with zeroes.
left_shift_16
Left-shift a 16-bit value by the given amount. Bits are filled with zeroes.
left_shift_32
Left-shift a 32-bit value by the given amount. Bits are filled with zeroes.
left_shift_64
Left-shift a 64-bit value by the given amount. Bits are filled with zeroes.
left_shift_with_8
Left-shift an 8-bit value by the given amount. Bits are filled with the given bit.
left_shift_with_16
Left-shift a 16-bit value by the given amount. Bits are filled with the given bit.
left_shift_with_32
Left-shift a 32-bit value by the given amount. Bits are filled with the given bit.
left_shift_with_64
Left-shift a 64-bit value by the given amount. Bits are filled with the given bit.
leftmost_8_1
Return the most significant 1 bits of an 8-bit value.
leftmost_8_2
Return the most significant 1 bits of an 8-bit value.
leftmost_8_4
Return the most significant 1 bits of an 8-bit value.
leftmost_16_1
Return the most significant 1 bit of a 16-bit value.
leftmost_16_2
Return the most significant 2 bits of a 16-bit value.
leftmost_16_4
Return the most significant 4 bits of a 16-bit value.
leftmost_16_8
Return the most significant 8 bits of a 16-bit value.
leftmost_32_1
Return the most significant 1 bit of a 32-bit value.
leftmost_32_2
Return the most significant 2 bits of a 32-bit value.
leftmost_32_4
Return the most significant 4 bits of a 32-bit value.
leftmost_32_8
Return the most significant 8 bits of a 32-bit value.
leftmost_32_16
Return the most significant 16 bits of a 32-bit value.
leftmost_64_1
Return the most significant 1 bits of a 64-bit value.
leftmost_64_2
Return the most significant 2 bits of a 64-bit value.
leftmost_64_4
Return the most significant 4 bits of a 64-bit value.
leftmost_64_8
Return the most significant 8 bits of a 64-bit value.
leftmost_64_16
Return the most significant 16 bits of a 64-bit value.
leftmost_64_32
Return the most significant 32 bits of a 64-bit value.
low_1
Return u1::MIN = 1.
low_8
Return u8::MIN.
low_16
Return u16::MIN.
low_32
Return u32::MIN.
low_64
Return u64::MIN.
maj_1
Bitwise MAJORITY of three 1-bit values. The output bit is false if two or more input bits are false, and true otherwise.
maj_8
Bitwise MAJORITY of three 1-bit values. The output bit is false if two or more input bits are false, and true otherwise.
maj_16
Bitwise MAJORITY of three 1-bit values. The output bit is false if two or more input bits are false, and true otherwise.
maj_32
Bitwise MAJORITY of three 1-bit values. The output bit is false if two or more input bits are false, and true otherwise.
maj_64
Bitwise MAJORITY of three 1-bit values. The output bit is false if two or more input bits are false, and true otherwise.
or_1
Bitwise OR of two 1-bit values.
or_8
Bitwise OR of two 8-bit values.
or_16
Bitwise OR of two 16-bit values.
or_32
Bitwise OR of two 32-bit values.
or_64
Bitwise OR of two 64-bit values.
right_extend_8_16
Extend an 8-bit value to a 16-bit value by padding its right with the MSB.
right_extend_8_32
Extend an 8-bit value to a 32-bit value by padding its right with the MSB.
right_extend_8_64
Extend an 8-bit value to a 64-bit value by padding its right with the MSB.
right_extend_16_32
Extend a 16-bit value to a 32-bit value by padding its right with the MSB.
right_extend_16_64
Extend a 16-bit value to a 64-bit value by padding its right with the MSB.
right_extend_32_64
Extend a 16-bit value to a 64-bit value by padding its right with the MSB.
right_pad_high_1_8
Extend a 1-bit value to an 8-bit value by padding its right with ones.
right_pad_high_1_16
Extend a 1-bit value to a 16-bit value by padding its right with ones.
right_pad_high_1_32
Extend a 1-bit value to a 32-bit value by padding its right with ones.
right_pad_high_1_64
Extend a 1-bit value to a 64-bit value by padding its right with ones.
right_pad_high_8_16
Extend an 8-bit value to a 16-bit value by padding its right with ones.
right_pad_high_8_32
Extend an 8-bit value to a 32-bit value by padding its right with ones.
right_pad_high_8_64
Extend a 1-bit value to a 64-bit value by padding its right with ones.
right_pad_high_16_32
Extend a 16-bit value to a 32-bit value by padding its right with ones.
right_pad_high_16_64
Extend a 16-bit value to a 64-bit value by padding its right with ones.
right_pad_high_32_64
Extend a 32-bit value to a 64-bit value by padding its right with ones.
right_pad_low_1_8
Extend a 1-bit value to an 8-bit value by padding its right with zeroes.
right_pad_low_1_16
Extend a 1-bit value to a 16-bit value by padding its right with zeroes.
right_pad_low_1_32
Extend a 1-bit value to a 32-bit value by padding its right with zeroes.
right_pad_low_1_64
Extend a 1-bit value to a 64-bit value by padding its right with zeroes.
right_pad_low_8_16
Extend an 8-bit value to a 16-bit value by padding its right with zeroes.
right_pad_low_8_32
Extend an 8-bit value to a 32-bit value by padding its right with zeroes.
right_pad_low_8_64
Extend an 8-bit value to a 64-bit value by padding its right with zeroes.
right_pad_low_16_32
Extend a 16-bit value to a 32-bit value by padding its right with zeroes.
right_pad_low_16_64
Extend a 16-bit value to a 64-bit value by padding its right with zeroes.
right_pad_low_32_64
Extend a 32-bit value to a 64-bit value by padding its right with zeroes.
right_rotate_8
Right-rotate an 8-bit value by the given amount.
right_rotate_16
Right-rotate a 16-bit value by the given amount.
right_rotate_32
Right-rotate a 32-bit value by the given amount.
right_rotate_64
Right-rotate a 64-bit value by the given amount.
right_shift_8
Right-shift an 8-bit value by the given amount. Bits are filled with zeroes.
right_shift_16
Right-shift a 16-bit value by the given amount. Bits are filled with zeroes.
right_shift_32
Right-shift a 32-bit value by the given amount. Bits are filled with zeroes.
right_shift_64
Right-shift a 64-bit value by the given amount. Bits are filled with zeroes.
right_shift_with_8
Right-shift an 8-bit value by the given amount. Bits are filled with the given bit.
right_shift_with_16
Right-shift a 16-bit value by the given amount. Bits are filled with the given bit.
right_shift_with_32
Right-shift a 32-bit value by the given amount. Bits are filled with the given bit.
right_shift_with_64
Right-shift a 64-bit value by the given amount. Bits are filled with the given bit.
rightmost_8_1
Return the least significant 1 bits of an 8-bit value.
rightmost_8_2
Return the least significant 1 bits of an 8-bit value.
rightmost_8_4
Return the least significant 1 bits of an 8-bit value.
rightmost_16_1
Return the least significant 1 bit of a 16-bit value.
rightmost_16_2
Return the least significant 2 bits of a 16-bit value.
rightmost_16_4
Return the least significant 4 bits of a 16-bit value.
rightmost_16_8
Return the least significant 8 bits of a 16-bit value.
rightmost_32_1
Return the least significant 1 bit of a 32-bit value.
rightmost_32_2
Return the least significant 2 bits of a 32-bit value.
rightmost_32_4
Return the least significant 4 bits of a 32-bit value.
rightmost_32_8
Return the least significant 8 bits of a 32-bit value.
rightmost_32_16
Return the least significant 16 bits of a 32-bit value.
rightmost_64_1
Return the least significant 1 bits of a 64-bit value.
rightmost_64_2
Return the least significant 2 bits of a 64-bit value.
rightmost_64_4
Return the least significant 4 bits of a 64-bit value.
rightmost_64_8
Return the least significant 8 bits of a 64-bit value.
rightmost_64_16
Return the least significant 16 bits of a 64-bit value.
rightmost_64_32
Return the least significant 32 bits of a 64-bit value.
some_1
Check if a 1-bit value is nonzero.
some_8
Check if an 8-bit value is nonzero.
some_16
Check if a 16-bit value is nonzero.
some_32
Check if a 32-bit value is nonzero.
some_64
Check if a 64-bit value is nonzero.
xor_1
Bitwise XOR of two 1-bit values.
xor_8
Bitwise XOR of two 8-bit values.
xor_16
Bitwise XOR of two 16-bit values.
xor_32
Bitwise XOR of two 32-bit values.
xor_64
Bitwise XOR of two 64-bit values.
xor_xor_1
Bitwise XOR of three 1-bit values.
xor_xor_8
Bitwise XOR of three 8-bit values.
xor_xor_16
Bitwise XOR of three 16-bit values.
xor_xor_32
Bitwise XOR of three 32-bit values.
xor_xor_64
Bitwise XOR of three 64-bit values.