Rounding hexadecimal floating-point numbers using binary incrementers

By rounding hexadecimal floating point numbers using binary incrementers and correction logic in COBOL, the inefficiency problem in the prior art is solved, efficient rounding operation is achieved, and the performance of the computing system is enhanced.

CN118974696APending Publication Date: 2024-11-15INTERNATIONAL BUSINESS MACHINE CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380030006.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-03-25
Filing Date
2023-03-21
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The lack of local rounding functions of the existing COBOL implementations leads to inefficient efficiency in hexadecimal floating point rounding operations, requiring multiple operations to bypass the limit, resulting in inefficient computation.

Method used

Use a binary incrementer to round hexadecimal floating point numbers. Through the two steps of rounding decision and conditional increment, combined with the leading zero predictor and correction logic, we solve the lz2lrg error and overflow problems to achieve effective rounding operations.

Benefits of technology

It improves the efficiency of hexadecimal floating point number rounding operation, reduces operands, avoids leading zero errors, and enhances the performance of the computing system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118974696A_ABST
    Figure CN118974696A_ABST
Patent Text Reader

Abstract

Rounding a hexadecimal floating point number using a binary incrementer, including incrementing, by a first incrementer, a first subset of bits of an operand including a binary hexadecimal floating point operand; incrementing a second subset of bits of the operand by a second incrementer; generating an intermediate result based on the carry output of the second incrementer; and generating an incremental result based on the carry output of the first incrementer and one or more of: the first bit of the intermediate result or the carry output of the second incrementer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The field of the present invention is data processing, or more specifically, methods, apparatus, and products for rounding hexadecimal floating point numbers using a binary incrementer. Background Art

[0002] The development of the EDVAC computer system in 1948 is often considered the beginning of the computer age. Since then, computer systems have evolved into extremely complex devices. Today's computers are much more complex than earlier systems (such as the EDVAC). Computer systems typically include a combination of hardware and software components, application programs, operating systems, processors, buses, memory, input / output devices, etc. As advances in semiconductor processing and computer architecture have driven computers to higher and higher performance, more complex computer software has been developed to take advantage of the higher performance of the hardware, resulting in today's computer systems being much more powerful than just a few years ago.

[0003] Programming languages ​​such as COBOL use hexadecimal floating point formatting to encode floating point numbers. Existing COBOL implementations lack native implementations for rounding functions other than truncation (e.g., rounding toward zero). To circumvent these limitations, multiple COBOL operations are used to circumvent the limitation and perform other rounding operations. Summary of the invention

[0004] The foregoing and other objects, features and advantages of the invention will become apparent from the following more particular description of exemplary embodiments of the invention as illustrated in the accompanying drawings, wherein like reference numerals generally refer to like parts of exemplary embodiments of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0005] Figure 1A An example arrangement for incrementation and rounding decisions for hexadecimal floating point numbers according to some embodiments of the present disclosure is shown.

[0006] Figure 1B An example arrangement for incrementation and rounding decisions for hexadecimal floating point numbers according to some embodiments of the present disclosure is shown.

[0007] Figure 2 A block diagram is shown of an example logic flow for rounding a hexadecimal floating point number using a binary incrementer, according to some embodiments of the present disclosure.

[0008] Figure 3A is an example increment of a fraction component for rounding a hexadecimal floating point number using a binary incrementer according to some embodiments of the present disclosure.

[0009] Figure 3Bis an example increment of a fractional component for rounding a hexadecimal floating point number using a binary incrementer according to some embodiments of the present disclosure.

[0010] Figure 4 A block diagram of an example computer for rounding hexadecimal floating point numbers using a binary incrementer is shown in accordance with some embodiments of the present disclosure.

[0011] Figure 5 A flow chart of an example method for rounding a hexadecimal floating point number using a binary incrementer according to some embodiments of the present disclosure is shown.

[0012] Figure 6 A flowchart showing another example method for rounding a hexadecimal floating point number using a binary incrementer

[0013] Figure 7 A flowchart showing another example method for rounding a hexadecimal floating point number using a binary incrementer

[0014] Figure 8 A flowchart showing another example method for rounding a hexadecimal floating point number using a binary incrementer

