加算法, 为什么用了算数库了以后 写s<=a+b 比用下面与或门的描述编译下来占用的资源少??? bb(0)<=b(0) xor d(0); bb(1)<=b(1) xor d(0); bb(2)<=b(2) xor d(0); bb(3)<=b(3) xor d(0); s(0)<=a(0) xor bb(0) xor d(0); s(1)<=a(1) xor bb(1) xor c(0); s(2)<=a(2) xor bb(2) xor c(1); s(3)<=a(3) xor bb(3) xor c(2); c(0)<=(a(0) and bb(0)) or (a(0) and d(0)) or (bb(0) and d(0)); c(1)<=(a(1) and bb(1)) or (a(1) and c(0)) or (bb(1) and c(0)); c(2)<=(a(2) and bb(2)) or (a(2) and c(1)) or (bb(2) and c(1)); c(3)<=(a(3) and bb(3)) or (a(3) and c(2)) or (bb(3) and c(2)); |