习题解答1-4章《数字逻辑基础与Verilog硬件描述语言》——贾熹滨等清华大学出版社2012.08.第1章数制和码制1.1写出下列各数的按权展开式(1024.5)10=1×103+0×102+2×101+4×100+5×10-1(10110)2=1×24+0×23+1×22+1×21+0×20(237)8=2×82+3×81+7×80(A01D)16=A×163+0×162+1×161+D×160=(10×163+0×162+1×161+13×160)101.2完成下列数制转换(255)10=(11111111)2=(377)8=(FF)16(52.125)10=(110100.001)2=(64.1)8=(34.2)16(110011)2=(51)10=(63)8=(33)16(400)8=(100000000)2=(256)10=(100)16(3FF)16=(1023)10=(1111111111)2=(1777)8(1A.5)H=(11010.0101)B=(26.3125)D=(32.24)O(376)8=(11111110)2=(FE)16(44.375)10=(101100.011)2=(54.3)8借助二进制1.4完成下列运算(110101)2+(101001)2=(1011110)2(1001101)2–(110011)2=(11010)2(A378)16+(4631)16=(E9A9)16(1B34)16–(CA5)16=(E8F)161.5写出下列真值所对应的一字节长(1位符号,7位数值)的原码、反码和补码。题7位真值原码反码补码+0.00101+0.00101000.00101000.00101000.0010100–0.1101–0.11010001.11010001.00101111.0011000–0.1–0.10000001.10000001.01111111.1000000+11001+0011001000110010001100100011001–1000–0001000100010001111011111111000–10000000–10000000无无10000000–11111–0011111100111111110000011100001+11111+00111110001111100011111000111111.6先写出下列十进制数x的真值,再写出所对应的一字节长(1位符号,7位数值)的原码、反码和补码。十进制x7位真值原码反码补码0+0000000000000000000000000000000–0–0000000100000001111111100000000126+1111110011111100111111001111110–126–1111110111111101000000110000010127+1111111011111110111111101111111–127–1111111111111111000000010000001128+10000000无无无–128–10000000无无100000001.7已知[x]补,求[x]原、[x]反及真值x已知[x]补[x]原[x]反真值x101110101100011010111001–10001101.11111111.00000011.1111110–0.00000010.01010100.01010100.0101010+0.010101010000000无无–100000001.8已知[x]反,求[x]补及真值x已知[x]反[x]补真值x1011010110110110–10010101.01100101.0110011–0.10011011.9已知[x]原,求[x]补已知[x]原[x]补1.00110101.110011010111101110000110.00110000.00110001.10先写出下列十进制数x的真值,再写出所对应的一字节长(1位符号,7位数值)的补码。十进制数x7位真值[x]补13/640.00110100.0011010–13/128–0.00011011.111001115/320.01111000.0111100–11/64–0.00101101.11010101.11已知(178)10,如何用8421码、余3码、2421码和格雷BCD码表示?(178)10(000101111000)8421(010010101011)余3码(000111011110)2421(000101001100)格雷BCD1.12完成下列转换(001101001000)8421→(011001111011)余3码→(348)10(100100100101)8421→(111100101011)2421→(925)10(469)10→(010001101001)8421→(011110011100)余3码→(011001011000)格雷BCD(001111001110)2421→(011010011011)余3码→(001101101000)84211.13求(010010010110)8421关于(1000)10的补数的8421码表示。(010010010110)8421→(496)10(1000)10–(496)10=(504)10→(010100000100)84211.14求(010000111100)余3码关于(1000)10的补数的余3码表示。(010000111100)余3码→(109)10(1000)10–(109)10=(891)10→(101111000100)余3码1.15写出关于8421码、余3码、2421码的6个伪码。8421码的伪码:1010~1111余3码的伪码:0000~0010和1101~11112421码的伪码:0101~10101.16写出与4位自然二进制码对应的4位格雷码4位自然二进制码制码4位格雷码000000000001000100100011001100100100011001010111011001010111010010001100100111011010111110111110110010101101101111101001111110001.17分别确定下列二进制信息码的奇校验位和偶校验位的值。信息码奇校验位偶校验位101001110110011101001110110111110001第2章逻辑代数基础2.3写出逻辑命题的真值表(2)设有A、B、C三个输入信号,当三个信号相同或其中任意两个信号为0时,输出为1,否则输出为0。ABCF00010011010101101001101011001111ABCF00000011010101101001101011001111(1)设有A、B、C三个输入信号,当其中有奇数个信号为1时,输出为1,否则输出为0。(3)结论同(1),但变量为1表示开关动作。2.4写出下面逻辑表达式的真值表:CBAC)B,F(A,(1)ABCF00010010010101101001101111011110(2)ACDDDBAD)C,B,F(A,CABCDF000010001000100001100100101010011000111010001100111010010111110011101011100111112.5写出下列表达式的对偶式)DA)](ED(CCAAB['FAD)DEC)(CA)(BA(F)1(CA)CB(ACBA'FCA)CBA(ABCF)2()CAB)(BAB('F)CA(BBABF)3(⊙⊙2.6运用反演规则,写出下列表达式的反演式。)DBE)DC((BAF]BD)EDC(B[AF)1()DAC)(CB)(BA(F)DA(CCBBAF)2()CB)(CACABA(FBCAC)CA)(BA(F)3()E)DB()CA)((DBA(FE)BDAC(DBAF)4(⊙⊙2.7用逻辑代数的公理、定理及规则,证明下列等式。右式左式CABCABABC)BA(ABCBCAAB)1(右式左式DB)A1(D)1C(BBADDBC)BAD(BCDBC)BAD)(CB(DBC)BAD)(CB(DDBC)2(右式左式CBAC)BA(CBACBAC)BA(CBA)3(⊙⊙⊙⊙右式(左式)ZY(X)ZY(X)ZY(X)ZYZY(X)YZZY(XXYZZYXZYXZYXZ)XYYX(Z)YXYX(Z)YX(Z)YX(Z)Y)4(X左式右式ACBCAB)CB)(BCA()CB)(BCACABA()CB)(CA)(BA()5(左式右式CBAABC)CA)(BCCABA()CA)(CB)(BA()6(CACBBA2.8试写出的或与式、与非式、或非式及与或非式。ABBAFBABA)BA()BA()BA)(BA()BA)(BA()BBA)(ABA(ABBAF或与式ABBAABBAABBAF与非式或非式与或非式2.9下列函数中,哪些变量取值使F=1?)2,1,0(M)CBA)(CBA)(CBA()C,B,A(F)1(根据最大项表达式显性给出使F=0的组合,有变量ABC取值011、100、101、110和111,使F=1。)15,14,12,7,6,4,3,1(m)W,Z,Y,X(F)2(根据最小项表达式显性给出使F=1的组合,有变量XYZW取值0001、0011、0100、0110、0111、1100、1110和1111,使F=1。)7,6,5,4,3,2,1,0(M)S,S,S(F)3(012由该函数最大项表达式可见,所有变量组合均使F=0,所以,没有变量组合使F=1。)7,6,4(mABCCBACAB)CC(AB)BB(CAABCA)C,B,A(F)4(当ABC取值100、110和111,使F=1。2.10下列函数中,哪些变量取值使F=0?)7,4,2,1(m)X,X,X(F)1(123根据最小项表达式显性给出使F=1的组合,有变量X3X2X1取值000、011、101和110,使F=0。)3,2,0(M)CBA)(CBA)(CBA)(CBA()BBCA)(CCBA()CA)(BA()C,B,A(F)2(根据最大项表达式显性给出使F=0的组合,有变量ABC取值000、010和011,使F=0。)3,2,1,0(mABBABABA)B,A(F)3(由该函数最小项表达式可见,所有变量组合均使F=1,所以,没有变量组合使F=0。)7,6,5,3(M)X,X,X(F)4(123根据最大项表达式显性给出使F=0的组合,有变量X3X2X1取值011、101、110和111,使F=0。2.11根据真值表,写出题2.3中最小项表达式及最大项表达式。)6,5,3,0(M)7,4,2,1(mF331)6,5,3(M)7,4,2,1,0(mF33213FF2.12将下列逻辑表达式转换为最小项之和的形式。)7,5,3,1(mCBACBACBAABCBCA)AA(CB)BB(ACBCACBACBCAF)1(3)5,3,1,0(m)7,6,4,2(M)Z,Y,X(F)2()15,14,13,12,11,7,6,3(mCDBABCDACDBAABCDDBCABCDADABCABCDDCABDCABDABCABCD)BB)(CDAACD()DD)(BCAABC()DD)(CABABC()BB)(AA(CD)DD)(AA