[0015] Fig. 9 A flowchart showing another example method for rounding a hexadecimal floating point number using a binary incrementer DETAILED DESCRIPTION

[0016] Programming languages ​​such as COBOL use hexadecimal floating point formatting to encode floating point numbers. Existing COBOL implementations lack native implementations for rounding functions other than truncation (e.g., rounding toward zero). To work around these limitations, multiple COBOL operations (e.g., about fifteen operations) are used to work around the limitation and perform other rounding operations. This approach is very inefficient due to the large number of operations required.

[0017] In order to solve these problems, referring to the accompanying drawings, Figure 1A and 1B The method, apparatus and product for rounding a hexadecimal floating point number using a binary incrementer according to the present invention are initially described. Figure 1A and 1B An exemplary bit arrangement for performing increment and rounding decisions for hexadecimal floating point numbers is shown. The rounding operation includes two steps: a rounding decision and a conditional increment. The rounding decision and conditional increment are performed on different subsets of the bits of the fractional component of the operand. In the event that the rounding decision determines that the operand should be rounded up, the conditionally incremented value is included in the result. Due to timing reasons, the conditional increment is calculated at the same time as the rounding decision. Based on the result of the rounding determination, an incremented or non-incremented result is selected.

[0018] Before rounding a hexadecimal floating point operand, the operand must be normalized by removing any leading zeros. To this end, in some embodiments, a leading zero predictor is used. Although faster than a leading zero counter, whereby each leading zero is counted individually before normalization, the leading zero predictor may be off by one, resulting in a "leading zero too large" (e.g., "lz2lrg") error.

[0019] To perform rounding of a hexadecimal floating-point operand, a portion of the operand is incremented to account for rounding upwards, while another portion of the operand is used to compute the rounding decision. Because normalization makes operands susceptible to lz2lrg errors, the bit indices marking the increment and rounding decision may be offset by four bits, which is the number of bits used to encode a hexadecimal number that has experienced an lz2lrg error. For example, Figure 1A An example listing of bit indices for a hexadecimal floating point number without the lz2lrg error is shown. Here, the operand is incremented at index 56 (indicated by item 102), and rounding decisions are performed on the bits starting at index 57 (indicated by item 104). In contrast, Figure 1B As shown, in the case of a lz2lrg error, the operand may be incremented at index 52, as shown in item 106, and a rounding decision may be performed starting at index 53, as shown in item 108. It will be appreciated by those skilled in the art that Figure 1A and 1B The indices identified in , and the specific indices used in some embodiments, may vary depending on the specific encoding of the hexadecimal floating point operands.

[0020] therefore, Figure 2 An example logic flow for rounding a hexadecimal floating point number using a binary incrementer according to some embodiments of the present disclosure is described. The example logic flow can be implemented, for example, in a chip, a semiconductor device, or other understandable computing logic. For example, the chip can be implemented in various computing devices, including servers, personal computers, mobile devices, set-top boxes, etc.

[0021] like Figure 2 As shown, the example logic flow includes an input 200. The input 200 includes a fractional component of a hexadecimal floating point operand. As an example, the input 200 includes a fifty-six-bit fractional component of a hexadecimal double precision floating point operand. The example logic flow also includes two incrementers 202a, 202b. Each incrementer 202a, 202b adds one to the input binary value and provides an incremented result and a carryout as output. If the incremented result causes the highest order bit of the incremented result to have a carryout, the carryout can be set or reset (e.g., high or low).

[0022] As shown, the input 200 bits (shown using symbols (0:52)) from index zero to index fifty-two are provided to incrementer 202a. Therefore, in some embodiments, incrementer 202a is a fifty-three-bit incrementer 202a that increments the input fifty-three-bit value. Incrementer 202b accepts the last four bits (e.g., bits (53:56)) of input 200 as input. Therefore, in some embodiments, incrementer 202b includes a four-bit incrementer 202b. It will be appreciated by those skilled in the art that the use of incrementers 202a, 202b allows the use of fifty-three-bit binary incrementers 202a (e.g., for rounding binary double-precision floating point numbers) that have been used in various computing logic implementations, requiring only four-bit incrementers 202b to be added to the logic flow. It will also be appreciated by those skilled in the art that the method described herein may be applicable to other encodings of hexadecimal floating point numbers, wherein incrementer 202b may be used to accept the last four bits of the fractional component, and another incrementer accepts the remaining bits of the fractional.

