关键词: exponent, floating point, format, I2C, linear, LINEAR11, mantissa, PMBus, serial, SMBus.
This Visual Basic® Add-in file for Microsoft Excel® provides custom spreadsheet functions that convert to and from the PMBus™ LINEAR11 format. This enables programmers and power systems engineers to easily convert PMBus LINEAR11 data received from an IC device into decimal values, or to convert decimal data into LINEAR11 format for transmission to a PMBus device.
In addition, there are special functions that extract the mantissa and exponent separately, which helps new users understand the structure and use of the LINEAR11 number format. This makes the PMBus Add-in a valuable educational tool as well.
These functions are written in Microsoft Visual Basic and can be added to any installation of Microsoft Excel as a temporary or permanent add-in, so that the functions are always available, very much like native Excel spreadsheet functions.
The PMBus standard includes a special format for representing floating-point numerical values. This format, called LINEAR11, is the preferred way to send and receive numerical data for all parameters other than output voltage.
This number format is two bytes long and comprises a 5-bit exponent and an 11-bit mantissa, both of which are signed numbers in two's-complement notation. Figure 1 shows the structure of the 16-bit LINEAR11 data format.
Figure 1. The structure of the LINEAR11 data format.
The exponent is represented by N and the mantissa is represented by Y. Because the mantissa spans the boundary between the two bytes of data, it is difficult to interpret these values "by eye." Furthermore, inherent limitations of the binary and hexadecimal analysis functions in Microsoft Excel make it rather difficult to parse these values in a spreadsheet.
To simplify use and understanding of this PMBus number format, Maxim has created an Excel "custom function" Add-in that can be easily installed on any PC running Microsoft Excel. Once this Add-in is loaded, it is always available for use, just like Excel's built-in functions.
The PMBus add-in provides optional commands and conversion functions to Microsoft Excel (Figure 2). To add it permanently to an Excel installation, follow this procedure:
Figure 2. Managing Add-Ins in Microsoft Excel
The functions were named in a pattern following the existing Microsoft Excel "Analysis ToolPak" add-in functions, for example Excel's DEC2HEX() function, which converts decimal (DEC) values to their hexadecimal (HEX) equivalent.
For these custom PMBus functions, the following mnemonic abbreviations are employed:
Here's how to use each of the custom functions included in this add-in.
This function converts decimal values into the LINEAR11 format. The conversion will optimize the exponent to maintain highest possible resolution, unless a specific exponent is "locked" by the optional [exponent] argument.
Format: DEC2L11(number,[exponent],[hexadecimal]) Arguments:
This function converts LINEAR11 values into their decimal equivalent.
This function returns the exponent value for any given LINEAR11 value.
This function returns the mantissa value for the LINEAR11 argument.
In addition to the add-in file itself, there is an Excel spreadsheet that shows these functions in use. Please refer to the examples in this file to see how these functions can be used to aid design and development of a PMBus system.
|© , Maxim Integrated Products, Inc.|
设计指南 6943,AN6943, AN 6943, APP6943, Appnote6943, Appnote 6943