📄 chap.2.infocoding.ps
字号:
2 f9 f1859(-)X1 f1912(2.)X2011(Shown)X2304(here)X2497(are)X2642(the)X2787(binary)X3060(2's)X3204(complement)X3708(representations)X576 3435(of)N2 f9 f695(-)X1 f748(3,)X859(and)X1037(1,)X1148(and)X1326(the)X1483(result)X1736(corresponds)X2239(to)X2353(the)X2510(binary)X2794(2's)X2949(complement)X3464(representation)X4048(of)X2 f9 f4166(-)X1 f4219(2.)X576 3547(Referring)N976(to)X1082(Figure)X1364(2.1,)X1539(begin)X1785(at)X2 f9 f1887(-)X1 f1940(3,)X2044(and)X2215(count)X2461(in)X2568(a)X2643(clockwise)X3060(direction)X3435(1)X3515(position)X3857(to)X3964(arrive)X4221(at)X2 f9 f576 3659(-)N1 f629(2.)X758(Here)X978(again,)X1244(the)X1395(binary)X1674(values)X1953(are)X2104(added)X2367(just)X2538(as)X2650(if)X2741(they)X2939(were)X3158(unsigned)X3537(binary)X3815(values.)X4141(The)X576 3771(fact)N753(that)X930(one)X1101(addend)X1412(of)X1525(this)X1697(sum)X1890(is)X1987(negative)X2347(does)X2556(not)X2712(affect)X2965(the)X3116(way)X3309(the)X3460(2)X3541(binary)X3820(values)X4099(1101)X576 3883(and)N739(0001)X955(are)X1097(added.)X776 4023(The)N952(above)X1208(examples)X1598(should)X1880(have)X2089(convinced)X2512(you)X2683(that)X2855(radix)X3080(complement)X3584(is)X3675(a)X3745(simple)X4029(way)X4216(to)X576 4135(perform)N943(arithmetic.)X1416(As)X1579(long)X1807(as)X1944(the)X2119(operands)X2523(are)X2698(represented)X3198(as)X3334(signed)X3641(2's)X3814(complement)X576 4247(operands,)N973(addition)X1315(is)X1405(all)X1528(done)X1741(in)X1842(one)X2007(simple)X2290(way.)X2500(If)X2590(the)X2735(desired)X3040(operation)X3431(is)X3522(subtraction,)X4001(then)X4194(all)X576 4359(that)N747(is)X837(needed)X1136(is)X1226(to)X1327(take)X1514(the)X1658(2's)X1800(complement)X2302(of)X2407(the)X2550(subtrahend)X2997(\(i.e.,)X3196(the)X3339(bottom)X3637(number\))X3988(and)X4152(add)X576 4471(the)N718(same)X940(way)X1124(you)X1292(would)X1556(if)X1639(the)X1781(operation)X2169(was)X2342(addition.)X3 f576 4695(2.2.2.5.)N912(Diminished)X1405(Radix-Complement)X2234(Representations)X1 f776 4835(As)N908(the)X1052(name)X1287(applies,)X1610(this)X1775(method)X2090(is)X2180(related)X2469(to)X2570(the)X2714(radix)X2938(or)X3044(base)X3241(of)X3347(the)X3492(numbers)X3850(being)X4091(used.)X576 4947(However,)N981(we)X1122(compute)X1483(the)X1630(diminished-radix)X2317(complement)X2823(of)X2932(a)X3004(number)X3327(by)X3452(using)X3689(the)X3835(radix)X4061(raised)X576 5059(to)N688(the)X843(power)X2 f1120(n)X1 f(,)S1229(but)X1389(diminished)X1854(by)X1987(one.)X2211(Equation)X2596(\(12\))X2793(formally)X3162(de\256nes)X3471(the)X3627(diminished)X4093(radix)X576 5171(complement)N1077(operation)X1465(for)X1601(an)X2 f1716(n)X1 f(-digit,)S2021(base)X2 f2216(b)X1 f2288(number)X2 f2606(A)X1 f2689(as:)X2 f9 f1056 5331(-)N2 f1109(A)X9 f1200(=)X1 f1277(\()X2 f1309(b)X9 s1369 5293(n)N12 s9 f1437 5331(-)N1 f1514(1\))X2 f9 f1618(-)X2 f1695(A.)X1 f4131(\(12\))X576 5519(Don't)N824(forget)X1078(this)X1241(de\256nition)X1634(either!)X776 5659(First,)N1022(note)X1234(that)X1425(now)X1636(the)X1800(negating)X2178(operation,)X2612(for)X2770(base)X2987(2,)X3105(is)X3215(found)X3486(by)X3629(subtracting)X4104(from)X576 5771(111...1,)N913(or)X1042(simply)X1352(by)X1496(taking)X1785(the)X1951(bit-by-bit)X2363(complement)X2888(of)X3016(the)X3182(number)X3524(to)X3647(be)X3786(negated.)X4158(For)X13 p%%Page: 13 1012 s 0 xH 0 xS 1 f3 f576 400(57:017)N872(CIE)X1 f2329(-)X2385(13)X2505(-)X3 f3717(Lecture)X4062(Notes)X1 f576 803(example,)N951(the)X1093(1's)X1234(complement)X1735(representation)X2305(of)X2 f9 f2409(-)X1 f2462(45)X2582(is)X2670(formed)X2972(as)X3076(follows)X7 f1098 963(11111111)N1040 1075 0.4219(-00101101)AN1040 1115 0.4219(_________)AN1098 1227(11010010)N1736(<-)X1910(1`s)X2142(comp.)X2490(repr.)X2838(of)X3012(-45)X1 f576 1415(We)N738(now)X931(discuss)X1236(the)X1382(issues)X1639(of)X1747(range)X1990(and)X2158(arithmetic.)X2627(Again,)X2915(to)X3019(illustrate,)X3410(we)X3551(look)X3751(at)X3850(the)X3997(modulo)X576 1527(arithmetic)N994(``clock'',)X1381(but)X1529(it)X1608(is)X1697(slightly)X2011(different)X2368(than)X2559(for)X2696(radix)X2919(\(2's\))X3125(complement.)X3675(For)X3833(1's)X3975(comple-)X576 1639(ment,)N828(this)X1002(is)X1101(shown)X1386(in)X1496(Figure)X1782(2.2.)X1985(On)X2137(the)X2290(inside)X2555(of)X2670(the)X2823(clock)X3067(are)X3221(shown)X3507(the)X3661(1's)X3814(complement)X576 1751(interpretations)N1163(of)X1273(the)X1421(binary)X1697(values)X1973(0000)X9 f2195 MX(->)174 987 oc1 f2320(1111.)X2590(Note)X2807(that)X2982(the)X3130(leftmost)X3476(bit)X3608(position)X3948(indicates)X576 1863(the)N725(sign,)X940(that)X1116(the)X1265(largest)X1553(value)X1794(represented)X2270(is)X2366(7,)X2470(and)X2641(the)X2791(smallest)X3139(is)X2 f9 f3235(-)X1 f3288(7.)X3392(Make)X3643(special)X3943(notice)X4211(of)X576 1975(the)N723(fact)X897(that)X1071(we)X1212(now)X1406(have)X1616(two)X1788(different)X2148(zeroes;)X2 f9 f2449(+)X1 f2502(0)X2 f9 f2574(=)X1 f2651(0000)X2871(and)X2 f9 f3038(-)X1 f3091(0)X2 f9 f3163(=)X1 f3240(1111.)X3508(In)X3616(general,)X3952(for)X4092(an)X2 f4211(n)X1 f(-)S576 2087(digit,)N810(base)X2 f1015(b)X1 f1097(diminished)X1559 0.2125(radix-complement)AX2300(system,)X2625(the)X2777(range)X3025(of)X3139(numbers)X3504(is)X3602(from)X3823(the)X3975(smallest)X576 2199(value)N809(of)X2 f9 f913(-)X1 f966(\()X2 f998(b)X9 s1058 2161(n)N9 f1106(-)X1 f1146(1)X12 s2 f9 f1214 2199(-)N1 f1291(1\))X1395(to)X1494(the)X1636(largest)X1917(value)X2150(of)X2254(\()X2 f2286(b)X9 s2346 2161(n)N9 f2394(-)X1 f2434(1)X12 s2 f9 f2502 2199(-)N1 f2579(1\).)X776 2339(We)N941(now)X1137(examine)X1495(the)X1644(issue)X1867(of)X1978(arithmetic)X2401(in)X2507(a)X2581(diminished)X3040(radix)X3269(complement)X3777(system.)X4099(Con-)X576 2451(sider)N787(the)X929(following)X1327(example:)X7 f1098 2611(0100)N1504(\(4\))X2258(0100)X2664(\(4\))X1040 2723(-0111)N1504(\(7\))X1852(<=>)X2200(+1000)X2664(\(-7\))X1040 2763 0.4219(_________)AN2200(________)X1098 2875(1101)N1504(\(-2\))X2258(1100)X2664(\(-3\))X1156 2987 0.4219(INCORRECT)AN2374(CORRECT)X1 f576 3175(In)N682(this)X847(example,)X1225(we)X1364(subtract)X1696(7)X1771(from)X1985(4)X2060(which)X2322(should)X2605(produce)X2 f9 f2942(-)X1 f2995(3.)X3118(Shown)X3411(here)X3604(on)X3727(the)X3872(left)X4028(are)X4173(the)X576 3287(binary)N853(1's)X1001(complement)X1509(representations)X2123(of)X2234(4)X2313(and)X2483(7,)X2586(and)X2756(the)X2905(result)X3150(corresponds)X3644(to)X3749(the)X3897(the)X4045(binary)X576 3399(1's)N734(complement)X1252(representation)X1839(of)X2 f9 f1960(-)X1 f2013(2.)X2151(\(Note)X2412(this)X2593(is)X2699(incorrect!\))X3172(Referring)X3583(to)X3700(Figure)X3993(2.2,)X4179(we)X576 3511(begin)N816(at)X912(4,)X1010(and)X1175(count)X1415(in)X1516(a)X1585(counter-clockwise)X2317(direction)X2686(7)X2760(positions)X3133(to)X3234(arrive)X3485(at)X2 f9 f3580(-)X1 f3633(2.)X3754(Now)X3965(consider)X576 3623(the)N720(rewritten)X1094(version)X1403(of)X1509(this)X1674(example)X2027(on)X2149(the)X2293(right.)X2550(This)X2748(is)X2839(the)X2984(operation)X3375(of)X3482(the)X3627(addition)X3970(of)X4077(4)X4152(and)X2 f9 f576 3735(-)N1 f629(7)X707(to)X811(produce)X2 f9 f1150(-)X1 f1203(3,)X1304(which)X2 f1568(is)X1 f1661(correct.)X2006(Shown)X2301(are)X2448(the)X2595(binary)X2870(1's)X3016(complement)X3522(representations)X4134(of)X4243(4)X576 3847(and)N2 f9 f741(-)X1 f794(7,)X892(and)X1058(the)X1203(result)X1444(corresponds)X1935(to)X2037(the)X2182(the)X2327(binary)X2600(1's)X2744(complement)X3248(representation)X3821(of)X2 f9 f3928(-)X1 f3981(3.)X4104(Note)X576 3959(that,)N778(now)X976(the)X1127(binary)X1406(values)X1685(are)X1836(added)X2099(just)X2271(as)X2384(if)X2476(they)X2675(were)X2895(unsigned)X3275(binary)X3553(numbers.)X3964(The)X4146(fact)X576 4071(that)N749(one)X916(addend)X1222(of)X1330(this)X1497(sum)X1685(is)X1777(negative,)X2156(or)X2264(that)X2437(the)X2583(original)X2911(operation)X3304(was)X3482(subtraction,)X3963(does)X4168(not)X576 4183(affect)N830(the)X982(way)X1176(the)X1328(2)X1410(binary)X1690(values)X1970(0100)X2196(and)X2368(1000)X2593(are)X2744(added.)X3055(Finally,)X3385(referring)X3755(to)X3863(Figure)X4147(2.2,)X576 4295(begin)N827(at)X934(4,)X1043(and)X1219(count)X1470(in)X1582(a)X1662(clockwise)X2084(direction)X2464(8)X2549(positions)X2933(to)X3045(arrive)X3307(at)X2 f9 f3414(-)X1 f3467(3.)X3600(8)X3686(is)X3788(the)X3944(unsigned)X576 4407(binary)N846(interpretation)X1390(of)X1494(1000.)X1758(Again,)X2041(we)X2177(get)X2319(the)X2461(correct)X2753(answer.)X776 4547(Before)N1084(we)X1242(attempt)X1578(to)X1699(explain)X2029(why)X2240(one)X2425(version)X2754(of)X2880(the)X3044(preceding)X3470(example)X3843(produced)X4248(a)X576 4659(correct)N868(answer,)X1188(while)X1426(the)X1568(other)X1790(did)X1937(not,)X2108(let's)X2298(consider)X2648(a)X2715(second)X3006(example.)X7 f1098 4819(0111)N1504(\(7\))X2258(0111)X2664(\(7\))X1040 4931(-0011)N1504(\(3\))X1852(<=>)X2200(+1100)X2664(\(-3\))X1040 4971 0.4219(_________)AN2200(________)X1098 5083(0100)N1504(\(4\))X2258(0011)X2664(\(3\))X1156 5195(CORRECT)N2258 0.4219(INCORRECT)AX1 f576 5383(In)N683(contrast)X1015(to)X1117(the)X1262(previous)X1620(example,)X1998(now)X2190(the)X2335(version)X2645(on)X2768(the)X2913(left)X3069(produces)X3444(a)X3515(correct)X3811(result,)X4077(while)X576 5495(the)N721(right)X930(side)X1112(does)X1315(not!)X1521(Here,)X1759(we)X1898(subtract)X2230(3)X2305(from)X2519(7)X2594(to)X2696(produce)X3032(4.)X3130(Shown)X3422(here)X3614(are)X3758(the)X3902(binary)X4174(2's)X576 5607(complement)N1079(representations)X1688(of)X1794(7)X1868(and)X2033(3,)X2131(and)X2296(the)X2440(result)X2680(corresponds)X3170(to)X3271(the)X3415(the)X3559(binary)X3831(2's)X3975(comple-)X576 5719(ment)N813(representation)X1403(of)X1527(4.)X1667(Referring)X2080(to)X2199(Figure)X2494(2.2,)X2682(we)X2838(begin)X3096(at)X3210(7,)X3326(and)X3509(count)X3766(in)X3884(a)X3970(counter-)X576 5831(clockwise)N996(direction)X1374(3)X1457(positions)X1839(to)X1950(arrive)X2211(at)X2317(4.)X2449(A)X2554(second)X2857(view)X3080(of)X3196(the)X3350(same)X3584(operation)X3984(is)X4084(as)X4200(an)X14 p%%Page: 14 1112 s 0 xH 0 xS 1 f3 f576 400(57:017)N872(CIE)X1 f2329(-)X2385(14)X2505(-)X3 f3717(Lecture)X4062(Notes)X1 f576 803(addition)N924(of)X1036(7)X1116(and)X2 f9 f1287(-)X1 f1340(3)X1420(to)X1527(produce)X1869(3.)X1973(\(Note)X2224(this)X2395(is)X2491(incorrect!\))X2954(Shown)X3252(are)X3401(the)X3550(binary)X3827(2's)X3975(comple-)X576 915(ment)N801(representations)X1416(of)X1528(7)X1608(and)X1779(-3,)X1915(and)X2086(the)X2236(result)X2482(corresponds)X2978(to)X3085(the)X3235(the)X3385(binary)X3664(2's)X3814(complement)X576 1027(representation)N1162(of)X1282(3.)X1418(Here,)X1669(the)X1827(binary)X2113(values)X2399(are)X2557(added)X2827(just)X3006(as)X3126(if)X3225(they)X3431(were)X3658(unsigned)X4045(binary)X576 1139(numbers,)N959(and)X1126(the)X1272(carry)X1498(of)X1606(a)X1677(1)X1753(out)X1904(of)X2012(the)X2158(high)X2357(order)X2588(bit)X2718(of)X2826(the)X2972(sum)X3161(is)X3254(simply)X
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -