HDLBits刷题第四天

HDLBits刷题第四天 70 Exams/ece241 2014 q1cmodule top_module ( input [7:0] a, input [7:0] b, output [7:0] s, output overflow ); // assign s a b; assign overflow ( ~a[7] ~b[7] s[7]) | ( a[7] b[7] ~s[7]); endmodule正数符号位为0溢出发生的唯一情况两个同号数相加结果符号相反。因为正正 正如果结果变负说明超出127发生上溢负负 负如果结果变正说明超出-128发生下溢正负或负正结果范围永远在-128~127之间不可能溢出76 这个卡诺图有点神奇module top_module( input a, input b, input c, input d, output out ); assign out a ^ b ^ c^ d; endmodule还有一百来题