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

Phương Quyên

New member
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
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.
 

Tìm kiếm

Back
Top