- •1. Objectives of the Term Work
- •2. Basic Principles
- •2.1. Digital Logarithmic (dl) Representation
- •0(Zero)
- •Integer part Fractional part
- •2.2. Basic Rules of dl Arithmetic
- •2.3. Basic Algorithms of Data Processing
- •3. Models of Data Structures in the Main Memory
- •4. Processing the dl-type of Data in computer
- •Figure 4.1 Class Diagram
- •5. Solution of the task of term assignment
- •Figure 5.1. Snapshot of result.
- •Attachment. Source code of the developed class.
0(Zero)
Fig. 2.1. Coverage of the numeric axis in DL coding
Such coverage is achieved by increasing the number of elements representing significant digits in the code array. It is significant that such an increase of mantissa is not mechanistic, and the full coverage of the numeric axis, as modeling of numeric structures shows, is provided by an increase of the total bit capacity.
Here, the chief feature of DL coding is a unified structure for all number types. No other numeric system allows an exact representation of such a number, e.g.:
А = +. 2. +1637833. -187183738.
The mantissa of a number А in the DL representation is a field of DL codes with the appropriate structure and format of this number:
Integer part Fractional part
SignA A |
QA |
17 |
14 |
10 |
9 |
5 |
0 |
-1 |
-3 |
-7 |
-19 |
The integer part of a DL number is a set of the mantissa digits Mi, which are more than or equal to zero; the fractional part is a set of the mantissa digits Mj, which are less than zero, i.e. have the sign of minus. The digit sets of the fractional and integer parts of the number may be ordered in a definite order or positioned in the mantissa in an arbitrary order. The both sets are not divided in the mantissa and represent the unique field of the number DL codes.
In DL data representation, there is no need in mantissa normalization. DL representation excludes the procedure of normalization used in the binary representation of operands in computers.
The mantissa of a DL number, for a fixed number of bits may represent a binary number with the same number of bits (if all the digits of the binary number are equal to 1), or with a much larger number of bits when at the expense of zero digits, provided a given number of significant digits, it is possible to save, along with the most significant digits of the number, its least significant digits, which are usually eliminated in the binary representation.
The mantissa of a DL number may also have a non-fixed number of bits. After arithmetic operations performed in DL representation, this number may either increase or decrease as compared to the initial number of bits in the operands (at the beginning of problem solution). The conditions of using DL structures in computer processing also allows setting a necessary number of bits in the mantissa required to improve the calculation accuracy. This can be done either at the beginning or in the course of the computational process.
2.2. Basic Rules of dl Arithmetic
The way of number representation determines the rules and algorithms of performing operations with them. The basic rules of performing bit-to-bit operations are given in Table 2.2 [1-2].
Table 2.2
Rules of performing bit-to-bit operations in DL representation
Operation |
Rules of performing the operation |
Addition |
1)
2)
|
Subtraction |
1)
2)
|
Multiplication |
|
Number shift by m digits |
|
Logical AND |
1)
2)
|
Logical OR |
1)
2)
|
where Nі, Nk are nonzero digits of operands.
To arrange data processing in DL representation, you should take into account that the code of a nonzero digit (the position number of a nonzero digit) is equal to the logarithm of the weight determined by this digit. Such representation allows reducing multiplication operations to an operation of addition-subtraction. For example, multiplication of two numbers in DL representation is performed as elementwise addition of two vectors [1-2]. The replacement of multiplication-division by addition-subtraction in the realization of multiplicative operations reduces the hardware cost in the operational structures and simplifies the organization of such structures.
Data
processing in DL representation is based on the use of the algorithms
of integer arithmetic [1-4]. In a software model of DL arithmetic
realization, the data structure for saving DL numbers is a
one-dimensional array of integers with a sign. The first element of
the array is the sign of the number (zero or one). The second element
of the array is the number
of
significant units in the DL code of the number.
The other elements constitute the DL field of codes. The size of the
array representing one DL datum А
is
.
