Prev Problem
Next Problem

44. Bus Error Checker

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

Using the case operator along with the bitwise XOR, we can determine presence of indefinite characters.

 

 

Code

/*Write your code here*/
module error_checker_xz (
    input [7:0] bus,
    output all_known,
    output has_unknown,
    output [7:0] bus_if_known
);
    assign has_unknown = ^bus === 1'bx;
    assign all_known = ~has_unknown;
    assign bus_if_known = has_unknown? 8'b00: bus;
endmodule

 

Was this helpful?
Upvote
Downvote