[0023] The incremented output of incrementer 202a is provided to multiplexer 204 along with the non-incremented bits (0:52) from input 200. Thus, both the incremented and non-incremented values ​​are provided to multiplexer 204, and the carry output C from incrementer 202b is 53 Used to select which value to output. Figure 3A and 3B As shown, the carry output C 53 A determination is made as to whether the intermediate result 206 should include incremented or non-incremented bits from the input 200 (0:52).

[0024] Input 302 includes the last four bits, which, when incremented, will not result in a carry output (e.g., any last four bits other than "1111"). Thus, intermediate value 304 may include the last four bits that were incremented (e.g., the output from incrementer 202b) and the bits that were not incremented (0:52). In contrast, Figure 3B The input 306 of includes the last four bits "1111". When these bits are provided to incrementer 202b, the result will have a carry output C of "1". 53 This results in intermediate value 308 including the incremented bits (0:52) (eg, the output from incrementer 202a) and the output of incrementer 202B.

[0025] After calculating the intermediate result 206, the intermediate result 206 should be corrected to resolve the lz2lrg error (if any). Moreover, when the intermediate result 206 includes an overflow, the intermediate result 206 should be shifted and the exponent component of the operand incremented to resolve the overflow. These operations are performed by the correction logic 208 to generate the incremented result 210.

[0026] The incremented result 210 is a hexadecimal floating point number that is an incremented version of the operand from which the fractional component of input 200 was selected. Thus, the incremented result 210 includes a fractional component and an exponent component. Correction logic 208 accepts the carry output C from incrementer 202b. 53 , the carry output C0 from incrementer 202a, and the intermediate result 206 as inputs. 53 When both C0 and C1 are set (e.g., equal to "1"), the fraction component of the incremented result 210 is equal to "001", which is appended to the leading edge of bits (0:52) of the intermediate result 206 (e.g., as the highest order bits). The exponent component of the operand is incremented to calculate the exponent component of the incremented result 210. This effectively shifts out bits (53:56) to resolve the lz2lrg error and resolve overflow.

[0027] In the case where C0 is not set and the first bit (e.g., bit (0)) of the intermediate result 206 is set, the fractional component of the incremented result 210 is equal to "000", which is appended to the front end of bits (0:52) of the intermediate result 206 (e.g., as the highest bit). The exponent component of the operand is incremented to calculate the exponent component of the incremented result 210. This effectively shifts bits (53:56) out to resolve the lz2lrg error without overflow. In the case where C0 is not set and the first bit (e.g., bit (0)) of the intermediate result 206 is not set (indicating no lz2lrg error and no overflow), the fractional component of the incremented result 210 is equal to bits (1:56) of the intermediate result 206. As described above, each possible fractional component of the incremented result 210 is represented as a fifty-six bit value. Then, each of the incremented result 210 and the original incremented operand can be conditionally selected as the output of the rounding operation based on the rounding decision.

[0028] As described above, under certain conditions, the bit value "000" or "001" may be appended to the front of the incremental result 210. In the presence of a lz2lrg error, the fifty-six bit fractional component is effectively transmitted as bits (-3:52). As it is known (due to the construction of the leading zero predictor) that the first three bits are leading zeros, only bits (0:52) of the intermediate result 206 need to be used. Therefore, "001" or "000" is appended depending on whether the execution is present or not. Conversely, in the absence of a lz2lrg error, bits (1:56) of the intermediate result 206 transmit the fractional component of the incremental result 210.

[0029] Those skilled in the art will appreciate that the method described herein for rounding hexadecimal floating point numbers using a binary incrementer allows the use of existing incrementers (eg, fifty-three bit incrementer 202a) with an additional four bit incrementer 202b to round hexadecimal floating point numbers.

