Phase Difference Measurement
Time-of-flight applications like ultrasonic range finding and radar rely on precise measurement of the delay between a transmitted pulse and its received echo. A phase difference measurement unit captures this interval by timing the gap between two distinct asynchronous events.
The circuit must measure the number of clock cycles between the rising edge of sig_a and the rising edge of sig_b. An 8-bit output count increments by 1 each clock cycle while the measurement is active. The measurement begins on the clock cycle immediately following the rising edge of sig_a. The measurement ends on the clock cycle immediately following the rising edge of sig_b, holding the final count value. A 1-bit output active must remain high during the cycles where the measurement is in progress. If sig_b arrives before sig_a or at the exact same time, the event is ignored and the count remains 0. A 1-bit input rst clears the counter and resets the system to an idle state.
Constraints
- Use an 8-bit unsigned integer format for the output
count. - Do not increment the counter if
sig_btransitions high before or simultaneously withsig_a. - Hold the final
countvalue steady aftersig_barrives until arstoccurs. - Trigger all sequential logic on the rising edge of the clock.
Topics
Solve this problem
Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.
This problem is part of Codiode Pro. The statement above is free to read.
The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.