Created
May 13, 2025 06:52
-
-
Save GaryLee/51cb2026bbb6d1cd4cd41f6039e53f83 to your computer and use it in GitHub Desktop.
The answer of HDLBits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module top_module ( | |
input [7:0] a, | |
input [7:0] b, | |
output [7:0] s, | |
output overflow | |
); | |
logic c; | |
assign {c, s} = a + b; | |
assign overflow = ~(a[7] ^ b[7]) & (c ^ s[7]); | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment