Prev Problem
Next Problem

24. Open-Source Line using tri0

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

Implement the line so it only drives a HIGH level when enabled and remains disconnected otherwise. Use a tri0 net to ensure the signal naturally settles to LOW when no device is driving it, accurately reflecting open-source behaviour.

 

Code

module open_source_line (
    input  drive_high,   // 1 = actively drive high, 0 = release
    output tri0 line      // tri0 gives default pull-down to 0
);

assign line = (drive_high) ? 1'b1 : 1'bz;

endmodule

 

Was this helpful?
Upvote
Downvote