[0030] The use of a binary incrementer to round a hexadecimal floating point number according to the present application is usually implemented using a computer, i.e., using an automatic computing machine. Therefore, for further explanation, Figure 4 A block diagram of computing machinery including an exemplary computer 400 configured to round hexadecimal floating point numbers using a binary incrementer according to certain embodiments is shown. Figure 4 Computer 400 includes at least one computer processor 402 or “CPU” and random access memory 404 (“RAM”) connected to processor 402 and other components of computer 400 via a high-speed memory bus 406 and a bus adapter 408 .

[0031] An operating system 410 is stored in RAM 404. Operating systems useful in computers configured to use a binary incrementer to round hexadecimal floating point numbers according to some embodiments include UNIX TM , Linux TM 、MicrosoftWindows TM and other operating systems apparent to those skilled in the art. Figure 4 Operating system 410 in the example of is shown in RAM 404, but many components of such software are also typically stored in non-volatile memory, for example on data storage 412 such as a disk drive.

[0032] Figure 4 Computer 400 includes a disk drive adapter 416 coupled to processor 402 and other components of computer 400 through expansion bus 418 and bus adapter 408. Disk drive adapter 416 connects non-volatile data storage to computer 400 in the form of data storage 412. Disk drive adapters useful in computers configured to use a binary incrementer to round hexadecimal floating point numbers in accordance with certain embodiments include integrated drive electronics ("IDE") adapters, small computer system interface ("SCSI") adapters, and other adapters as will occur to those skilled in the art. In some embodiments, non-volatile computer memory is implemented as an optical disk drive, an electrically erasable programmable read-only memory (so-called "EEPROM" or "flash memory"), a RAM drive, etc., as will occur to those skilled in the art.

[0033] Figure 4 The example computer 400 includes one or more input / output ("I / O") adapters 420. The I / O adapters implement user-oriented input / output through, for example, software drivers and computer hardware to control output to a display device such as a computer display screen, and user input from user input devices 422 such as a keyboard and mouse. Figure 4 The example computer 400 includes a video adapter 424, which is an example of an I / O adapter specifically designed for graphical output to a display device 426, such as a display screen or computer monitor. Video adapter 424 connects to processor 402 through a high-speed video bus 428, bus adapter 408, and front-side bus 430, which is also a high-speed bus.

[0034] Figure 4 The exemplary computer 400 includes a communication adapter 432 for data communications with other computers and for data communications with a data communications network. Such data communications are performed serially via an RS-232 connection, via an external bus such as a universal serial bus ("USB"), via a data communications network such as an IP data communications network, and / or in other ways that will occur to those skilled in the art. The communication adapter implements the hardware level of data communications by which one computer sends data communications to another computer directly or via a data communications network. Examples of communication adapters useful in computers configured to round hexadecimal floating point numbers using a binary incrementer according to certain embodiments include modems for wired dial-up communications, Ethernet (IEEE 802.3) adapters for wired data communications, and 802.11 adapters for wireless data communications.

[0035] To further illustrate, Figure 5 A flow chart of an example method for rounding a hexadecimal floating point number using a binary incrementer according to some embodiments of the present disclosure is shown. Figure 5 The method can be implemented, for example, by Figure 2 The logic flow of the chip 500 is executed. Figure 5 The method includes incrementing 502 a first bit subset of operand 520 by first incrementer 202a. Operand 520 is a hexadecimal floating point number. In some embodiments, the first bit subset may include, for example, a highest order subset of bits of a fractional component of operand 520 (e.g., bits (0:52)).

[0036] Figure 5 The method also includes incrementing 504 a second bit subset of the operand by the second incrementer 202 b. In some embodiments, the second bit subset includes those bits of the fractional component of the operand 520 other than the first bit subset. In other words, the second bit subset includes the lowest order bits of the fractional component. As an example, the second bit subset includes the four lowest bits of the fractional component of the operand 520.

[0037] Figure 5 The method further includes determining the carry output C of the second incrementer 202b based on the carry output C of the second incrementer 202b. 53The intermediate result 206 is generated 506. As will be described in further detail below, the intermediate result 206 may include a subset of bits corresponding to the first subset of bits of the operand 520. The intermediate result 206 may include an incremented (e.g., output of the incrementer 202a) or a non-incremented version of the first subset of bits, depending on the carry output C. 53 As will also be described in further detail below, the intermediate result 206 will include the output of the second incrementer 202b.

