virtual class util
virtual Provides several utility functions.
| util | virtual Provides several utility functions. |
| Functions | |
| num_oct_digits | static Returns the number of octal digits required to represent the specified binary digits. |
| num_dec_digits | static Returns the number of decimal digits required to represent the specified binary digits. |
| num_hex_digits | static Returns the number of hexadecimal digits required to represent the specified binary digits. |
static function int unsigned num_oct_digits( int unsigned num_bin_digits )
static Returns the number of octal digits required to represent the specified binary digits.
| num_bin_digits | The number of binary digits. |
The number of octal digits required to represent num_bin_digits.
assert( util::num_oct_digits( 3 ) == 1 ); // 3'b111 -> 1'o7 assert( util::num_oct_digits( 4 ) == 2 ); // 4'b1111 -> 2'o17
static function int unsigned num_dec_digits( int unsigned num_bin_digits )
static Returns the number of decimal digits required to represent the specified binary digits.
| num_bin_digits | The number of binary digits. |
The number of decimal digits required to represent num_bin_digits.
assert( util::num_dec_digits( 3 ) == 1 ); // 3'b111 -> 1'd7 assert( util::num_dec_digits( 4 ) == 2 ); // 4'b1111 -> 2'd15
static function int unsigned num_hex_digits( int unsigned num_bin_digits )
static Returns the number of hexadecimal digits required to represent the specified binary digits.
| num_bin_digits | The number of binary digits. |
The number of hexadecimal digits required to represent num_bin_digits.
assert( util::num_hex_digits( 3 ) == 1 ); // 3'b111 -> 1'h7 assert( util::num_hex_digits( 4 ) == 1 ); // 4'b1111 -> 1'hF
virtual Provides several utility functions.
virtual class util
static Returns the number of octal digits required to represent the specified binary digits.
static function int unsigned num_oct_digits( int unsigned num_bin_digits )
static Returns the number of decimal digits required to represent the specified binary digits.
static function int unsigned num_dec_digits( int unsigned num_bin_digits )
static Returns the number of hexadecimal digits required to represent the specified binary digits.
static function int unsigned num_hex_digits( int unsigned num_bin_digits )
virtual Provides a parameterized utility function.
virtual class putil #( type T = int )