Question: 1* Now back to Table. Write a simple code that will perform the dot product of the two vectors s(n) and w(n) , and will

1* Now back to Table. Write a simple code that will perform the dot product of the two vectors s(n) and w(n) , and will store the result in vector p(n) . Remember all bits in a column are multiplied together.
2*n this step, rather than store the values of p(n) , let us modify Code 2 such that we have a counter C0 that will count the number of times the bit product of an element in s(n) and w(n) is 1. In this case-control or condition statement such as an IF statement, must be included in your code
3*after the loop in Code 2, the value of counter C0 should be equal to the value you found for v(0) 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: C0_Binary, of type int and size 4 int C0_Binary[4]. Make sure to assign a binary value to all elements in vector C0_Binary.
I want it now, please!
they give us those examples:
Code 1.
For (int B = 0; B
{ cout
Code 2. int B = 0;
for (int n=0; n
{ cout
B++; }
Code 3. int B[11]; B[0] = 0;
for (int n=0; n
{ cout
B[n+1] = B[n] + 1;
}
s(n) 0 0 1 1 0 1 0 0 wan) 1 1 1 0 0 0 0 0 0 pin) 0 0 0 0 0 0 0 0 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