[0038] Figure 5 The method further includes generating 508 an incremented result 210 based on a carry output (eg, C0) of the first incrementer 202a and one or more of: a first bit of the intermediate result 206 or a carry output (eg, C1) of the second incrementer 202b; 53 ). As will be described in further detail below, the fractional component of the incremented result 210 may be selected as a subset of the bits of the intermediate result 206. To account for lz2lrg errors and overflows, the exponent component of the incremented result 210 may be incremented by a particular factor.

[0039] Those skilled in the art may appreciate that after the incremented result 210 is calculated, each of the incremented result 210 and the operand 520 may be conditionally selected as an output of a rounding function depending on the rounding decision applied to the operand 520 .

[0040] To explain further, Figure 6 A flow chart is set forth of another example method for rounding a hexadecimal floating point number using a binary incrementer according to some embodiments of the present disclosure. Figure 6 Methods and Figure 5 The similarity is that Figure 6 The method includes: incrementing 502 a first bit subset of an operand 520 by a first incrementer 202a; incrementing 504 a second bit subset of the operand 520 by a second incrementer 202b; generating 506 an intermediate result 206 based on a carry output of the second incrementer 202b; and generating 508 an incremented result 210 based on the carry output of the first incrementer 202a and one or more of: the first bit of the intermediate result 206 or the carry output of the second incrementer 202b.

[0041] Figure 6 Methods and Figure 5 The difference is that generating 506 the intermediate result 206 includes responding to the carry output (eg, C 53) is not set and includes 602 (e.g., in the intermediate result) the non-incremented first bit subset of the operand 520. Therefore, when the carry output of the second incrementer 202b is not set, the highest order bits of the intermediate result 206 (e.g., bits (0:52)) are equal to the input to the first incrementer 202a (e.g., not incremented).

[0042] Generating 506 the intermediate result 206 also includes responding to the carry output (eg, C 53 ) is set and (e.g., in the intermediate result) includes 604 the incremented first bit subset of the operand 520. Therefore, when the carry output of the second incrementer 202b is set, the highest order bit (e.g., bits (0:52)) of the intermediate result 206 is equal to the output of the first incrementer 202a.

[0043] Generating 506 the intermediate result 206 also includes 606 (e.g., in the intermediate result) incrementing a second subset of bits of the operand 520 (e.g., the output of the second incrementer 202 b). Thus, independent of the carry output of the second incrementer 202 b, the lowest order bits of the intermediate result 206 (e.g., bits (53:56)) are equal to the output of the second incrementer 202 b.

[0044] To explain further, Figure 7 A flowchart of another example method for rounding a hexadecimal floating point number using a binary incrementer according to some embodiments of the present disclosure is set forth. In particular, Figure 7-9 Various conditional operations are described for generating 508 incremented results. Thus, although for the sake of clarity, Figure 7-9 are shown as separate flow charts, but those skilled in the art will appreciate that in addition to Figure 5 and 6 In addition to the combination, Figure 7-9 The methods described in can be used in combination with each other.

[0045] Figure 7 Methods and Figure 5 The similarity is that Figure 7 The method includes: incrementing 502 a first bit subset of an operand 520 by a first incrementer 202a; incrementing 504 a second bit subset of the operand 520 by a second incrementer 202b; generating 506 an intermediate result 206 based on a carry output of the second incrementer 202b; and generating 508 an incremented result 210 based on the carry output of the first incrementer 202a and one or more of: the first bit of the intermediate result 206 or the carry output of the second incrementer 202b.

[0046] Figure 7 Methods and Figure 5The difference is that generating 508 the incremented result 210 includes determining 702 that the carry output (eg, C0) of the first incrementer 202a is set and the carry output (eg, C0) of the second incrementer 202b is set. 53 ) is set. Generating 508 incremented result 210 also includes generating 704 (eg, in response to C 53 and C0 are set) and the intermediate result excluding the output of the second incrementer 202b as a fractional component (e.g., the incremented result 210). As an example, the first predefined portion of the leading bits includes "001", and the remaining bits (e.g., the intermediate result 206 excluding the output of the second incrementer 202b, bits (0:52) of the intermediate result 206) are appended thereto.

