Q.

Which of the following line is correct for detecting positive edge of a clock?

A. if (clk’event and clk = ‘0’)
B. if (clk’event and clk = ‘1’)
C. if (clk’event or clk = ‘0’)
D. if (clk’event or clk = ‘1’)
Answer» B. if (clk’event and clk = ‘1’)
Explanation: the correct way to identify the positive edge of the clock signal is shown in option b. the ‘event attribute will detect the event and clk = ‘1’ will check whether its high on clock or not. in this way the positive edge is monitored. we need to use and operator because both of the conditions should be true.
2k
0
Do you find this helpful?
13

Discussion

No comments yet