《微机原理与接口技术(92页).doc》由会员分享,可在线阅读,更多相关《微机原理与接口技术(92页).doc(91页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、-习题解第1章1.1 写出下列十进制数的8位二进制补码表示 解: (1) 54 = 00110110B (2) 37 = 00100101B (3) 111 = 01101111B (4) 253 超过8位补码范围(5) 0.1 = 0.0001101 (6) 0.63 = 0.1010001B (7) 0.34 = 0.0101100 (8) 0.21 = 0.0011011 1.2 转换下列二进制数为十进制数 解:(1) 10111101 = 189 (2) 10001001 = 137 (3) 0.1011111 = 95 / 128 = 0.7421875 (4) 0.0011010
2、= 13 / 64 = 0.203125 (5) 10011001 .110011 = 153 +51/64 =153.796873 (6) 111000111 = 455 1.3 写出下列带符号数的原码、反码、补码和移码表示(用8位二进制代码表示) 解:(1) +112 = 12715 +112 原 = 01110000B +112 反 = 01110000B +112 补 = 01110000B +112 移 = 11110000B(2) 0.625 = 0.1010000B 0.625 原 = 0.625 反= 0.625 补 =0.1010000B 小数无移码(3) 124 =1273
3、 =01111100B124 原 = 11111100B124 反 = 10000011B124 补 = 10000100B124 移= 00000100B(4) 0.375 =48/128 =0.0110000B0.375 原=1.0110000B0.375 反=1.1001111B0.375 补=1.1010000B小数无移码(5) 117= 12710 =1110101117原=11110101B117反=10001010B117补=10001011B117移=00001011B(6) +0.8125 =104/128 =0.1101000B+0.8125原=+0.8125反=+0.81
4、25补= 0.1101000B小数无移码1.4 给出以下机器数,求其真值(用二进制和十进制数)表示 解:(1) X=+(32+7) =+39 =+0100111B(2) x补=10101101B x原=11010011BX=1010011B =( 64+16+3)=-83(3) X = +1000110B =+70(4) X原=10101101BX= 0101101B =(32+13) =451.5 已知x补和y补的值,用补码加减法计算x+y补和xy补,指出结果是否溢出 (1) x补=0.11011 , y补=0.00011 (2) x补=0.10111 y补=1.00101 (3) x补=1
5、.01010 y补=1.10001 (4) x补=1.10011 y补=0.11001 解: (1) x补=0.11011 , y补=0.00011X+Y补=x补+y补=0.11110X+Y= +15/16 =+0.1111B XY补=x补+y补= 0.11000XY= +12/16 =+0.1111B(2) x补=0.10111 , y补=1.00101 X+Y补=x补+y补= 1.11100X+Y= -0.001B=1/8 XY补=x补+y补= 1.10010 (上溢)(3) x补=1.01010 , y补=1.10001 X+Y补= 10.11011 XY补=x补+y补= 11.1100
6、1X+Y=0.11011B下溢XY=0.00111B=7/32 (4) x补=1.10011 , y补=0.11001X+Y补= 00.01100XY补=x补+y补= 10.11010X+Y = (13+25)/32 =12/32=3/8XY下溢1.6 给出x和y的二进制值,用补码加减法计算x+y补和xy补,并指出结果是否溢出解:(1) X=0.10111 Y=0.11011 X+Y补= 01.10010 XY补=x补+y补= 11.11100 X+Y 正溢 XY=1/8(2) X=0.11101 Y=0.10011 X+Y补= 01.10000 XY补=x补+y补= 00.01010 X+Y
7、 正溢 XY=10/32(3) X=0.11011 Y=0.1010X+Y补=00.00111XY补=x补+y补= 01.01111 X+Y =7/32XY (上溢)(4) X=0.11111 Y=0.11011 X+Y补= 11.11100 XY补=x补+y补= 10.00110 X+Y =0.00100=1/8XY (下溢)(5) X=0.11011 Y=0.10100 X+Y补=11.11011 XY补=x补+y补= 10.10001 X+Y =0.00111=7/32XY (下溢)(6) X=0.11010 Y=0.11001 X+Y补= 10.01101 XY补=x补+y补= 11.
8、11111X+Y (下溢) XY=0.00001= 1/32 (7) X=1011101 Y=+1101101X+Y补= 000010000XY补=x补+y补= 100110110 X+Y =00010000=16XY=54 (下溢) (8) X=+1110110 Y=1001101X+Y补= 000101001XY补=x补+y补= 011000011 X+Y =41XY=61 (上溢) (9) X=+1101110 Y=+1010101X+Y补= 011000011XY补=x补+y补= 000011001 X+Y (上溢)XY=25 (10) X=1111111 Y=1101101 X+Y补
9、= 100010100 XY补=x补+y补= 111101110 X+Y (下溢)XY=0010010=181.7 写出下列数据的浮点数表示,基数为2,设阶码为5位(含1位阶符),尾数为11位(含1位尾符),要求尾数用补码,阶码用移码。(1) 12510 (2) 101012(3) 0.0013810 (4) 23710(5) 1101012 (6) 10111112解(1) 12510=011111012=0.111110127表示为00111,1111101000(2) 101012=0.1010125表示为00101,1010100000(3) 0.0013810=1447.03488
10、/ 220=1447 / 220=0.00000,00001,01101,00111B (1024+256+128+32+7=1447)=0.1011010011129=1,10111.01001011001 ( 9原=11001)=1,10111.01001011001(4) 23710= 111011012=0.1110110128=0,01000.1110110111(5) 1101012=0.11010128=1,00110.0010110000(6) 10111112=0.101111127=0,00111,10111111.8 用32位二进制浮点数表示,阶码9位(其中1位为阶符),
11、尾数23位(其中1位为尾符),要求阶码为移码表示,尾数为补码表示。请问:(1) 最大正数是多少?(2) 最小正数是多少?(3) 绝对值最大的负数是多少?解:(1) 最大正数X ,XXXXXXXXX . XXXXXXXXXXXXXXXXXXXXXX9位 22位 + 2255 0 .111111111111111111111122位 =+ 2255 (2221) /222=2233(2221)(2) 最小正数+2256 0.0000000000000000000001= 2256 1/222= 2278(3) 绝对值最大的负数 (最小数)1 , 011111111 . 00000000000000
12、00000000= 2255第2章2.1 用真值表验证下列公式:(1) A + BC =(A+B) 解: A B C A+BC(A+B)(A+C) 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 1 1 1 0 01 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1(2) A += A + B解: A BA + A + B 0 0 0 0 0 1 1 1 1 0 1 1 1 1 1 1(3) 解: A B 0 0 0 0 0 1 1 1 1 0 1 1 1 1 0 0(4) 解: A B 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 1(
13、5) ABC解: A BCABC 0 0 0 00 0 0 1 11 0 1 0 11 0 1 1 00 1 0 0 11 1 0 1 00 1 1 0 00 1 1 1 11(6) 解: A B C 0 0 01 1 0 0 10 0 0 1 01 1 0 1 10 0 1 0 00 0 1 0 10 0 1 1 00 0 1 1 10 02.2写出下列表达式的对偶式:(1) F =(A + B)(C + DE)+ G解:F=(AB)(C(DE)G(2) F = 解:F= (3) F = 解:F = (AC)F= (4) F = 解:F =(AB)(CD)+(AB)(CD) =(AB)(CD
14、) =(AB)(CD)=(AB)(CD) =(AB)(CD)2.3写出下列函数的“反”函数:(1)F = AB + 解:(2)F =解:(3)F = 解:(4)F = 解:F = = X = = XY = = 2.4应用公式化简法化简下列各函数式:(1)F = 解:F = = = = = (2)F =(A + B)C +解:F = AC + BC + = = C + C + AB = AB + C(3)F = 解:F = = = = = (4)F = AB + ABD +BCD解:F = AB + ABD +BCD= AB + +BCD= AB + 2.5利用卡诺图,化简下列逻辑函数:(1)F
15、 = (2)F = (3)F = (4)F =(A + B + C + D)(A + B + D)(A + C + D)(A + D)(+)(5)f(A,B,C)=m(0,2,4,6) (6)f(A,B,C,D)=m(0,1,2,3,4,6,8,9,10,11,12,14)(7)f(A,B,C,D)=m(2,3,6,7,8,10,12,14)(8)f(A,B,C,D)=m(0,1,4,5,12,13) AB C 00011110 011 111(9)f(A,B,C,D)=m(0,1,2,3,4,6,8,10,12,13,14)(10)f(A,B,C,D)=m(1,4,9,13)+d(5,6,7
16、,10)(1)F = 解:F = AB C 00011110 01011 11110(2)F = 解:= = = AB CD 00011110 0011 011111111011(3) F=解:F = (4)F =(A + B + C + D)(A + B + D)(A + C + D)(A + D)(+) AB CD 00011110 000011 011100111100100011解= = = AB C 00011110 01111 1(5)f(A,B,C)=m(0,2,4,6) 解:f(A,B,C)= (6)f(A,B,C,D)=m(0,1,2,3,4,6,8,9,10,11,12,1
17、4)解:f(A,B,C,D)= AB CD 00011110 001111 01111111101111(7)f(A,B,C,D)=m(2,3,6,7,8,10,12,14) AB CD 00011110 0011 011111101111解:f = (8)f(A,B,C,D)=m(0,1,4,5,12,13) AB CD 00011110 00111 011111110解:f = (9)f(A,B,C,D)=m(0,1,2,3,4,6,8,10,12,13,14) AB CD 00011110 000000 0101d1110111100000解:f = 或 = (10)f(A,B,C,D)
18、=m(1,4,9,13)+d(5,6,7,10) AB CD 00011110 001 011d1111d10dd解:f = 解:f = 2.6化简逻辑函数F =,并用与非门实现之。解:画出卡诺图得 F = AC + AB + BC = = AB C 00011110 01 11112.7已知逻辑电路如图习2-1所示,试分析其逻辑功能。 解:F = Z1 = Z2 = Z3 = AB C 00011110 01111 1111 Y = = = = = = = 图习2-1 习题2.7图2.8用或非门设计一个组合电路,其输入为8421 BCD码,输出L当输入数能使4整除时为1,其它情况下为0(0可
19、被任何数整除)。要求有设计过程,最后给出电路图。解:(1)真值表DCBAL000010001000100001100100101010011000111010001100101010d1011d1100d1101d1110d1111d(2)逻辑函数式L = 无关项为DCBA即 AB CD 00011110 0011d1 01d11dd10dd(3)卡诺图L = = = L = 即(B + A = 0)(4)若不考虑无关项L = = = 考虑无关项L = = = = 2.9图习2-2所示为一多功能函数发生器,其中C2、C1、C0为三个控制信号,X、Y为数据输入,试列表说明当C2、C1、C0为不同
20、取值组合时,输出端F的逻辑功能(F = f(X,Y)的表达式)。图习2-2 习题2.9图解:与非门注上编号A、B、D、E图习2-2 习题2.9图(1) 当C2、C1、C0 = 000时,A = 1,B = 1,D = 1,E = XF = = = X(2) 当C2、C1、C0 = 001时,A = 1,B = 1,D = ,E = G = = F = = =X+Y(3) 当C2、C1、C0 = 010时,A = 1,B = Y,D =1,E = = G = = F = = =X +(4) 当C2、C1、C0 = 011时,A = 1,B = Y,D =,E = = 1G = = 0F = =
21、1(5) 当C2、C1、C0 = 100时,A = ,B = 1,D =1,E = = XG = = = = = (6) 当C2、C1、C0 = 101时,A = ,B = 1,D =,E = = G = = = = F = = Y(7) 当C2、C1、C0 = 110时,A = ,B =Y,D =1,E = = = G = = = = F = = (8) 当C2、C1、C0 = 111时,A = ,B =Y,D =,E = 1G = =F = = =2.10写出图习2-3所示电路的状态方程。图习2-3 习题2.10图解:(a)Qn+1 =Jn + Qn J = K = 1 Qn+1 =n(b
22、)Qn+1 =Jn + Qn = n n + n Qn = n (c)Qn+1 =Jn + Qn K =Q J=1 Qn+1 =n + nQn = n(d)Qn+1 =Jn + Qn K =1 J= Qn+1 =nn + 0= n2.11设计一个同步两位减法计数器,当输入X = 0时,计数器的状态不变;当X = 1时,状态依次为11,10,01,00, 11。解:(1)根据题意,画出这个减法计数器的状态转换器,如图(a)所示。(2)由图(a)列出状态转换真值表,如图(b)所示。(3)由图(b)画出卡诺图,如图(c)所示,由此简化得控制输入逻辑方程:W1n = J1n = Xn2nW2n =J2
23、n = XnK1n = Xn2n K2n = Xn(4)由此画出同步两位减法计数器逻辑图,如图(d)所示。(建议试用D触发器设计该电路)即刻输入原状态新状态即刻控制输入XnQ1nQ2nQ1n+1Q2n+1W1nW2n01111ss11110sR01010sr11001RS00101rs10100rR00000rr10011SS 图(b) Q1n C Q2n 00011110 0rrss 1SrsR Q1n C Q2n 00011110 0rssr 1SRRS W1n 图(c) W2n2.12分析图习2-4的时序网络,最后画出其状态转换图。图习2-4 习题2.11图解:(1)图习2-4中组合电路
24、是一个异或门,存贮器是两个J-K触发器。(2)由图习2-4得即刻控制信号及即刻输出信号的逻辑方程式为: 图习2-4 习题2.12图J1n = K1n = 1,Zn = Q1n,J2n = K2n = (3)图J-K触发器的特征方程式为:Qn+1 = 将上述逻辑方程代入特征方程得新状态的逻辑方程为:Q1n+1 = ,Q2n+1 = (4)Xn,Q1n和Q2n有8种组合,根据以上逻辑方程,列出状态转换真值表(a)。(a)状态转换真值表即刻输入原状态即刻控制输入新状态即刻输出XnQ1n Q2nJ1nK1nJ2nK2nQ1n+1Q2n+1Zn000110010000111001110101111010
25、01111110011001111110101111110111011000001111100011(5)由表(a)得状态转换表(b)。状态转换表(b)Q1n+1 Q2n+1 / Zn Q1n Q2n Xn010010 / 011 / 00111 / 110 / 11001 / 000 / 01100 / 100 / 1(6)由(b)得状态转换图(c)。10Xn/Zn 0/00/00001 1/0 1/1 1/0 1/111 0/1 0/1第3章3.1 采用半加器构成一个具有加1功能的运算电路解:设为4位加1器 加1功能即将操作数加1。如图3-1所示 图中,A3,A2,A1,A0为待加1的操作
26、数, S3,S2,S1,S0为结果操作数, 加1操作由HA0的Y端输入1而实现的。图3-13.2 用4个全加器设计一个具有4位减1功能的运算电路解: 1. 先把4个FA加上异或门及控制端M后变为4个ASU, 图3-2 2.然后按图3-所示,接成4位减1电路,操作数为A3,A2,A1,A0,减1操作由M=1,B3,B2,B1,B0为0001实现。 3.3 画出一个8位移位电路的完整电路,该电路具有右移一位、左移一位和直通的功能,用控制信号S1和S0进行选择。解:电路如图3-3所示。 图中:1) S1S0 01 时,为直通,b7b6b5b4b3b2b1b0 0 a7a6a5a4a3a2a1, a0
27、移出到C 2) S1S0 =10 时,为右移1位,b7b6b5b4b3b2b1b0 a7a6a5a4a3a2a1a0 3) S1S0 00 时,为左移1位,b7b6b5b4b3b2b1b0 a6a5a4a3a2a1a0 0, a7移出到C图3-33.4 用浮点数运算步骤对下列数据进行二进制运算,浮点数格式为:5位阶码(含1位阶符),11位尾数(含1位尾符)1) 56+552) 5655解:1) 56+55 设阶码为5位,尾数为11位(其中1位为尾符) 56 1110002 (1)0 260.111000 56 浮 0,00110 . 1110000000 551101112 (1)0 260.
28、110111 55 浮 0,00110 . 1110000000 * 对阶 因阶码一样,不用对阶 * 尾数相加00. 1110000000 00.1101110000 01.1011110000* 规格化上溢,右规得 00110,01 .1011110000 00111, 0.1101111000 * 舍入 不用 * 查溢 无溢出 56 + 55 浮 0,00111. 1101111000 55+56 270.1101111 11011112 =1112) 5655 56 浮 0,00110 . 1110000000 55 浮 0,00110 . 1110000000阶码相加得 00110+0
29、011001100尾数相乘得0. 11110000000 0.1101110000 0.1100000010 5655浮 0, 01100 . 11000000105655 2120.1100000010 1100000010002 30803.5 用浮点数加法流程对数据0.5和-0.4375进行二进制加法操作,假定可存储4位尾数。解:(1)用原码表示0.5 1/20.100020 0.4375 7/16 0.0111 0.111021对阶 0.4375 0.1110*210.911120尾数相加 0.1000(0.0111)0.0001规格化 0.0001200.100023舍入与查溢 无须
30、0.5(0.4375) 0.1000230.0001=1/16(2) 用补码表示(阶码4位,尾数5位,各含1位符号位)0.5浮=0,0000.10000.4375 716 0.0111 0.111021补码表示为 1.00102-10.4375补1,1111.0010对阶0.4375补1,0000.1001尾数相加00. 1000+11.100100.0001规格化00. 000120=00.100023舍入与查溢 无须0.5(0.4375) = 0.1000230.0001=1/163.6 用浮点数乘法流程对数据0.5和0.4375进行二进制乘法操作,假定可存储4位尾数。解:0.5 = 1/
31、2=0.1000*20 0.4375 7/16 0.0111 0.1110*21 阶码相加 0(1)=1 尾数相乘 0.10000.1110=0.0111000021 规格化 0.111022 无须舍入,无溢出 0.5(0.4375)0.111020.0011107/320.218753.7 用一个算术运算部件、一个逻辑运算部件和一个4选1的选择电路设计一个具有算术运算、逻辑运算和移位运算功能的ALU部件。解:电路见图3-4 图中,4个选择信号S3S2S1S0的作用 S1S0用于选择电路 S1S0 F 功能 0 0 I0 左移 0 1 I1 右移 1 0 I2 逻辑运算 1 1 I3 算术运算
32、 S3S2于算术运算电路和逻辑运算电路 S3 S2 算术运算 逻辑运算 0 0 与 0 1 或 1 0 非 1 1 异或图3-4第4章4.1解:(1) CL=09226H=F6H(2) BPDI=1E4F6H=CX=5678H(3) BX=0056H; AX=09228H=1E40H(4) SI=09226=00F6H; SI=1E4F6H=BX=0024H(5) AX=5678H; BX+20HSI=1234H4.2 解:(1) AX=1352H(2) AX=26FFH(3) 11350H=33H; 11351H=3CH(4) AX=5188H(5) AX=5188H ; SP=1352H(6) 11354H=ECH; 11355H=1AH; SF=ZF=PF=OF=0; CF=1(7) BH=75H; SF=ZF=PF=OF=0; CF=1(8) 11352H=00H; 11353H=26H; CF不变(9) 11352H=00H; 11353H=27H; CF不变(10) 11350H=D2H; CF=1; OF=0