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?

 

 

Code

// Module: open_source_line
// Function: Models an open-source line (defaults LOW when undriven) using tri0
// When drive_high = 1 → actively drive line HIGH
// When drive_high = 0 → release (defaults to LOW via tri0)

module open_source_line (
    input  drive_high,  // 1 = drive high, 0 = release
    output tri0 line    // tri0 means line is LOW when undriven
);

    assign line = (drive_high) ? 1'b1 : 1'bz;  // Drive high or float

endmodule

 

Was this helpful?
Upvote
Downvote