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?
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,,t);
end if;
end loop;
end if;
end loop;
if t = 9 then t <= 0; add_one_second <= 1;
else t <= t+1; add_one_second <= 0;
end if;
S <= 5 + add_one_second;
if s = 60 then s <=Ie; 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;
Answers
Answered by
0
Answer:
yes it's correct
Explanation:
Similar questions