![]() CATEGORIES: BiologyChemistryConstructionCultureEcologyEconomyElectronicsFinanceGeographyHistoryInformaticsLawMathematicsMechanicsMedicineOtherPedagogyPhilosophyPhysicsPolicyPsychologySociologySportTourism |
Execution of the laboratory work1. Study the rules of DL addition and subtraction. 2. Create subroutines of modulus calculation, addition, subtraction, and a generalized subroutine. 3. Input the subroutines into your computer. 4. Get results based on numerical data. 5. Compile your experimentation paper. Contents of the Experimentation Paper 1. Principles of performing operations of addition and subtraction in the binary system and DL representation. 2. Algorithms of modulus calculation, addition, and subtraction. 3. Examples of calculations using a generalized program. Questions for the Self-Testing 1. What are the basic differences between the addition algorithm in DL coding and that in the binary systems? 2. What are the causes of the subtraction error? 3. Compare the subtraction algorithm in complement code to the subtraction algorithm that uses borrowings. MODULE 4 Laboratory work 4.1 REALIZATION OF DL MULTIPLICATION OPERATIONS Aim of the work: The aim of the work is to study DL multiplication operations. Basic Principles The operation of multiplication is performed according to the bit-by-bit multiplication rule: Ni * Nk = Ni + Nk, where Ni and Nk are non-zero digits of the operands. When two numbers A and B are being multiplied: • each element of the number A is added to all elements of the number B; • collecting terms is performed on a set of the obtained numbers of non-zero digits of the product; • the product elements are sorted. Example. Given: A→{0,2,2.1} and B→{0,2,3.1}. Their product is to be found. The partial sums are: {3.2} and {5.4}, i.e., {0,4,5.4.3.2}.
The flowchart of the MultDL subroutine for DL multiplication is depicted in Fig. 4.1. Here we use the following variables: a is an array of integers representing a DL multiplicand; b is an array of integers representing a DL multiplier; c is an array of integers representing a DL product; i, j, and l are cycles indices. At first, the sign of the product is determined: c[0] = a[0] Date: 2016-03-03; view: 505
|