| EDA Simulator Link™ MQ | ![]() |
mvl2dec('multivalued_logic_string')
mvl2dec('multivalued_logic_string', signed)
mvl2dec('multivalued_logic_string') converts a multivalued logic string multivalued_logic_string to a positive decimal. If multivalued_logic_string contains any character other than '0' or '1', NaN is returned. multivalued_logic_string must be a vector.
mvl2dec('multivalued_logic_string', signed) converts a multivalued logic string multivalued_logic_string to a positive or a negative decimal. If signed is true, this function assumes the first character multivalued_logic_string(1) to be a signed bit of a 2s complement number. If signed is missing or false, the multivalued logic string is converted to a positive decimal.
The following function call returns the decimal value 23:
mvl2dec('010111')
The following function call returns NaN:
mvl2dec('xxxxxx')
The following function call returns the decimal value -9:
mvl2dec('10111',true)![]() | hdldaemon | pingHdlSim | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |