on-internet
← Community

How can I check if my 4-bit adder/sub is working properly

Stack Overflow ·

How can I check if my 4-bit adder is working properly? If it is, then it should display "OK", or if it's not then "NOT". I wrote the code and the testbench which will calculate all possible 4-bit combinations, but I don't know whether the output values are correct, and I want to check it. My testbench is already displaying overflow. Here is my code: module ripple_carry_adder_subtractor (S, C, V, A, B, Op); output [3:0] S; // The 4-bit sum/difference. output C; // The 1-bit carry/borrow status. output V; // The 1-bit overflow status. input [3:0] A; // The 4-bit augend/minuend. input [3:0] B; //

Comments

Sign in or sign up to comment and upvote.

No comments yet.