[0047] Generating 508 incremented result 210 also includes incrementing 706 (eg, in response to C 53 and C0 are set) to the exponent component of operand 520. Therefore, the exponent component of incremented result 210 is equal to the incremented exponent component of operand 520.

[0048] To explain further, Figure 8 A flow chart of another example method for rounding a hexadecimal floating point number using a binary incrementer is shown in accordance with some embodiments of the present disclosure. Figure 8 Methods and Figure 5 The similarity is that Figure 8 The method includes: incrementing 502 a first bit subset of an operand 520 by a first incrementer 202a; incrementing 504 a second bit subset of the operand 520 by a second incrementer 202b; generating 506 an intermediate result 206 based on a carry output of the second incrementer 202b; and generating 508 an incremented result 210 based on the carry of the first incrementer 202a and one or more of: the first bit of the intermediate result 206 or the carry output of the second incrementer 202b.

[0049] Figure 8 Methods and Figure 5, is that generating 508 the incremented result 210 includes determining 802 that the carry output of the first incrementer 202a (e.g., C0) is not set and the first bit of the intermediate result 206 (e.g., bit (0)) is set. Generating 508 the incremented result 210 also includes generating 804 (e.g., in response to C0 being not set and the first bit of the intermediate result 206 being set) a second predefined portion of leading bits and the intermediate result excluding the output of the second incrementer 202b as a fractional component (e.g., of the incremented result 210). As an example, the second predefined portion of leading bits includes "000" and the remaining bits (e.g., the intermediate result 206 excluding the output of the second incrementer 202b, bits (0:52) of the intermediate result 206) are appended thereto.

[0050] Generating 508 incremented result 210 also includes incrementing 806 (eg, in response to C0 not being set and the first bit of intermediate result 206 being set) an exponent component of operand 520. Thus, the exponent component of incremented result 210 is equal to the incremented exponent component of operand 520.

[0051] To explain further, Fig. 9 A flow chart is set forth of another example method for rounding a hexadecimal floating point number using a binary incrementer according to some embodiments of the present disclosure. Fig. 9 Methods and Figure 5 The similarity is that Fig. 9 The method includes: incrementing 502 a first bit subset of an operand 520 by a first incrementer 202a; incrementing 504 a second bit subset of the operand 520 by a second incrementer 202b; generating 506 an intermediate result 206 based on a carry output of the second incrementer 202b; and generating 508 an incremented result 210 based on the carry output of the first incrementer 202a and one or more of: the first bit of the intermediate result 206 or the carry output of the second incrementer 202b.

[0052] Fig. 9 Methods and Figure 5 , except that generating 508 the incremented result 210 includes determining 902 that the carry output (e.g., C0) of the first incrementer 202a is not set and the first bit (e.g., bit (0)) of the intermediate result 206 is not set. Generating 508 the incremented result 210 also includes generating 904 (e.g., in response to C0 not being set and the first bit of the intermediate result 206 not being set) the intermediate result 206 excluding the first bit of the intermediate result 206 as a fractional component (e.g., of the incremented result 210). Therefore, the fractional component of the incremented result 210 is equal to bits (1:56) of the intermediate result 206.

[0053] In view of the explanations set forth above, the reader may recognize that the benefits of using a binary incrementer to round hexadecimal floating point numbers according to embodiments of the present invention include improved performance of a computing system by allowing the use of an existing fifty-three bit incrementer to efficiently round hexadecimal floating point numbers.

[0054] Exemplary embodiments of the present invention are described primarily in the context of a fully functional computer system for rounding hexadecimal floating point numbers using a binary incrementer. However, those skilled in the art will recognize that the present invention may also be embodied in a computer program product that is arranged on a computer-readable storage medium for use with any appropriate data processing system. The computer-readable storage medium may be any storage medium for machine-readable information, including magnetic media, optical media, or other suitable media. Examples of such media include magnetic or floppy disks in hard drives, optical disks for optical drives, tapes, and other media that may be conceived by those skilled in the art. Those skilled in the art may immediately recognize that any computer system with appropriate programming means will be able to perform the steps of the method of the present invention as embodied in a computer program product. Those skilled in the art may also recognize that, although some exemplary embodiments described in this specification are oriented to software installed and executed on computer hardware, alternative embodiments implemented as firmware or hardware are also within the scope of the present invention.

