Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions