Question: Generate the pattern 0 1 on B 7 while A 1 is 1 . B 7 should be 0 otherwise.Assume A 1 will stay 1

Generate the pattern 01 on B7 while A1 is 1. B7 should be 0 otherwise.Assume A1 will stay 1 for at least 2 cycles.
}
else if (A1 && !A7){
SM2_STATE = SM2_s1;
}
else {
SM2_STATE = SM2_s1;
}
break;
case SM2_s2:
if (!(!A1 && A7)){
SM2_STATE = SM2_s0;
}
else if (!A1 && A7){
SM2_STATE = SM2_s2;
}
else {
SM2_STATE = SM2_s2;
}
break;
default:
SM2_STATE = SM2_s0;
break;
}
switch(SM2_STATE){
case SM2_SMStart:
break;
case SM2_s0:
B =0;
break;
case SM2_s1:
B1=1;
break;
case SM2_s2:
B5=1;
break;
}
}
int main(){
int HiLo2ElapsedTime =500;
int periodGCD =500;
TimerSet(periodGCD);
TimerOn();
while(1){
if (HiLo2ElapsedTime >=500){
Tick_HiLo2();
HiLo2ElapsedTime =0;
}
HiLo2ElapsedTime +=500;
while(!TimerFlag);
TimerFlag=0;
}
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!