[0055] The present invention may be a system, method and / or computer program product. The computer program product may include a computer-readable storage medium (or multiple media) having computer-readable program instructions thereon, the computer-readable program instructions being used to cause a processor to perform various aspects of the present invention.

[0056] A computer-readable storage medium may be a tangible device capable of retaining and storing instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of computer-readable storage media includes the following: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device such as a punch card or a raised structure in a groove with instructions recorded thereon, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium should not be interpreted as a temporary signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (e.g., a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.

[0057] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to a corresponding computing / processing device, or downloaded to an external computer or external storage device via a network (e.g., the Internet, a local area network, a wide area network, and / or a wireless network). The network can include copper transmission cables, optical transmission fibers, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in a computer-readable storage medium in the corresponding computing / processing device.

[0058] The computer-readable program instructions for performing the operation of the present invention can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​(such as Smalltalk, C++, etc.) and conventional procedural programming languages ​​(such as "C" programming language or similar programming languages). The computer-readable program instructions can be executed completely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or completely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider through the Internet). In some embodiments, in order to perform various aspects of the present invention, the electronic circuit including, for example, a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA) can execute the computer-readable program instructions by utilizing the state information of the computer-readable program instructions to personalize the electronic circuit.

[0059] Various aspects of the present invention are described herein with reference to the flow chart and / or block diagram of the method, device (system) and computer program product according to embodiments of the present invention. It will be understood that each frame of the flow chart and / or block diagram and the combination of frames in the flow chart and / or block diagram can be implemented by computer-readable program instructions.

[0060] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device create a device for implementing the functions / actions specified in one or more boxes of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, which can guide the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable storage medium having the instructions stored therein includes an article of manufacture, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes of the flowchart and / or block diagram.

[0061] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device, so that a series of operational steps are performed on the computer, other programmable apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable apparatus, or other device implement the functions / actions specified in one or more boxes of the flowchart and / or block diagram.

[0062] Flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention.In this regard, each frame in flow chart or block diagram can represent the module, segment or part of instruction, and it comprises one or more executable instructions for realizing the logical function of appointment.In some alternative embodiments, the function mentioned in the frame may not occur in the order mentioned in the figure.For example, two frames shown continuously can actually be performed substantially at the same time, or these frames can sometimes be performed in reverse order, depending on the function involved.It will also be noted that the combination of the frame in each frame of block diagram and / or flow chart illustration and block diagram and / or flow chart illustration can be realized by the dedicated hardware-based system of performing a specified function or action or performing a combination of special hardware and computer instruction.

[0063] It will be appreciated from the foregoing description that the various embodiments of the present invention may be modified and altered without departing from the true spirit of the present invention. The descriptions in this specification are for illustrative purposes only and should not be construed as limiting. The scope of the present invention is limited only by the language of the appended claims.

Claims

1. A method for rounding a hexadecimal floating point number using a binary incrementer, the method comprising: incrementing, by a first incrementer, a first subset of bits of an operand comprising a binary hexadecimal floating point operand; incrementing a second subset of bits of the operand by a second incrementer; generating an intermediate result based on a carry output of the second incrementer; and An incremented result is generated based on a carry output of the first incrementer and one or more of: a first bit of the intermediate result or the carry output of the second incrementer.

2. The method according to claim 1, wherein: Generating the intermediate result includes: responsive to the carry output of the second incrementer not being asserted, including a non-incremented first subset of bits of the operand in the intermediate result; In response to the carry output of the second incrementer being set, including an incremented first subset of bits of the operand in the intermediate result; and An incremented second subset of bits of the operand is included in the intermediate result.

3. The method according to claim 1, wherein: Generating the incremental result includes: In response to the carry output of the first incrementer being set and the carry output of the second incrementer being set: generating a first predefined portion of the leading bits and the intermediate result excluding the output of the second incrementer as a fractional component of the incremented result; and Increments the exponent component of the operand.

4. The method according to claim 3, wherein: Generating the incremental result includes: In response to the carry output of the first incrementer being unset and the first bit of the intermediate result being set: generating a second predefined portion of the leading bits and the intermediate result excluding the output of the second incrementer as the fractional component of the incremented result; and Increments the exponent component of the operand.

5. The method according to claim 4, wherein: Generating the incremental result includes: In response to the carry output of the first incrementer not being set and the first bit of the intermediate result not being set, generating the intermediate result excluding the first bit of the intermediate result as the fractional component of the incremented result.

6. The method according to claim 1, wherein: The second subset of bits of the operand includes the four least significant bits of the input operand.

7. The method according to claim 6, wherein: The second incrementer comprises a four-bit incrementer.

8. The method according to claim 1, wherein: The first incrementer comprises a fifty-three bit incrementer.

9. A chip for rounding a hexadecimal floating point number using a binary incrementer, comprising: first incrementer; Second incrementer; as well as The chip is configured to execute steps, the steps comprising: incrementing, by said first incrementer, a first subset of bits of an operand comprising a binary hexadecimal floating point operand; incrementing a second subset of bits of the operand by the second incrementer; generating an intermediate result based on a carry output of the second incrementer; and An incremented result is generated based on a carry output of the first incrementer and one or more of: a first bit of the intermediate result or the carry output of the second incrementer.

10. The chip according to claim 9, wherein: Generating the intermediate result includes: responsive to the carry output of the second incrementer not being asserted, including a non-incremented first subset of bits of the operand in the intermediate result; In response to the carry output of the second incrementer being set, including an incremented first subset of bits of the operand in the intermediate result; and An incremented second subset of bits of the operand is included in the intermediate result.

11. The chip according to claim 9, wherein: Generating the incremental result includes: In response to the carry output of the first incrementer being set and the carry output of the second incrementer being set: generating a first predefined portion of the leading bits and the intermediate result excluding the output of the second incrementer as a fractional component of the incremented result; and Increments the exponent component of the operand.

12. The chip according to claim 11, wherein: Generating the incremental result includes: In response to the carry output of the first incrementer being unset and the first bit of the intermediate result being set: generating a second predefined portion of the leading bits and the intermediate result excluding the output of the second incrementer as the fractional component of the incremented result; and Increments the exponent component of the operand.

13. The chip according to claim 12, wherein: Generating the incremental result includes: In response to the carry output of the first incrementer not being set and the first bit of the intermediate result not being set, generating the intermediate result excluding the first bit of the intermediate result as the fractional component of the incremented result.

14. The chip according to claim 9, wherein: The second subset of bits of the operand includes the four least significant bits of the input operand.

15. The chip according to claim 14, wherein: The second incrementer comprises a four-bit incrementer.

16. The chip according to claim 9, wherein: The first incrementer comprises a fifty-three bit incrementer.

17. A device for rounding a hexadecimal floating point number using a binary incrementer, the device comprising a chip, the chip comprising: first incrementer; Second incrementer; as well as The chip is configured to execute steps, the steps comprising: incrementing, by said first incrementer, a first subset of bits of an operand comprising a binary hexadecimal floating point operand; incrementing a second subset of bits of the operand by the second incrementer; generating an intermediate result based on a carry output of the second incrementer; and An incremented result is generated based on a carry output of the first incrementer and one or more of: a first bit of the intermediate result or the carry output of the second incrementer.

18. The device according to claim 17, wherein: Generating the intermediate result includes: responsive to the carry output of the second incrementer not being asserted, including a non-incremented first subset of bits of the operand in the intermediate result; In response to the carry output of the second incrementer being set, including an incremented first subset of bits of the operand in the intermediate result; and An incremented second subset of bits of the operand is included in the intermediate result.

19. The device according to claim 17, wherein: Generating the incremental result includes: In response to the carry output of the first incrementer being set and the carry output of the second incrementer being set: generating a first predefined portion of the leading bits and the intermediate result excluding the output of the second incrementer as a fractional component of the incremented result; and Increments the exponent component of the operand.

20. The device according to claim 19, wherein Generating the incremental result includes: In response to the carry output of the first incrementer being unset and the first bit of the intermediate result being set: generating a second predefined portion of the leading bits and the intermediate result excluding the output of the second incrementer as the fractional component of the incremented result; and Increments the exponent component of the operand.