例:试用四位二进制加法器74283构成可控的加法、减法器(允许附加少量门)。A-B=A+(-B)(A+(-B)补=A补+ (-B )补=A补+ (-B )反+1按位取反各位不变分析:和S 借位C 为进位取反习 题 课C S0S1S2S3A0A1A2A31进位03COCIB03A031B2B0B1B3111分析:1. A-B0 时A 与B 相减的结果 与采用补码相加的比较A=0101 B=0001求A-B 补码相加A补0101(-B)补1111+0100 1直接相减A0101B 0001-010000100借位 (进位反相)1. A-B0时 B =0101A =0001 补码相加A补0001(-B)补1011+11100借位1100 0直接相减A0001B 0101-1100-当C =1 ,有借位A-B 0=(A+(-B)补 )补= (S)反+1=S补码再求补得原码A 1=A加异或门求反和SC =1,实现加1当C=0 ,无借位C =0,不实现加1S =(A+(-B)补=(A+(-B)原=A-BS =(A+(-B)补 (A+(-B)原S0S1S2S3进位03COCIA03B03加异或门求反