Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use array c++ Coding 3. After the loop in Code 4, the value of counter CO should be the equal to the value you found
use array c++
Coding 3. After the loop in Code 4, the value of counter CO should be the equal to the value you found for (o) in decimal. Next convert this number into a binary number. (You could do this explicitly by specifying the values, or you could find a code to perform the conversion process). Store the value in an array that you will call: CO_Binary, of type int and size 4 - int CO_Binary[4] . Make sure to assign a binary value to all elements in vector Co_Binary. Write your code in the space provided for Code 5. Code 5. Coding 4. In this step a new counter, C1, and its binary equivalent, int Ci_Binary[4), will be added at the beginning of the Code 5 after the lines int CO and int CO_Binary[4). Add variable C1 and initialize it in the same way that CO has been added. Write your modified code in the space provided for Code 6. Code 6. Coding 5. Before beginning with the new loop to compute the dot product of table 47, it is important to modify the value of CI with the respect to the value derived from second element of vector CO_Binary, i.e. CO_Binary[1]. Again knowing that binary values can be either 0 or 1, then it is easy to not increment or increment C1 by one respectively. Modify Code 6 to either increment or not the value of C1 with respect to the value of CO_Binary found at the end of code 6. Make sure to use a conditional IF statement. Write your code in the space provided for Code 7. Code 7 Coding 6. It is now time to repeat steps coding 1-3, for Cl and for Cl_Binary. The added code must be written below Code 7. Write your modified code in the space provided for Code 8. Again ensure that C1_Binary contains the value 0 or 1 only. Code 8. Shift 2. Now it is time to shift the values of w(n) , in table 47, to the right by one place. Notice that you must fill the leftmost, or first value of w(n) appropriately. Complete table 48. Table 48. T = 2 w(n) Coding 7. Add two new integer counters C2 and C2_Binary[4] under int C1 and int C1_Binary[4] lines found in Code 8. Again initialize C2 with zero before the first loop. Write this modification in the space assigned for Code 9. Code 9. Coding 8. Now it is time to modify C2 with the values derived from all previous binary counters. First modify with respect to the third element of vector CO_Binary, i.e. Co_Binary[2], in the same way that I had been modified by CO_Binary[1]. Place this modification after the modification of Ci, between both loops. Second modify C2 with respect to the second element of vector Ci_Binary, i.e. Ci_Binary[1]. Place this code modification after the assigning C1_Binary with the binary value of C1. Use the IF statement only to modify C2. Repeat Coding step 6, for C2 and C2_Binary. Write the modified code in the space provided for Code 10. Code 10. Coding 9. Complete Table 49 for the shifted values of w(n) in table 48. Table 49. T = 3 s(n) Add two new integer counters, C3 and C3_Binary[4) under C2 and C2_Binary[4) and initialize as in step Coding 7. Subsequently modify C3 with respect to CO Binary[3], the fourth and last element of CO Binary, after the modification of C2 by CO_Binary[2]. Modify C3 with respect to Ci_Binary[2] below the modification of C2 by Ci_Binary[1]. Modify C3 with respect to C2_Binary[1] after obtaining the binary representation of C2. Repeat step Coding 6, for c3 and C3_Binary. Write the modification of Code 10 in the space assigned for Code 11. Code 11 Coding 3. After the loop in Code 4, the value of counter CO should be the equal to the value you found for (o) in decimal. Next convert this number into a binary number. (You could do this explicitly by specifying the values, or you could find a code to perform the conversion process). Store the value in an array that you will call: CO_Binary, of type int and size 4 - int CO_Binary[4] . Make sure to assign a binary value to all elements in vector Co_Binary. Write your code in the space provided for Code 5. Code 5. Coding 4. In this step a new counter, C1, and its binary equivalent, int Ci_Binary[4), will be added at the beginning of the Code 5 after the lines int CO and int CO_Binary[4). Add variable C1 and initialize it in the same way that CO has been added. Write your modified code in the space provided for Code 6. Code 6. Coding 5. Before beginning with the new loop to compute the dot product of table 47, it is important to modify the value of CI with the respect to the value derived from second element of vector CO_Binary, i.e. CO_Binary[1]. Again knowing that binary values can be either 0 or 1, then it is easy to not increment or increment C1 by one respectively. Modify Code 6 to either increment or not the value of C1 with respect to the value of CO_Binary found at the end of code 6. Make sure to use a conditional IF statement. Write your code in the space provided for Code 7. Code 7 Coding 6. It is now time to repeat steps coding 1-3, for Cl and for Cl_Binary. The added code must be written below Code 7. Write your modified code in the space provided for Code 8. Again ensure that C1_Binary contains the value 0 or 1 only. Code 8. Shift 2. Now it is time to shift the values of w(n) , in table 47, to the right by one place. Notice that you must fill the leftmost, or first value of w(n) appropriately. Complete table 48. Table 48. T = 2 w(n) Coding 7. Add two new integer counters C2 and C2_Binary[4] under int C1 and int C1_Binary[4] lines found in Code 8. Again initialize C2 with zero before the first loop. Write this modification in the space assigned for Code 9. Code 9. Coding 8. Now it is time to modify C2 with the values derived from all previous binary counters. First modify with respect to the third element of vector CO_Binary, i.e. Co_Binary[2], in the same way that I had been modified by CO_Binary[1]. Place this modification after the modification of Ci, between both loops. Second modify C2 with respect to the second element of vector Ci_Binary, i.e. Ci_Binary[1]. Place this code modification after the assigning C1_Binary with the binary value of C1. Use the IF statement only to modify C2. Repeat Coding step 6, for C2 and C2_Binary. Write the modified code in the space provided for Code 10. Code 10. Coding 9. Complete Table 49 for the shifted values of w(n) in table 48. Table 49. T = 3 s(n) Add two new integer counters, C3 and C3_Binary[4) under C2 and C2_Binary[4) and initialize as in step Coding 7. Subsequently modify C3 with respect to CO Binary[3], the fourth and last element of CO Binary, after the modification of C2 by CO_Binary[2]. Modify C3 with respect to Ci_Binary[2] below the modification of C2 by Ci_Binary[1]. Modify C3 with respect to C2_Binary[1] after obtaining the binary representation of C2. Repeat step Coding 6, for c3 and C3_Binary. Write the modification of Code 10 in the space assigned for Code 11. Code 11 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started