0% found this document useful (0 votes)
22 views

Note DLD

bucacbucac

Uploaded by

Baaru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
22 views

Note DLD

bucacbucac

Uploaded by

Baaru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 31
(a) Convert the binary number 110001 10 to Gray code. () Convert the Gray code 10101111 to binary. Solution (a) Binary to Gray code: 1-+1-+>0-+30-+>0-+1-+>1-+0 t ‘ 4 t 1 J t t 1 0 1 0 0 1 0 1 (b) Gray code to binary: 1 Bo ae a =e a ie oe Li A7d Ad 4 td 4d 44 1 1 0 0 1 0 1 0 Related Problem (a) Convert binary 101101 to Gray code. (b) Convert Gray code 100111 to binary. Gray Binary Binary Gray Code Decimal Binary Gray Code 0000 0000 8 1000 1100 0001 0001 9 1001 101 0010 OO1L 10 1010 wi O11 0010 i 1011 1110 0100 Old 12 1100 1010 O10l oll 13 1101 1011 O10 O10 14 110 1001 OL 0100 15 Hd 1000 Ashe ing BCD mnt 2 101+ 010 oto +10 Setaion ‘The decimal number additions are shown for comparison. art me tigi sana # io iaeeetes 1 a peaincomeinen ib dito sai Ae aes a par Ht tee . t t 3 1 x 4 @ ono ont at am i eames ib aoe Hester er tet heat sang ite per of tees eats 7? aacieaaa ‘Ad he BCD umber: 01001000 + 00110100, Add the following BCD numbers: (a) 0011 + 0100 () 00100011 + 00010101 (© 10000110 + 00010011 (@) 010001010000 + 010000010111 ‘Solution ‘The decimal number additions are shown for comparison. (a) 0011 3 (b) 0010 0011 23 +0100 +4 +0001 0101 +15, O11 7 0011 1000 38 (© 1000 110 86 @ 0100 0101 0000 450 +0001 0011 +13 +0100 0001 O11L = +417 1001 1001 9 1000 0110 0111 867 Note that in each case the sum in any 4-bit column does not exceed 9, and the results are valid BCD numbers. Related Problem Add the BCD numbers: 1001000001000011 + 0000100100100101 Convert each of the following decimal numbers to BCD: (@) 35 (b) 988 @) 170 @) 2469 Solution @ 35 ® 9 ad it oortdi07 TooIT000 © 170 ©2469 ti tid] 00701170000 0016010001101001 Related Problem Convert the decimal number 9673 to BCD. Decimal/BCD conversion. Decimal Digit 0 1 2 3004 5 6 7 8 9 BCD 0000 0001 0010 0011 0100 0101 0110 O11! 1000 1001 Convert each of the following binary numbers to octal: (a) 110101 (b) 101111001 (@)_ 100110011010 @)_ 11010000100 Solution (@) 110101 () 101111001 Vd t 6 5 = 655 5 7 1=57s (© Loo12001 1910 (®) 913919900100 til bid 4 6 3 2 = 4632, 3.2 0 4= 3204, Related Problem Convert the binary number 10101010001 11110010 to octal. Octal/binary conversion. Octal Digit 0 1 2 3 4 5 6 1 Binary 000 = OOl_=ol0t 100 t0 nol Srey Subtract the following hexadecimal numbers: (@) 8416 — 2Aje —(b)_ C316 — OBio Solution (a) 2Ajs = 00101010 2's complement of 2A1g = 11010110 = D6;6 (using Method 1) 8416 +D6j5 Add Y5Ais Drop carry, as in 2’s complement addition The difference is SAy6. (b) 0B js = 00001011 2’s complement of 0Bj = 11110101 = F5;5 (using Method 1) Cis + F516 Add B85 Drop carry The difference is B85. Related Problem Subtract 1736 from BCD. ‘Add the following hexadecimal numbers Die + Wye) SBig+ 22 CO IBye + Bye ODF ye + AC Solution (@) 23,6 sight column: +16\¢ eft column 34 sight column: lef column right column: lef column sight column: 10 + 9 = Zo Tq = Brgwitha I eary Teftcolumn: Dye + Aig + Lig = 1330 + 100 + Lhe = 240 24yy — H6qy = Byo = Bie witha | carry Related Problem Ak 4C and 3A Convert the decimal number 650 to hexadecimal by repeated division by 16. Solution Hexadecimal remainder 50 76 7 0.625 X 16=10= A 0 16 ~ 2B 705 X 16 =8 = 8 2 = 0.125 0.125 x 16 = 2= 16 0.125 0.125 X 16 = 2 2 | Stop when whole number 2 8 A _ Hexadecimal number tient ). quotient is zero. see Sree Convert the following hexadecimal numbers to decimal: (@) E516 (b) B2F8i5 Solution Recall from Table 2-3 that letters A through F represent decimal numbers 10 through 15, respectively (a) E516 = (E X 16) + (SX 1) = (14 X 16) + (5 X 1) = 224 + 5 = 22% 9 (b) B2F8,, = (B X 4096) + (2 X 256) + (F X 16) + (8 X 1) (11 X 4096) + (2 x 256) + (15 X 16) + (8 X 1) = 45,056 + 512 + 240 + 8 = 45,816, Related Problem Convert 60A,¢ to decimal. Convert the following hexadecimal numbers to decimal: (@ 1Ci6 () A85i6 Solution Remember, convert the hexadecimal number to binary first, then to decimal. @ 1c cana 00011100 = 24 + 23 + 227 = 16 +8 +4 = Bio ® A 8 Ss bud 101010000101 = 2!! + 2° + 27 + 2? + 29 = 2048 +512 + 128 +4 + 1 = 2693,9 Related Problem Convert the hexadecimal number 6BD to decimal. Determine the binary numbers for the following hexadecimal numbers: (a) 10A4j5—(b) CF8E\g (©) 97424 Solution (a) 1 Oo A 4 )C F 8 E @o9 7 4 2 ott ttt fii 1000010100100 1100111110001110 1001011101000010 In part (a), the MSB is understood to have three zeros preceding it, thus forming a 4-bit group. Related Problem Convert the hexadecimal number 6BD3 to binary. Convert the following binary numbers to hexadecimal: (a) 1100101001010111 ——(b)_ 111111000101101001 Solution (@) 1100101001010111 () QO111111900101 101001 ne es C A 5 7 =CASI¢ 3 F 1 6 9 =3F169% Two zeros have been added in part (b) to complete a 4-bit group at the left. Related Problem Convert the binary number 1001111011110011100 to hexadecimal. a Decimal Binary Hexadecimal 0 0000 0 1 0001 1 2 0010 2 3 0011 3 4 0100 4 5 0101 5 6 0110 6 7 Olll 7 8 1000 8 9 1001 9 10 1010 A 11 1011 B 12 1100 Cc 13 1101 D 14 1110 E 15 111 F Dutrminete devia values ofthe sna iar nurse expressed in caplet @ 01010110 16101010 Solution (0) The ie a ‘Summing the weights whee there ae I Or lta tz = +86 rood Sommane he weights where thee le ofthe 2 complemen mmr 10011. etre he decimal ale of the ign ia sumer expres in I's complement sotwion (2 Tein pace mh ree MT A sania as weer reas Nescetatthenepus ign ehacs wept 18 ‘Summing the Weights whee tere ae r1toroeo lot seaete aay Suing te woh ner ete aI [Related Problem Ang 0 he re he a dsin keris Datcrnin te dina wal ofthe complement number 110101 gages Determine the decimal value of this signed binary number expressed in sign-magnitude: 10010101. Solution The seven magnitude bits and their powers-of-two weights are as follows: ae Oy 24s te fot ott oo 1 0 1 0 1 ‘Summing the weights where there are 1s, 16+4+1=21 Related Problem Determine the decimal The sign bit is 1; therefore, the decimal number is —21. Express the decimal number ~39 as an 8-bit number in the sign-magnitude, I’s com- plement, and 2°s complement forms. Solution First, write the 8-bit number for +39. 0100111 In the sign-magnitude form, ~39 is produced by changing the sign bit to a 1 and leaving the magnitude bits as they are. The number is 10100111 In the 1’s complement form, ~39 is produced by taking the 1’s complement of +39 coo100111). 11011000 In the 2's complement form, —39 is produced by taking the 2’s complement of +39 (00100111) as follows: 11011000 1's complement + 1 11011001 2's complement Find the 2's complement of 10111000 using the alternative method. ‘Solution 10111000 Binary number T's complements 94001000 2's complement of original bits ———T — t_____These bits stay the same. Related Problem Find the 2's complement of 11000000. Find the 2's complement of 10110010. Solution 10110010 Binary number 01001101 1's complement + 1 Addi 01001110 ——_-2’s complement Related Problem Determine the 2’s complement of 11001011 10110010 Binary number Vddbbdsd 01001101 1’s complement Perform the following binary divisions: Solution @ 10411 110+ 10 ae qos @ U)NO 36 (b) 109110 296 uo 6 0 6 0000 10 0 10 00 Related Problem Divide 1100 by 100. Perform the following binary multiplications: @ uxt @ 101 x 11 Solution (a) I 3 (b) 1 7 x3 x 101 x5 Partial 9 a ml 35 Proded products) 000 +1 100011 Related Problem Multiply 1101 x 1010. 0-0=0 1-1=0 1-0=1 1=1 0 — 1 with a borrow of 1 0+0=0 Sum of 0 witha carry of 0 0+1=01 Sumof 1 withacarry of O 1+0=01 Sumof | witha carry of 0 1+1= 10 Sumof0 withacarry of 1 s—y, 1+0+0=01 Sum of | with a carry of 0 1+1+0=10 Sum of 0 with a carry of 1 1+0+1=10 Sum of 0 with a carry of 1 1+1+1=11 Sum of | with a carry of 1 Convert the following decimal numbers to binary (@) 19) 45 seuton o — Pop op Y= f 5 if | Sead 2 z a ro) Convert decimal number 39 w binary. ¢ oy ao eg 279 8 rortoL Toor sp—t Cusp Convert the following decimal numbers to binary: (@ 12) 25 © 58 (@) 82 Solution @ 12=8+4= 2) + 2——______________» 1100 @) 25 = 16 +8 + 1 = 24 + 25 + 22 ———_—_________» 11001 (© 58= 32+ 16+8+2=25 + 24+ 23 + 2!» _ 111010 @) 82 = 64 + 16 + 2 = 2° + 24 + 2! —___________» 1010010 Related Problem ‘Convert the decimal number 125 to binary. Convert the fractional binary number 0.1011 to decimal. Solution Determine the weight of each bit that is a 1, and then sum the weights to get the decimal fraction. Weight ar" 2 at ar Binary number: 0.1 0 1 1 0.1011 = 214+ 29424 = 0.5 + 0.125 + 0.0625 = 0.6875 Related Problem Convert the binary number 10.111 to decimal. Hf = 770691107 Spat eea eer 4 fh. west by bf ‘are snp, err A) 4194 479.04 Pe Pa gt 2th 4 Pry 4 2227 lo | Pinge ere fe ft8c ale sé tte) +B LAN (p6408) (U2) HB ctw ABC + Rec tAQctne + ABCA BC ABC 4 fer TABCLARC TAG ase | 00 ot| 20 \17 0 | | rt A I co to K48¢ 0+ 8¢ 4 Ac Az WB 4 RBC~RBC L = ARlCHE) & then Yu rhe (cec=7) = Abe AABC + AB CARR = pal + Abl ~ABE a\8C 00] of | 10,77 FE COP ft t ft 4 Rech + Paco 7 ABD 4 fRCO 14p60 ThElp +p Blot Bee + Keb 4A ACD (AB CO Ag ch] 00 et 5 fe AR BC 4A RT ef eefo bale PtH BS ~~ ARC 4 AC + hB ‘Cong EX-NOR (Céng EX-NOR lit két hgp cia céng EX-OR va céng NOT, ding dé thye ign ham EX-NOR, Céng EX-NOR chi o6 2 ngd vio vi 1 ng@ ra Ky higu A Q B Bang trang thai Che ng® vio Ned ra A B Q 0 0 1 0 1 ° 1 0 0 1 1 1 hin xét: 4+ Netra cla cng EX-NOR bing 0 khi 2 ng vio 6 mie logic kde nhau. + Naira cla cng EX-NOR bing 1 khi 2 ngd vio ¢6 me logic bing nhau, iu tite logic Q=AB+AB =A@B Cing EX-OR Céng EX-OR ding dé thyehign him EX-OR. Céng EX-OR chi o6 2 ng6 vio va 1 ng6 ra ID ‘Ce ngo vao Ngo ra mig Bang trang thai A B Q ° ° o ° 1 1 1 ° 1 1 1 0 Nh xée: O khi 2 ng® vio co mite logic bi + Ngd maciia cng EX-OR bi + Ned racita céng EX-OR bing | khi2ng® vio o® mite logic ke nha, Bigu thie logic AB+AB =AQB Q ‘Céng NOR CCéng NOR ta k&t hop cia cdng OR va céug NOT. Ng6 ra cia cng NOR li do vi ng® ra cbng D> ky higu Bang trang thai Ce nga vio Nedra A B @ ° ° 1 ° 1 0 1 ° 0 1 H 0 Nhéin xét: ‘+ Ngo ra céng NOR = I khi tat cd cdc ng6 vao cita né c6 gid tr 0. + Nab racing NOR =0 ki o6 it hit 1 ng® vio cia né o6 gi 1 Bidu thite logic Y=A4B ‘Céng NAND (Céng NAND 1a két hgp cta cng AND va céng NOT. Ng® ra cia cing NAND 1a dio véi ng’ ra cing AND, Ay higu a Bang trang that Cae ngd vao Ngo ra A B Q 0 fo 1 ° 1 1 1 ° 1 1 1 ° hg xe: ‘+ Ng ra cng NAND = I khi cé it mhdt 1 ng6 vao cia no bing 0. +. Ngb ra cing NAND = 0 khi tit ef cfc ngd vio cba né bing 1 Biéu thic logic Y=AB Céng OR, ‘Céng OR ding thye hign ham OR ciia 2 hay nhiéu bién. Cong OR cé s6 ngd vao tuy thuge vo s6 bign va e6 mot ng@ ra. Ng@ ra cing la ham OR cia cée bién ngé vio. ky higu A “Dp? Bang trang thai Céc ngé vio Neg® vio A B Q 0 0 0 0 1 1 1 0 1 1 1 1 Nhiin xét + Ng6 racing OR chi mir thip khi tt cdc ngd vio xudng tp. + Khi co mot ngé vao bing 1, ng6 ra bing 1 bit chip ede ngd vio edn Iai. Bidu thite logic Q=A+B Céng AND Céng AND ding thwe hign him AND cia 2 hay abiéu biéa. Cing AND c6 6 ngd vio tuy thude ‘vao s6 bién va c6 mot ngo ra, Ng@ ra cng la ham AND ciia ede bién ngo vao. ky higu A Q B Bang trang thai Cae ng6 vio Ned ra A B Q 0 0 0 0 1 0 1 o 0 1 1 1 Nin xét: * Ngdracéng AND chi 6 mite cao khi tit ca cde ngd vao Ién cao. _ + Khi cd métngé vio bing 0, ngb ra bing 0 bat chip cae ngo vio cn lai. Biéu thite logic QrAB Céng NOT ‘Céng NOT chi e6 mt ngo vao va mot ngO ra. Cong NOT ding dé thye hign phép NOT hay phép phi dinh trong dai s6 Boole. Céng NOT cén dugc goi la cng DAO (Inverter). ky higu Bang trang thai ‘Ngo vio Ngo ra A Q 0 1 1 0 Nhén xét, Ngd vao va ng@ ra c6 mite logic trai ngwge nhau. Biéu thite logic: Q=A tribut elaw = The distributive law is written for three variables as follow: A(B+C)=AB+AC + This law states that ORing two or more variables and then ANDing the result with a single variable is equivalent to ANDing the single variable with each of the two or more variables, and then ORing the products. = The distributive law also expresses the process of factoring in which the common variable = a8 a nes a— c = x ee ee ee X=AB+O, X=AB+AC JRE 4-7 Application of tribute law. Open file FO4-07 to very Associative laws = The associative law of addition is written as follows for three variables: A+B+O) A A a+0 _ lac arse c i g FIGURE 4-5 Application of associative law of addition. Open fle F04-05 to verily. = The associative law of multiplication is written as follows for three variables: A(BC) = (AB)C ey ye . — we FIGURE 4-6 Application of associative law of multiplication. Open file FO4-06 to verity. o Commutative laws = The commutative law of addition for two variables is written as: A+B=B+A 8 =) Ase Bea 2 A FIGURE 4-3. Application of commutative law of addition. = The commutative law of multiplication for two variables is written as: AB=BA pee ae = eee we pA 2 1 FIGURE 4-4 Applicaton of commutative aw of mutilation. TABLE 4-1 Basic rules of Boolean algebra. 1.A+0=A TAA=A BA+1 8.A-A 3.A-0=0 9 A= 4.A-1=A 10.A + AB=A 5.A+A=A 11.A + AB=A+B 6A+A=1 12. (A + B(A + C)=A+ BC Convert the binary whole number 1101101 to decimal. Solution Determine the weight of each bit that is a 1, and then find the sum of the weights to get the decimal number. Weight: 26252423 2? 2! 2° Binary number: 1101101 1101101 = 2° + 25 + 23 + 2? + 2° =644+324+8+4+1= 109 Related Problem Convert the binary number 10010001 to decimal.

You might also like