Answer:
Do you have any idea how to get the best and most importantly I
Answer:
The program in C++ is as follows:
#include<bits/stdc++.h>
using namespace std;
class Complex {
public:
int rl, im;
Complex(){ }
Complex(int Real, int Imaginary){
rl = Real; im = Imaginary;
}
};
int main(){
int real, imag;
cout<<"Real: "; cin>>real;
cout<<"Imaginary: "; cin>>imag;
Complex ComplexNum(real, imag);
cout<<"Result : "<< ComplexNum.rl<<" + "<<ComplexNum.im<<"i"<<endl;
}
Explanation:
See attachment for explanation
Answer:
First shift - 1101
Second shift - 0110
Third shift - 1011
Fourth shift - 1101
Fifth shift - 0110
Sixth shift - 1011
Explanation:
Each time you shift a register to the right, you do 3 things:
- The rightmost digit drops off
- You move the next three digits over one position to the right
- You fill in the leftmost position with one of the numbers from your serial input.
Contents are initially 1011. The 1 on the right disappears. The leftmost 3 digits (101) end up in the last 3 positions of the register. The first position of the register takes a number from the serial input, which is 1 in this case. So you end up with 1101.
Do this a second time. The rightmost 1 is gone, the 110 end up as the last 3 positions of the register, and you end up with 0 in the leftmost position. This one is 0110.
The remaining 4 follow the same pattern.