Document Details

UpscalePerception

Uploaded by UpscalePerception

SSIPMT, Raipur

Tags

number systems digital circuits binary computer science

Summary

This document provides an introduction to number systems used in digital circuits, including decimal, binary, octal, and hexadecimal. It explains the basic concepts and provides examples for conversion between the different systems.

Full Transcript

Chapter 1 Number Systems LEARNING OBJECTIVES  Digital circuits  Numeric codes  Number system with different base  Weighted and non-weighted codes  Conversion of number...

Chapter 1 Number Systems LEARNING OBJECTIVES  Digital circuits  Numeric codes  Number system with different base  Weighted and non-weighted codes  Conversion of number systems  Error detection and correction code  Complements  Sequential, reflective and cyclic codes  Subtraction with complement  Self complementing code DiGital CirCuits Example 5: (658)8 = 6 × 82 + 5 × 81 + 8 × 80 Computers work with binary numbers, which use only the digits = 384 + 40 + 8 = (432)10 ‘0’ and ‘1’. Since all the digital components are based on binary operations, it is convenient to use binary numbers when analyzing Hexadecimal number system or designing digital circuits. In hexadecimal number system, there are 16 numbers 0 to 9, and digits from 10 to 15 are represented by A to F, respectively. The Number Systems with Different Base base of hexadecimal number system is 16. Decimal number system Example 6: (1A5C)16 = 1 × 163 + A × 162 + 5 × 161 + C × 160 Decimal numbers are usual numbers which we use in our day-to- = 1 × 4096 + 10 × 256 + 5 × 16 + 12 × 1 day life. The base of the decimal number system is 10. There are = 4096 + 2560 + 80 + 12 = (6748)10. ten numbers 0 to 9. Table 1 Different number systems The value of the nth digit of the number from the right side Decimal Binary Octal Hexadecimal = nth digit × (base)n–1 0 000 0 0 Example 1: (99)10 → 9 × 101 + 9 × 100 1 001 1 1 = 90 + 9 = 99 2 010 2 2 Example 2: (332)10 → 3 × 102 + 3 × 101 + 2 × 100 3 011 3 3 = 300 + 30 + 2 4 100 4 4 Example 3: (1024)10 → 1 × 103 + 0 × 102 + 2 × 101 + × 100 5 101 5 5 = 1000 + 0 + 20 + 4 = 1024 6 110 6 6 7 111 7 7 Binary number system 8 1000 10 8 In binary number system, there are only two digits ‘0’ and ‘1’. 9 1001 11 9 Since there are only two numbers, its base is 2. 10 1010 12 A Example 4: (1101)2 = 1 × 23 + 1 × 22 + 0 × 21 + 1 × 20 11 1011 13 B = 8 + 4 + 1 = (13)10 12 1100 14 C 13 1101 15 D Octal number system 14 1110 16 E Octal number system has eight numbers 0 to 7. The base of the 15 1111 17 F number system is 8. The number (8)10 is represented by (10)8. (Continued ) 1.4 | Unit 1 Digital Logic Table 1 (Continued ) Example 9: (105.75)10 Decimal Binary Octal Hexadecimal 2 105 16 10000 20 10 17 10001 21 11 2 52 1 18 10010 22 12 2 26 0 19 10011 23 13 2 13 0 20 10100 24 14 6 2 1 1. For a number system with base n, the number of different 2 3 0 symbols in the number system will be n. Example: octal 1 1 number system will have total of 8 numbers from 0 to 7. 2. The number ‘n’ in the number system with base ‘n’ is (105)10 = (1101001)2 represented as (10)n. (0.75)10 3. The equivalent of number (a3a2a1a0 · a–1a–2)n in decimal Multiply 0.75 by 2 = 1.50 is a3 × n3 + a2 × n2 + a1 × n1 + a0 × n0 + a–1 × n–1 + a–2 Multiply 0.50 by 2 = 1.00 × n–2. Reading integers from top to bottom 0.75 = (0.11)2 \ (105.75)10 = (1101001.11)2 Conversion of Number Systems The conversion of decimal to any other number system Binary to decimal conversion involves successive division by the radix until the dividend Example 10: (10100011)2 reaches 0. At each division, the remainder gives a digit of converted number; and the last one is most significant digit, = 1 × 27 + 0 × 26 + 1 × 25 + 0 × 24 + 0 × 23 + 0 × 22 + 1 the remainder of the first division is least significant digit. × 21 + 1 × 20 The conversion of other number system to decimal involves = 128 + 0 + 32 + 0 + 0 + 0 + 2 +1 multiplying each digit of number system with the weight of = (163)10 the position (in the power of radix) and sum the products cal- Example 11: (11010011.101)2 culated, the total is the equivalent value in decimal. = 1 × 27 + 1 × 26 + 0 × 25 + 1 × 24 + 0 × 23 + 0 × 22 + 1 Decimal to binary conversion × 21 + 1 × 20 + (1 × 2–1) + (0 × 2–2) + (1 × 2–3) Example 7: (66)10 = 128 + 64 + 0 + 16 + 0 + 0 + 2 + 1 + 0.5 + 0 + 0.125 = (211.625)10 2 66 2 33 0 Decimal to octal conversion 2 16 1 Reading remainders Example 12: (16)10 2 8 0 from bottom to top 8 16 2 4 0 0 2 2 0 Remainder from bottom to top = (20)8 1 0 Example 13: (347.93)10 = (1000010)2 (.93)10 Example 8: (928)10 0.93 × 8 = 7.44 2 928 0.44 × 8 = 3.52 0.52 × 8 = 4.16 2 464 0 0.16 × 8 = 1.28 2 232 0 …….. 2 116 0 Read the integers of octal point from top to bottom. 2 58 0 \ (0.93)10 = (0.7341)8 (347)10 2 29 0 14 8 347 3 2 1 7 8 43 3 2 0 2 3 1 5 1 1 \ (347)10= (533)8 Ans: (533.7341)8    = (1110100000)2 Chapter 1 Number Systems | 1.5 Octal to decimal conversion 0.675 × 16 10.8 Example 14: (33)8 0.800 × 16 12.8 3 × 81 + 3 × 80 = 24 + 3 0.800 × 16 12.8 (27)10 0.800 × 16 12.8 Example 15: (1023.06)8 Decimal Hexa 10 A 1 × 83 + 0 × 82 + 2 × 81 + 3 × 80+ 0 × 8–1 + 6 × 8–2 12 C = 512 + 0 + 16 + 3 + 0 + 0.0937 = (2095.0937)10 12 C Octal to binary conversion 12 C = (0.ACCC)16 To convert octal to binary, replace each octal digit with their \ Hexadecimal equivalent is equivalent 3-bit binary representation. = (12.AC CC)16 Example 16: (7777)8 Convert each octal digit to binary Hexadecimal to decimal conversion 7 7 7 7 Example 22: (A3F)16 = 111 111 111 111 Decimal Hexa = (111 111 111 111)2   A  –  10 Example 17: (567.62)8   3   –  3 5 6 7. 6 2   F   –  15 101 110 111. 110 010 → 10 × 162 + 3 × 161 + 15 × 160 = (101110111.110010)2 → 2560 + 48 + 15 → (2623)10 Example 23: (1F63.0EB)16 Binary to octal conversion 1 1 To convert a binary number to an octal number, starting F 15 from the binary point, make groups of 3-bits each on either 6 6 side of the binary point, and replace each 3-bit binary group 3 3 by the equivalent octal digit. 0 0 Example 18: (010011101)2 E 14 010 011 101 B 11 = (235)8 2 3 5 → 1 × 16 + 15 × 162 + 6 × 161 + 3 × 160 × (0 × 16–1) 3 Example 19: (10010111011.1011)2 + (14 × 16–2) + (11 × 16–3) 010 010 111 011 101 100 → 4096 + 3840 + 96 + 3 + 0 + 0.0546 + 0.0026 ⋅ = (2273.54)8 → (8035.0572)10 2 2 7 3 5 4 Hexadecimal to binary number system Decimal to hexadecimal conversion To represent hexadecimal in binary, represent each HEX Example 20: (527)10 number with its 4-bit binary equivalent. 16 527 Example 24: (34F)16 16 32 15 Hexa  Decimal  Binary 2 0 3     3    0011 Decimal  Hexa 4     4    0100 2  →  2 F    15     1111 0  →  0 = (001101001111)2 15  →  F = (20F)16 Example 25: (AFBC. BED) 16 Hexa  Decimal  Binary Example 21: (18.675)10 A    10    1010   (18)10 F      15    1111 16 18 B      11    1011 1 2 C      12    1100 Decimal  Hexa B      11    1011 1  –  1 E      14    1110 2  –  2  (18)10= (12)16 D      13    1101 (0.675)10 = (1010111110111100.101111101101)2 1.6 | Unit 1 Digital Logic Binary to hexadecimal number system Example 32: 10’s complement of (2657)10 is (10)4 – 2657 To convert binary number to a hexadecimal number, start- 10000 ing from the binary point, make groups of 4-bits each on 2657 either side of the binary point and replace each 4-bit group 7343 by the equivalent hexadecimal digit. Example 33: 9’s complement of (2657)10 is (104 -1) - 2657 Example 26: (11001001)2 10000 1100 1001 – 1 → 9999 12 9 2657 → (C9)16 7342 Example 27: (1011011011.01111)2 r’s complement can be obtained by adding 1 to (r – 1)’s 0010 1101 1011 0111 1000 complement. ⋅ = (2 DB.78)16 2 D B 7 8 r m – N = {(r m - 1) – N} + 1 Example 34: 2’s complement of (101101)2 is Hexadecimal to octal number system = (2)6 – 101101 The simplest way to convert hexadecimal to octal is, first (26)10 = (100000)2 convert the given hexadecimal number to binary and the 2’s complement is 100000 Binary number to Octal.   –101101 Example 28: (C3AF)16   010011 → 001100001110101111 Example 35: 1’s complement of (101101)2 is → (141657)8 26 – 1 = 1000000 Example 29: (C6.AE)16 –   1 → 0011000110.10101110 111111 → (306.534)8 101101 1’s complement –010010 Octal to hexadecimal number system The one’s complement of a binary number is formed by The simplest way to convert octal to hexadecimal is first changing 1’s to 0’s and 0’s to 1’s, The 2’s complement can convert the given octal number to binary and then the binary be formed by leaving all least significant 0’s and the first 1 number to hexadecimal. unchanged, and replacing 1’s with zeros and zeros with 1’s in all other bits. Example 30: (775)8 If the number M contains radix point, the point should be → (000111111101)2 removed temporarily in order to form r’s/ (r - 1)’s complement. → (1FD)16 The radix point is then restored to the complemented Example 31: (34.7)8 number in the same relative position. → (00011100.1110)2 Example 36: What is 1’s complement of (1001.011)2? → (1C.E)16 → Consider without radix point 1001011 Take 1’s complement 0110100 Complements Place radix point again (0110.100)2 Complements are used in digital computers to simplify the Example 37: What is 2’s complement of (1001.011)2? subtraction operation and for logical manipulation. Consider without radix point 1001011 There are two types of complements for each base - Take 2’s complement 0110101 r-system. Place radix point again (0110.101)2 1. Radix complement (or) r’s complement: the r’s com- Complement of a complement is equal to the original plement of an m digit number N in base r is r m – N for number r m – (r m – M) = M N ≠ 0.   For example, N = 0, r’s complement is 0. Subtraction with Complements 2. Diminished radix complement: (or) (r -1)’s comple- Subtraction of two n digit unsigned numbers A - B in base r ment: Given a number N in base r having m digits, then can be done as follows by r’s complement method. (r -1)’s complement is (r m - 1) - N. Add A to the r’s complement of B. Mathematically   For example, decimal number system will have 10’s A + (r n - B) = A - B + r n complement and 9’s complement. If A ≥ B the sum will produce an end carry r n; which can   Similarly, binary number system will have 2’s com- be discarded. (Discarding carry is equivalent to subtracting plement and 1’s complement. r n from result). What is left is the result A – B? Chapter 1 Number Systems | 1.7 A = 1100 →         1100 Other notation for representation of signed numbers is B = 1010 (2’s complement) + 0110 signed complement system. This is convenient to use in a            Sum: 10010 computer for arithmetic operations. In this system, a nega- discard carry (–r n)   – 10000 tive number is indicated by its complement (i.e., comple-            A – B: 0010 ment of corresponding positive number) whereas the If A < B, the sum does not produce an end carry and sign-magnitude system negates a number by changing its result is r n - (B - A). Then take r’s complement of the sum, sign bit, the signed-complement system negates a number and place a negative sign in front. by taking its complement. Positive numbers use same nota- If A = 1010 tion in sign-magnitude as well as sign-complement systems. B = 1100 The signed-complement system can be used either as the A - B can be done as 1’s complement or the 2’s complement. A →    1010 But 2’s complement is the most common. B → 2’s complaint + 0100 +24 in 1’s/2’s complement representation is 011000    Sum:   1110 -24 in 1’s complement representation 100111 Here, no carry generated, so result is a negative number. -24 in 2’s complement representation 101000 2’s complement of result → 0010 = 2 Table 2 Signed binary numbers – (4-bits) result = -2 Signed- Signed 1’s Signed 2’s Subtraction of unsigned numbers by using (r – 1)’s com- Decimal Magnitude Complement Complement plement can be done in similar way. However, (r – 1)’s com- +7 0111 0111 0111 plement is one less than the r’s complement. Because of this, the sum produced is one less than the correct difference +6 0110 0110 0110 when an end carry occurs. So end carry will be added to the +5 0101 0101 0101 sum. Removing the end carry and adding 1 to the sum is +4 0100 0100 0100 referred to as an end-around-carry. +3 0011 0011 0011 Consider A = 1100, B = 1010 +2 0010 0010 0010 For A - B +1 0001 0001 0001 A → 1100 +0 0000 0000 0000 B → (1’s complement) + 0101 –0 1000 1111 – Sum:  10001 –1 1001 1110 1111 End around carry + 1 –2 1010 1101 1110 A - B = 0010 –3 1011 1100 1101 For B - A –4 1100 1011 1100 B → 1010 –5 1101 1010 1011 A → (1’s complement) + 0011 –6 1110 1001 1010   Sum: 1101 –7 1111 1000 1001 There is no end carry, for there result is –8 – – 1000 – (B – A) = –(1’s complement of 1101) = –0010 = –2 The ranges of signed binary numbers with n-bits Signed Binary Numbers Signed-magnitude: −2n-1 + 1 to +2n-1 − 1 Positive integers can be represented as unsigned numbers; 1’s complement representation: −2n-1 + 1 to +2n-1 − 1 but to represent negative integer, we need a notation for 2’s complement representation: −2n-1 to +2n-1 − 1 negative values in binary. It is customary to represent the sign with a bit placed in Signed 2’s complement representation can be directly the left most position of the number. The convention is to used for arithmetic operations. The carryout of the sign bit make the sign bit 0 for positive and 1 for negative. This repre- position is discarded. sentation of signed numbers is referred to as sign-magnitude In order to obtain a correct answer, we must ensure that convention the result has a sufficient number of bits to accommodate the sum/product. S Magnitude Example 38: X = 00110, Y = 11100 are represented in +24 is 0  11000    5-bit signed 2’s complement system sign magnitude Then their sum X + Y in 6-bit signed 2’s complemented –24 is 1  11000    representation is? sign magnitude 1.8 | Unit 1 Digital Logic Solution: X = 00110 If it is in 1’s complement/2’s complement form, then the Y = 11100 magnitude of negative number can be obtained by taking 1’s are 5-bit numbers complement/2’s complement for the number, respectively. But result needs to be in 6-bit format. 10111011 ⇒ 1’s complement ⇒ 01000100 = (68)10. Operands X and Y also should be in 6-bit format In 1’s complement format, the number is –68. X= 000110 10111011 ⇒ 2’s complement ⇒ 01000101 = (69)10. Y= 111100 In 2’s complement format, the number is –69. X + Y = (1) 000010 Example: Find (–9.625)10 in signed 2’s complement repre­ The carry out of sign bit position is discarded result is sentation. 000010. Signed binary fraction can be represented in the same Example 39: (36x 70)10 is 10’s complement of (yzyz0)10 way of signed integer. Then values of x, y, z are? 2 9 (A) 4, 5, 2 (B) 4, 6, 3 2 4 −1 (C) 3, 6, 3 (D) 3, 5, 4 2 2−0 Solution: (C) 1− 0 (36x70)10 is 10’s complement of (yzyz0)10. 0.625 × 2 = 1.25 10’s complement of (yzyz0)10 is 0.25 × 2 = 0.5 105 - yzyz0 = 36 × 70 0.5 × 2 = 1.0 So 36x70 + yzyz0 = 100000 = 0.101 36x70 +(9.625) = 01001.101 +yzyz0 –9.625  = 10110.011 (by taking 2’s complement) 100000 so 7 + z = 10, Binary Multipliers 1 + x + y = 10 z = 3 Multiplication of binary number is done in the same way as 1 + 6 + z = 10 y = 6 multiplication of decimal. 1 + 3 + y = 10, The multiplicand (m) is multiplied by each bit of the →x=3 multiplier (N), starting from the LSB. Let Example 40: The 10’s complement of (843)11 is? M = B3 B2 B1 B0 (A) (157)11 (B) (267)11 N = A3 A2 A1 A0 (C) (156)11 (D) (268)11 If M × N = P Solution: (B) A0B3 A0B2 A0B1 A0B0 Given (843)11 is base 11 number system and the number in A1B3 A1B2 A1B1 A1B0 the number system range from 0 to 9 & A (A = 10) A2B3 A2B2 A2B1 A2B0 10’s complement for (843)11 means (r - 1)’s complement. A3B3 A3B2 A3B1 A3B0 P7P6 P5 P4 P3 P2 P1 P0 =P So (r n - 1) - N = [(11)n - 1] - N (11)n - 1 ⇒ 1000 Example: Let M = 1 0 1 1    – 1 N = 1 1 0 0    AAA M × N = P    – 843 1011 ×     267 1100 10’s complement is (267)11 0000 Example 41: Consider the signed binary number to be 0000 10111011. What is the decimal equivalent of this number 1011 if it is in Sign-Magnitude form, or 1’s complement form, or 1011 2’s complement form? 111 _    10000100=P Solution: Given binary number = 10111011. As sign bit is 1, it is a negative number. If it is in sign-magnitude format, Binary Codes then MSB is sign bit, and remaining bits represent the mag- nitude, Binary codes can be classified as numeric codes and alpha- (0111011)2 = 32 + 16 + 8 + 2 + 1 = 59. So if the given numeric codes. The figure below shows the classification number is in sign-magnitude format, then the number is –59. of codes. Chapter 1 Number Systems | 1.9 Codes Numeric Alphanumeric Weighted Non- Self- Sequential Error detecting Cyclic Reflecting weighted complementing and correcting Gray Gray ASCII EBCDIC Hollerith Excess 3 Gray Five bit 8421 Excess 3 BCD codes Binary BCD 2421 5211 Excess 3 Parity Hamming 8421 2421 3321 4221 5221 5311 5421 631-1 7421 74-2-1 84-2-1 Numeric Codes Reflective codes Numeric Codes are the codes which represent numericals in Binary code in which the n least significant bits for code binary, i.e., only numbers as a series of 0s and 1s. words 2n through 2n + 1 – 1 are the mirror images of than for 0 through 2n – 1 is called reflective codes. Weighted and non-weighted codes Example: Gray Code The weighted codes are those which obey the position- weighting principle. Each position of a number repre- Self-complementing codes sents a specific weight. A code is said to be self-complementing, if the code word Example: BCD, Binary, 84-2-1, 2421, of the 9’s complement of number ‘N’, i.e., of “9-N” can be Non-weighted codes are codes which are not assigned obtained from the code word of ‘N’ by interchanging all fixed values. the zeros and ones, i.e., by taking 1’s complement. In other Example: Excess-3, Gray code words, logical complement of number code is equivalent to 2421, 5211, 84 – 2 – 1 are examples of weighted codes, in representation of its arithmetic complement. which weight is assigned to each position in the number. (27)10 in 2421 code → 0010 1101 Example: 84-2-1, 2421, XS -3. (45)10 in 5211 code → 0111 1000 All weighted BCD codes are self-complementing codes. (36)10 in 84 – 2 – 1 code → 0101 1010 Any digit in decimal will be represented by the weights Binary-coded decimal (BCD) represented by the code. In BCD, each decimal digit 0 to 9 is coded by a 4-bit binary number. BCD codes are convenient to convert to/or from Error-detecting and correcting codes decimal number system. Codes which allow only error detection are error-detecting codes. Decimal  BCD Digit Example: Parity   0     0000 Codes which allow error detection as well as correction are   1     0001 called error correcting codes.   2     0010 Example: Hamming codes   3     0011 Sequential codes   4     0100 A sequential code is one in which each succeeding code word   5     0101 is one binary number greater than the preceding code word.   6     0110 Example: XS–3, BCD   7     0111   8     1000 Cyclic codes (unit distance codes)   9     1001 Cyclic codes are those in which each successive code word differs from the preceding one in only one bit position. Example 42: (628)10 = (0110 0010 1000) BCD Example: Gray code 1.10 | Unit 1 Digital Logic BCD addition Excess-3 (XS-3) code BCD addition is performed by individually adding the Excess-3 code is a non-weighted BCD code, where each corresponding digits of the decimal number ex­pressed in digit binary code word is the corresponding 8421 code word 4-bit binary groups starting from the LSB. plus 0011. If there is no carry and the sum term is not an illegal code, Find the XS-3 code of no correction is needed. Example 47: (3)10 → (0011)BCD = (0110)xS3 If there is a carry out of one group to the next group or if the sum term is an illegal code, the (6)10 is added to the Example 48: (16)10 → (0001 0110)BCD sum term of that group, and the resulting carry is added → (0100 1001)xS3 to the next group. Gray code Example 43: 44 + 12 Each gray code number differs from the preceding number by a single bit. 0100 0100 (44 in BCD) Decimal Gray Code 0001 0010 (12 in BCD) 0 0000 0101 0110 (56 in BCD) 1 0001 Example 44: 76.9+ 56.6 2 0011 0111 0110. 1001 3 0010 4 0110 0101 0110. 0110 5 0111 1100 1100. 1111 (all are illegal 0110 0110. 0110 codes) Binary to gray conversion 0010 0010. 0101 Step I: Shift the binary number one position to the right, +1 +1 +1 (propagate carry) LSB of the shifted number is discarded. 0001 0011 0011. 0101 Step II: Exclusive or the bits of the binary number with 1 3 3. 5 those of the binary number shifted. BCD subtraction BCD subtraction is performed by sub- Example 49: Convert (1001)2 to gray code tracting the digits of each 4-bit group of the subtrahend Binary → 1010 from the corresponding 4-bit group of the minuend in Shifted Binary → 101 ⊕ binary starting from the LSB. Gray → 1111 Gray to binary conversion Example 45: 42 0100 0010 ( 42 in BCD) (a) Take the MSB of the binary number is same as MSB of −12 −0001 0010 (12 IN BCD) gray code number. 30 0011 0000 (No borrow, so this is (b) X-OR the MSB of the binary to the next significant bit the correct difference) of the gray code. Example 46: (c) X-OR the 2nd bit of binary to the 3rd bit of Gray code (Borrow to get 3rd bit binary and so on. 247.7 0010 0100 0111. 0111 (d) Continue this till all the gray bits are exhausted. are −156.9 0001 0101 0110. 1001 present, Example 50: Convert, gray code 1010 to binary 90.8 0000 0111 ⋅0000. 1110 subtract Gray 1 0 1 0 0110) −01001 − 0110 1010 ⇓ ⊕ || ⊕ ||  ⊕ || 1001 000 ⋅ 1000 Corrected 1100 1 1 0 0 difference = (1100)2 (90.8) Exercises Practice Problems 1 2. If (84)x (in base x number system) is equal to (64)y (in base y number system), then possible values of x and y Directions for questions 1 to 15: Select the correct alterna- are tive from the given choices. (A) 12, 9 (B) 6, 8 1. Assuming all the numbers are in 2’s complement rep- (C) 9, 12 (D) 12, 18 resentation, which of the following is divisible by 11110110? 3. Let A = 1111 1011 and B = 0000 1011 be two 8-bit (A) 11101010 (B) 11100010 signed 2’s complement numbers. Their product in 2’s (C) 11111010 (D) 11100111 complement representation is Chapter 1 Number Systems | 1.11 (A) 11001001 (B) 10011100 code. For example, the base -6 number 35 will be rep- (C) 11010101 (D) 10101101 resented by its BCH code 011101.  In this numbering system, the BCH code 4. Let r denotes number system’s radix. The only value(s) 001001101011 corresponds to the following number of r that satisfy the equation 3 (1331) r = (11) r is/are in base -6 system. (A) 10 (B) 11 (A) 4651 (B) 4562 (C) 10 and 11 (D) any r > 3 (C) 1153 (D) 1353 5. X is 16-bit signed number. The 2’s complement repre- 11. The signed 2’s complement representation of (-589)10 sentation of X is (F76A)16. The 2’s complement repre- in Hexadecimal number system is sentation of 8 × X is (A) (F24D)16 (B) (FDB3)16 (A) (1460)16 (B) (D643)16 (C) (F42D)16 (D) (F3BD)16 (C) (4460)16 (D) (BB50)16 12. The base of the number system for which the following 6. The HEX number (CD.EF)16 in octal number system is 66 (A) (315.736)8 (B) (513.637)8 operation is to be correct = 13 5 (C) (135.673)8 (D) (531.367)8 (A) 6 (B) 7 7. 8-bit 2’s complement representation a decimal number (C) 8 (D) 9 is 10000000. The number in decimal is 13. The solution to the quadratic equation x2 - 11x + 13 = 0 (A) +256 (B) 0 (in number system with radix r) are x = 2 and x = 4. (C) -128 (D) -256 Then base of the number system is (r) = 8. The range of signed decimal numbers that can be rep- (A) 7 (B) 6 resented by 7-bit 1’s complement representation is (C) 5 (D) 4 (A) -64 to + 63 (B) -63 to + 63 14. The 16’s complement of BADA is (C) -127 to + 128 (D) -128 to +127 (A) 4525 (B) 4526 9. Decimal 54 in hexadecimal and BCD number system is (C) ADAB (D) 2141 respectively 15. (11A1B)8 = (12CD)16, in the above expression A and B (A) 63, 10000111 (B) 36,01010100 represent positive digits in octal number system and C (C) 66, 01010100 (D) 36, 00110110 and D have their original meaning in Hexadecimal, the 10. A new binary-coded hextary (BCH) number system values of A and B are? is proposed in which every digit of a base -6 number (A) 2, 5 (B) 2, 3 system is represented by its corresponding 3-bit binary (C) 3, 2 (D) 3, 5 Practice Problems 2 6. Signed 2’s complement representation of (–15)10 is (A) 11111 (B) 10001 Directions for questions 1 to 20: Select the correct alterna- (C) 01111 (D) 10000 tive from the given choices. 1. The hexadecimal representation of (567)8 is 7. (0.25)10 in binary number system is? (A) 1AF (B) D77 (A) (0.01) (B) (0.11) (C) 177 (D) 133 (C) 0.001 (D) 0.101 2. (2326)8 is equivalent to 8. The equivalent of (25)6 in number system with base 7 (A) (14D6)16 (B) (103112)4 is? (C) (1283)10 (D) (09AC)16 (A) 22 (B) 23 (C) 24 (D) 26 3. (0.46)8 equivalent in decimal is? (A) 0.59375 (B) 0.3534 9. The operation 35 + 26 = 63 is true in number system (C) 0.57395 (D) 0.3435 with radix 4. The 15’s complement of (CAFA)16 is (A) 7 (B) 8 (A) (2051)16 (B) (2050)16 (C) 9 (D) 11 (C) (3506)16 (D) (3505)16 10. The hexadecimal equivalent of largest binary number 5. 53 in 2’s complement from is? with 14-bits is? (A) 1001011 (B) 001010 (A) 2FFF (B) 3FFFF (C) 0110101 (D) 001011 (C) FFFF (D) 1FFFF 1.12 | Unit 1 Digital Logic 11. If x is radix of number system, (211)x = (152)8, then x is 17. Match the items correctly (A) 6 (B) 7 Column 1 Column 2 (C) 9 (D) 5 (P) 8421 (1) Cyclic code 12. The value of r for which ( 224) r = (13) r is valid (Q) 2421 (2) self-complementing expression, in number system with radix r is? (R) 5212 (3) sequential code (A) 5 (B) 6 (S) Gray code (4) non-sequential code (C) 7 (D) 8 (A) P–2, Q–4, R–3, S–1 13. Which of the representation in binary arithmetic has a (B) P–1, Q–4, R–3, S–2 unique zero? (C) P–3, Q–2, R–4, S–1 (A) sign-magnitude (B) 1’s compliment (D) P–2, Q–4, R–1, S–2 (C) 2’s complement (D) All of these 18. Perform the subtraction in XS-3 code 57.6 - 27.8 14. For the binary number 101101111 the equivalent hexa- (A) 0101 1100.1011 (B) 0010 1001.1100 decimal number is (C) 00011101.1100 (D) 1010 1110.1011 (A) 14E (B) 9E (C) B78 (D) 16F 19. The 2’s complement representation of -17 is 15. Subtract 1001 from 1110 (A) 101110 (B) 111110 (A) 0010 (B) 0101 (C) 101111 (D) 110001 (C) 1011 (D) 1010 20. The decimal 398 is represented in 2421 code by 16. Which of the following is a positively weighted code? (A) 110000001000 (B) 001110011000 (A) 8421 (B) 84-2-1 (C) 001111111110 (D) 010110110010 (C) EXS-3 (D) 74-2-1 Previous Years’ Questions 1. (1217)8 is equivalent to 1, 2, 3. Define another random variable Y = X1 X2 ⊕ (A) (1217)16 (B) (028F)16 X3, where ⊕ denotes XOR. Then (C) (2297)10 (D) (0B17)16 Pr[Y = 0|X3 = 0] = ______ 2. P is a 16-bit signed integer. The 2’s complement rep- 8. The 16-bit 2’s complement representation of an inte- resentation of P is (F87B)16. The 2’s complement rep- ger is 1111 1111 1111 0101; its decimal representa- resentation of 8*P is tion is ___. (A) (C3D8)16 (B) (187B)16 (C) (F878)16 (D) (987B)16 9. Consider an eight - bit ripple - carry adder for com- 3. The smallest integer that can be represented by an puting the sum of A and B, where A and B are integers 8-bit number in 2’s complement form is represented in 2’s complement form. If the decimal (A) –256 (B) –128 value of A is one, the decimal value of B that leads to (C) –127 (D) 0 the longest latency for the sum to stabilize is _____. 4. The base (or radix) of the number system such that the  312 10. Let x1 ⊕x2 ⊕x3 ⊕x4 = 0 where x1 ,x2 ,x3 ,x4 are Boolean following equation holds is ––––– = 13.1  20 variables, and ⊕ is the XOR operator. Which one of 5. Consider the equation (123)5 = (x8)y with x and y as the following must always be TRUE? unknown. The number of possible solutions is –––––––. (A) x1 x2 x3 x4 = 0  (B) x1 x3 + x2 = 0 6. Consider the equation (43)x = (y3)8 where x and y (C) x1 ⊕ x3 = x3 ⊕ x4 are unknown. The number of possible solutions is (D) x1 + x2 + x3 + x4 = 0 _______ 11. Consider a quadratic equation x2 − 13x + 36 = 0 with 7. Suppose Xi for i = 1, 2, 3 are independent and identi- coefficients in a base b. The solutions of this equa- cally distributed random variables whose probability tion in the same base b are x = 5 and x = 6. Then b = mass functions are Pr[Xi = 0] = Pr[Xi = 1] = ½ for i = __________. Chapter 1 Number Systems | 1.13 Answer Keys Exercises Practice Problems 1 1. B 2. C 3. A 4. D 5. D 6. A 7. C 8. B 9. B 10. C 11. B 12. D 13. C 14. B 15. D Practice Problems 2 1. C 2. B 3. A 4. D 5. D 6. B 7. A 8. B 9. B 10. B 11. B 12. A 13. C 14. D 15. B 16. A 17. C 18. A 19. C 20. C Previous Years’ Questions 1. B 2. A 3. B 4. 5 5. 3 6. 5 7. 0.75 8. –11 9. –1.0 10. C 11. 8.0 to 8.0

Use Quizgecko on...
Browser
Browser