Question: Question 1 Practice exercises do not score in the final grade. Therefore, you can freely discuss them in the Forum without worrying about whether you

Question 1
Practice exercises do not score in the final grade. Therefore, you can freely discuss them in the Forum without worrying about whether you are transgressing the Honor Code.
The pseudocode shown in figure 1 functionally describes the chronometer introduced in lesson 1.1.The update procedure updates the values of h, m, s and t whenever a clock pulse arrives (ref_positive_edge signal).
Does the pseudocode shown in figure 2 correctly implement the update procedure?
Figure1 loop
if reset=ON then h <=0; m <=0; s <=0; t <=0;
else if start=ON then
while stop=OFF loop
if ref_positive_edge=TRUE then update(h,m,s,t);
end if;
end loop;
end if;
end loop; Figure 2: update procedure if t =9 then t <=0; add_one_second <=1;
else t <= t+1; add_one_second <=0;
end if;
s <= s + add_one_second;
if s =60 then s <=0; add_one_minute <=1;
else add_one_minute <=0;
end if;
m <= m + add_one_minute;
if m =60 then m <=0; add_one_hour <=1;
else add_one_hour <=0;
end if;
h <= h + add_one_hour;
if h =24 then h <=0;
end if; yES
NO; the condition in line 1 should be t=10 instead of t=9.
NO; the condition in line 5 should be s=59 instead of s=60.
NO, there are other failures different of the two previous ones

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 Databases Questions!