Professional Documents
Culture Documents
Chapter 1 Number Systems
Chapter 1 Number Systems
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 2
117
2 Quetient Remainder
2 58 1 LSB
2 29 0
2 14 1
2 7 0
2 3 1
2 1 1
0 1 MSB
(117)10 = (1110101)2
Example-2 :
Conversion of 0.61 into Binary
0.61 × 2 = 1.22 (MSB)1
×
× 2 = 0.88 0
0.88 × 2 = 1.76 1
only upto 4 or 5 digits
(0.61)10 = (0.1001)2
i) Binary to Decimal Conversion :
(.... X4 X3 X2 X1X0 . X–1 X–2 X–3 ...)
Decimal equation :
[(....X3r3 + X2 r2 + X1r1 + X0 r0) ·
( X–1r–1 + X–2 r– 2 + X–3r– 3 +....)]
For binary number system, r = 2
eg. (101101·001)2 = (X)10
(1 × 25 + 0 × 24 + 1 × 23 + 1 × 22 + 0 × 21 + 1 × 20) · (0 × 2–1 + 0 × 2–2 + 1× 2–3)
1
[1 + 0 + 4 + 8 + 0 + 32] · (45.125)10
8
1.1.2 Octal number System
This number system uses 0,1, 2, 3, 4, 5, 6 and 7 as digits. Its radix or base is 8.
i) Conversion from decimal to octal :
(a) Absolute (Integral value) : An absolute decimal number is converted into octal number by dividing the
number by 8 progressively as in binary system.
(b) Fractional number : A fractional number be converted to octal number by multiplying the number by
8 progressively as in case of binary system.
ii) Conversion from octal to Dacimal :
A number with radix or base ‘r’ can be converted to its decimal equivalent by multiplying each digit by its
respective weight and adding the products.
(467·32)8 = (X)10
For octal number system, r = 8
X = (7 × 80 + 6 × 81 + 4 × 82) · (3 × 8–1 + 2 × 8–2)
2
= (7 48 256)· 3/ 8
64
= 311· (0.375 + 0.03125)
= (311· 406)10
1.1.3 Hexadecimal number System
Hexadecimal number system consists of 16 digits i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F. The base
or radix of this number system is 16.
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 3
Digits – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Base = 16
i) Conversion from Decimal to Hexadecimal
(a) Integral part : An absolute decimal number is converted to hexadecimal number by dividing
the number by 16 progressively in similar manner as in binary number system.
(b) Decimal part /Fractional part : A fractional decimal number is converted to hexadecimal number by
multiplying the number by 16 progressively in similar manner as in binary number system.
ii) Conversion from Hexadecimal to Decimal : A hexadecimal number can be converted to its decimal
equivalent by multiplying each digit by its respective weight and adding all the products.
Example :
(B7AF·3E)16 = (X)10
3 14
(15 × 163 + 10 × 162 + 7 × 161 + 11 × 160) · 2
16 16
3 14
(15 + 160 + 256 × 7 + 11 × 4096) · 16 256
3 14
= (15 + 160 + 1792 + 45056) ·
16 256
3 14
= 47023 ·
16 256
= (47023.242)10
1.2 Conversion of Number System
1. Binary to Hexadecimal :
Binary to Hexadecimal conversion is obtained by making group of four bits to left and right of decimal
point. Then each group is replaced by its hexadecimal equivalent number.
2. Hex to Binary :
Hexadecimal to binary conversion is obtained by replacing each digit by its binary equivalent of four bits.
e.g. (1A3.BA)16 00011010
0011.10111010
1 A 3 B A 2
Binary to Octal Conversion : A binary number can be converted to its octal equivalent by making
group of three bits to left and right of decimal point. Then each group is replaced by its octal equivalent
number.
Example :
(101110010 · 0011)2 = (X)8
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 4
Octal to hexadecimal conversion is obtained by converting octal to binary and then from binary to hexa-
decimal number.
“Table of Different Number System”
1.3 Codes
Codes are symbolic representation of discrete information, which may be present in the form of number,
letters or physical quantities. These symbols are used to communicate information to computers.
1. Weighted binary codes
[8421, 7421, 5421, 5211, 4221, 3321, 2421, 342 1, 742 1 ]
2. Non-weighted codes [XS – 3, Gray code ]
3. Alpha-numeric codes – ASCII, EBCDIC, Hollerith code.
4. Error detecting code. Parity
5. Error Detecting and Correcting codes – Hamming.
Note: Maximum number of distinct quantities using n bits = 2n
Note : Each Digit of Decimal Number System is represented by a four digit code in weighted & non weighted
codes. Except Gray code.
1.3.1 Weighted codes
These are the codes in which each symbol position is assigned a weight.
In weight binary code each bit is multiplied by its weight indicated in code to get the decimal equivalent of the
code.
e.g. BCD (8421) , 7421, 5421, 5211, 4221 3321, 2421, 842 1, 742 1 .
Example :
Convert (8)10 in 7421, 5421, 5211, 4221, 3321, 2421 8421, 8421, 7421 codes
(a) (8)10 = 7 + 1 = (1001)7421
(b) (8)10 = 5 + 2 + 1 = (1011)5421
Note : Self compliment or reflective codes :
If ‘0’ is compliment of ‘9’, 1 is compliment of ‘8’, 2 is of 7, 3 is of 6, 4 is of 5, Then code is called self
compliment code.
Examples of self compliment codes – 5211, 4221, 3321, 2421, 842 1 ,
Note : Representation of (8)10 in 5211 code :
(8)10 = (1101)5211
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 5
(1110)5211 (8)10
Both are correct .
(1101)5211 (8)10
For self complementary ‘1’ Should be complement of code of ‘8’.
1.3.2 Non Weighted codes
Non-weighted codes are codes which are not positionally weighted, excess-3 code and gray codes are
example of non-weighted codes.
(i) Excess – 3 Code excess-3 code is obtained by adding 0011 to each BCD code of decimal numbers.
e.g :
Gray code : G3 G2 G1 G0
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 6
In this method, the value of parity is added so that total member of 1´s in code group (including parity bit) is
even.
Parity = 0 or 1
Example :
odd (1011) odd
(11000) even
Odd Parity Method
In this method, the value of parity is added so that total number of 1´s in code group (including parity bit) is
odd.
0 0 0 0 1
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 0
Even Parity
A
B XOR Pe
C
Odd Parity
A
B X-NOR Po
C
Note-1 The even parity bit generator and checker is the (XOR gate) odd parity bit generator and checker is
the (XNOR gate)
Note-2 Error correcting code Hamming code.
Note-3 For a code to be error correcting is minimum distance must be more than two.
1.4 Code Conversions
i) Decimal to BCD
Decimal to BCD conversion is obtained by replacing each digit of decimal number by its binary equiva-
lent
ii) Binary to BCD
Binary to BCD code conversion is possible by converting binary to decimal and then from decimal to its
BCD equivalent.
iii) BCD to Binary
BCD to binary conversion is obtained by converting the BCD to decimal and then decimal to its binary
equivalent.
iv) BCD to Excess - 3
BCD to excess-3 code conversion is obtained by adding 0011 to each BCD coded digit.
v) Excess – 3 to BCD :
Each (Excess – 3 code) – 0011 = BCD
Excess-3 to BCD code conversion is obtained by substracting 0011 from excess-3 code of each digit.
vi) Binary to Gray Code : Binary to gray code conversion is obtained by using rules as shown under.
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 7
Binary code : B5 B4 B3 B2 B1 B0
Gray code : G5 G4 G3 G2 G1 G0
vii) Gray to Binary code : Gray to binary code conversion is obtained by using rules as shown under.
Gray code : G5 G4 G3 G2 G1 G0
Binary code : B5 B4 B3 B2 B1 B0
1.5 Binary Arithmetic
1.5.1 Binary addition
A0 B0 Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
A0 B0 Difference Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
0 10100
+ 20 20
Example-2 :
0 1000
0 0000
Note : Zero has two Distinct representation in sign magnitude Representation.
1.6.2 One’s complement representation
When each bit of number is complemented, resulting number is one’s compliment of original number. One’s
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 8
( 37)10 (00100101)2
1's complement 11011010 1'complement
1
2's complement 11011011 (37)10
Example 1 :
(–130)10 in 2’s complement.
(130)10 = (10000010)2
Maximum decimal value of number with 8 bit = – 28 – 1 = –128
Therefore for (–130)10 at least nine bits should be taken.
(130)2 = (010000010)2
1's complement 101111101
1
2 's complement 101111110 (130)2
Objective Questions :
Which is wrong representation of –130 in binary
(a) 0111110 (b) 10111110
(c) 110111110 (d) 1110111110
Ans. (a)
Hint : Maximum number represented by 8 bits
= –(28– 1) = (– 128)10
Note : Two’s compliment of 2’s compliment of a number gives original number.
Example :
(4)10 = 0100
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 9
ii) If end around carry is not generated the result is negative and 1’s compliment of true result
Example :
(4)10 – (6)10
(6)10 = 0110
1’s complement = 1001
4(4)10 – (6)10 0100
1001
1101 1's complement
Real Result : 0010
Case II : – A – B
One’s compliment of A and B are added.
If carry is generated that should be added to the result and result is in its 1’s compliment form.
Example :
(–4)10 – (6)10 = (– 10)10
Number bits required = 5
Note : Maximum number with 4 bits
– (24 – 1– 1) = –7 [|–10| > |–7|] + 4 00100
1’s complement ( –4)10 11011
(+ 6)10 00110
1’s complement 11001
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 10
1000 0000
1000 0000
1 0000 0000
0110
1 0110
0000
(1
6 0) BCD
Example 2 :
(88)BCD + (88)BCD
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 11
1000 1000
1000 1000
1
1 0001 0000
0110 0110
1 0111
0110
(1 7 6) BCD
Example 3 :
(23)BCD + (88)BCD
0010 0011
1000 1000
1010
1011
invalid BCD invalid BCD
Step I 1 0110
1011 0001
Step II 0110
1 0001
0001
(1
1 1)BCD
Example 4 :
(76)BCD + (86)BCD
0111 0110
1000 0110
1111
1100
invalid BCD invalid BCD
Step I 1 0110
1 0000 0010
Step II 0110
1 0110
0010
(1 6 2)BCD
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 12
Example :
(38)10 + (44)10
0110 1011
0111 0111
0 1
1110 0010
0011 0011
ignored 1 1011
0101
(8 2)10
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 13
Objective Questions
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 14
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 15
(IAS)
Q.17 If (211)x = (152)8, then the value of base ‘x’ is
(a) 3 (b) 5
(c) 7 (d) 9
(IAS)
Q.18 Which of the following is a self-complementing code?
(a) 8421 code (b) Excess 3 code
(c) Pure binary code (d) Gray code
(IAS)
Q.19 The parity bit is added for.....purposes
(a) coding (b) indexing
(c) error-detection (d) controlling
IES (E & T)
Q.20 Which one of the following is a non-valid BCD code?
(a) 0111 1001 (b) 0101 1011
(c) 0100 1000 (d) 0100 1001
IES (EE)
Q.21 The binary number 00001011 when represented in BCD format, is given by
(a) 00001011 (b) 10111011
(c) 00010001 (d) 10001000
(IAS)
Q.22 When two numbers are added in excess-3 code and the sum is less than 9, then in order to get the correct
answer it is necessary to
(a) subtract 0011 from the sum (b) add 0011 to the sum
(c) subtract 0110 from the sum (d) add 0110 to the sum
IES (E & T)
Q.23 If two numbers in excess-3 code are added and the result is less than 9. then to get equivalent binary
(a) 0011 is subtracted (b) 0011 is added
(c) 0110 is subtracted (d) 0110 is added
Q.24 Gray code of the decimal number 13 is :
(a) 1010 (b) 1101
(c) 1011 (d) 1001
(UPPCS)
Q.25 The binary representation 100110 is numberically equivalent to:
(a) the decimal representation 46
(b) the octal representation 46
(c) the octal representation 26
(d) the decimal representation 26
(MPPCS)
Q.26 the number 7F in Hexadecimal number system is equivalent to the decimal number:
(a) 255 (b) 256
(c) 128 (d) 127
(RAS)
Q.27 Decimal 43 in Hexadecimal and BCD number system is respectively
(a) B2, 0100 0011 (b) 2B, 0100 0011
(c) 2B, 0011 0100 (d) B2, 0100 0100
GATE (E & T)
Q.28 The decimal value 0.25
(a) is equivalent to the binary value 0.1
(b) is equivalent to the binary value 0.01
(c) is equivalent to the binary value 0.00111
(d) cannot be represented precisely in binary
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 16
GATE (CS)
Q.29 Which of the following subtraction operations do not result in F16 ?
1. ( BA )16 - ( AB ) 16
2. ( BC )16 - ( CB )16
3. ( CB )16 - ( BC )16
Select the correct answer using the code give below:
(a) Only 1 and 2 (b) Only 1 and 3
(c) Only 2 and 3 (d) 1,2 and 3
IES (E & T)
Q.30 What is the Gray code word for the binary number 101011?
(a) 101011 (b) 110101
(c) 011111 (d)111110
IES (E & T)
Q.31 Given (135)base x + (144)base x = (323)base x.
What is the value of base x ?
(a) 5 (b) 3
(c) 12 (d) 6
IES (E & T)
Q.32 A Gray code is a/an :
(a) Binary weighted code
(b) Arithmetic code
(c) Code which exhibits a single bit change between two successive codes
(d) Alphanumeric code
IES (E & T)
Q.33 The ASC II code is a
(a) 5-bit code (b) 7-bit code
(c) 9-bit code (d) 11-bit code
IES (E & T)
Q.34 Which of the following is error-correcting code?
(a) EBCDIC (b) GRAY
(c) Hamming (d) ASCII
IES (E & T)
Q.35 The decimal equivalent of the hexadecimal number (3 E 8)16 is
(a) 1000 (b) 982
(c) 768 (d) 323
IES (E & T)
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 17
(0 1 0 0 1 0 0 1 0 1 1 1 0 1 0 1)2
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 18
(3 7 5 3)8
(0 1 1 1 1 1 1 0 1 0 1 1)2
16 16 7 23
7 7
7 B 23 B
– 3 B
3 C 23 11 12 C
(77)16 – (3 B)16 = (3C)16
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 19
Note :– The operation is same as that in decimal except that here 16 is used instead of 10
Q.7 Ans.(d)
Method-I :–
(E 3)16 = E × 161 + 3 × 160
= 14 × 161 + 3 × 160
= (227)10
(a) (1CE)16=1 × 162 + C × 161 + E × 160
= 1 × 162 + 12 × 161 + 14 × 160
= (462)10
(A 2)16 = A × 161 + 2 × 160
= 10 × 16 + 2 × 160
= (162)10
(1 C E)16 + (A 2)16 = 462 + 162
= (624)10
(b) (1 B C)16 – (A 2)16
= (1 × 162 + B × 161 + C × 160) – (A × 161 + 2 × 160)
= (256 + 176 + 12)10 – (160 + 2)
= (444) – (162)
= (282)10
(c) (2 B C)16 – (1 D E)16
= (2 × 162 + B × 161 + C × 160) – (1 × 162 + D × 161 + E × 160)10
= (512 + 176 + 12)10 – (256 + 208 + 14)10
= (700)10 – (478)10
= (222)10
(d) (200)16 – (1 1D)16
= (2 × 162)10 – (1 × 162 + 1 × 16 + D × 160)
= (512)10 – (285)10
= (227)10
Hence (E 3)16 = (200)16 – (1 1 D )16
Method-II :–
(a) (1CE)16 + (A2)16 = (270)16
E 2 16
LSB 16 16 0
1 C E
+ A 2 1 C A 1 12 10
2 7 0 23 16 7
11 2
LSB
0 1 1with borrow1
0 0 0, 0 1 1with borrow1
–1 –1 1 0 1,1 1 0
a) 1 1 1 0 0
1 0 0 0 1 1 1 0
0 1 0 1 1 MSB
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 20
Hence
(1 1 1 0 0)2 – (1 0 0 0 1)2 = (0 1 0 1 1)2
alternative (a) is incorrect
(b) (15 E)16 = (350)10
The conversion from an hexadecimal to a decimal number can be carried out by multiplying each significant
digit of the hexadecimal by its repective weight and adding the products
(15 E)16 = 1 × 162 + 5 × 161 + E × 160
= 256 + 80 + E
= 256 + 80 + 14
= (350)10
Hence (b) is correct
(c) (81)10 = (1 0 1 0 0 0 1)2
A decimal number is converted to binary number ny dividing the decimal number by 2 progressively,untill the
quotient of zero is obtained
2 81
2 40 1
2 20 0
2 10 0
2 5 0
2 2 1 = (1 0 1 0 0 0 1)2
2 1 0
1
(c) is correct
(d) (37.4)8 = (0 1 1 1 1 1.1 0 0)2
For obtaining the binary equivalent of an octal number, each significant digit in the given number is replaced
by its 3 bit binary equivalent using ratio 4 : 2 : 1
(37.4)8 = 37 .4
0 1 1 1 1 1 .100
= (0 1 1 1 1 1 . 1 0 0)2
Hence (d) is correct
Q.9 Ans. (d)
The conversion from hexadecimal to a decimal number can be carried out by multiplying each significant digit
of the hexadecimal by its respective weight and adding the products
3 2 1 0
(216 A16 016 F16 )16 = 2 × 163 + A × 162 + 0 × 161 + F × 160
= 8192 + 2560 + 0 + 15
= (10767)10
Q.10 Ans. (d)
To convert a hexadecimal number into its binary equivalent, each significant digit in the given number is
replaced by its 4 bit binary equivalent
(4 F 2 D)16 (x)2
4 F 2 D
0100 1111 0010 1101
= (0 1 0 0 1 1 1 1 0 0 1 0 1 1 0 1)2
Note :– For Hexadecimal to binary, we use the ratio 8 : 4 : 2 : 1
Q.11 Ans. (b)
To convert a hexadecimal number to octal, the following steps can be applied
i) Convert the given hexadecimal to its binary equivalent
ii) From groups of 3 bits, starting from LSB
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 21
iii) Write the equivalent octal number for each group of 3 bits
A) 68 = 6 8
0110 1000
= 01101000
Now forming groups of 3 bits from LSB
add 0 001 101 000
1 5 0
Hence (68)16 (150)8
B) 68 = 8 C
1000 1100
Forming groups of 3 bits we get
add 0 010 001 100
2 1 4
(8C)16 (214)8
C) 4F = 4 F
0100 1111
Forming groups of 3 bits, we get
add 0 001 001 111
1 1 7
(4 F)16 (117)8
D) 5D = 5 D
0101 1101
Forming groups of 3 bits, we get
add 0 001 011 101
1 3 5
(5 D)16 (135)18
Note :– Inserting 0 at the left most side of a number does not alter it
For example :– 145 or 0145 have same meaning.
Q.12 Ans. (c)
In hexadecimal system F represents 15
F´s complement is obtained by subtracting each digit of the given number from 15.
(2 BFD)hex = (2 BFD)16
15 – 2 = 13 = D in hexadecimal
15 – B = 15 – 11 = 4
15 – F = 15 – 15 = 0
15 – D = 15 – 13 = 2
Hence F´S complement of (2 BFD)16 is D402
Q.13 Ans. (b)
(235)R1 = (565)10
Let us convert (235)R from base R1 to decimal equivalent
1
2 R 3 R 5 R 10 = 565
2
1
1
1
2 R 12 3R 1 5 = 565
2 R 12 3 R 1 – 560 = 0
R 1 = 16
70
or
4
R 1 = 16
Now (565)10 = (865) R 2
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 22
8 R 6 R 2 5 R 02 = 565
2
2
8 R 22 6R 2 – 560 = 0
R2 = 8
70
or
8
R2 = 8
Q.14 Ans. (b)
1. (1 0 0 1 1 0)2= 1 × 25 + 0 × 24 + 0 × 23 + 1 × 22 + 1 × 21 + 0 × 20
= 32 + 4 + 2
= 38
(1 0 0 1 1 0)2 = (38)10
2. 1 0 0 1 1 0 Forming groups of 3 bits
4 6
(1 0 0 1 1 0)2 (46)8
3. By forming groups of 4 bits, we get
0010 0110
2 6
(1 0 0 1 1 0)2 (26)16
4. Decimal = 1 3
Add 3 to each bit = + 3 +3
4 6
Converting the above sum into its BCD
we have
Sum 4 6
BCD 0100 0110
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 23
Generated
5 268 Integer
3
5 53
3
5 10
5 2
0 = (2033)5
2
Hence x = 2033
Note :– Any number with any base r can be converted to decimal number and vice- versa.
1. Decimal to Base r :– For integer part divide the decimal number by r progressively. For fractional part
multiply by r progressively
2. Base r to Decimal :– Multiply each digit by its corresponding weight and add all
Q.17 Ans. (c)
(211)x = (152)8
To get value of x, we convert both sides into their corresponding decimal equivalents
(211)x = 2 × x2 + 1 × x1 + 1 × x0
= 2x2 + x + 1
(152)8 = 1 × 82 + 5 × 81 + 2 × 80
= 106
Now 2x2 + x + 1 = 106
2x2 + x – 105 = 0
2
2x + 15x – 14x – 105 = 0
2x2 – 14x + 15x – 105 = 0
2x (x – 7) + 15 (x – 7) = 0
x = 7,
15
x =
2
Since radix is a positive integer
x = 7
Q.18 Ans. (b)
The Excess – 3 code is a self complementing code.
Note :– 2421 code is also a self complementing code.
Note :– A code is called a self complementing code if 1´s complement of the coded number yield 9´s complement of
the number itself.
Q.19 Ans. (c)
During the process of binary data transmission errors may occur. In order to detect errors, error-detecting
codes are used. The simplest error detecting method is the parity check, in which an extra parity bit is
included with the binary message to make the total number of 1’s either odd or even, resulting in two methods.
1. Even-parity method :– The total number of 1’s in the code group (including the parity bit) must be an
even number.
2. Odd parity method :–The total number of 1’s (including parity bit) must be an odd number.
N ote :– The parity bit can be placed at either end of the code word, such that the receiver should be able to
understand the parity bit and the actual data
Q.20 Ans. (b)
The Binary Code Decimal (BCD) is a combination of 4 binary digits that represent decimal numbers. The
weights are assigned according to the positions occupied by these digits. The weights are 8-4-2-1 and hence
it is called 8421 code
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 24
but now for decimals above 9 if we apply 8-4-2-1, we get invalid BCDS
For example
10 1 0 1 0 is an invalid BCD
11 1 0 1 1 is an invalid BCD
ans so on
The valid BCD code for 10 is written as
1 0
0 0 0 1 0 0 0 0
1 1
0 0 0 1 0 0 0 1
The same procedure is followed to get valid BCD codes for all decimals above 9.
Thus among the given alternatives 0 1 0 1 1 0 1 1 is an valid BCD
Q.21 Ans. (c)
The binary number 0 0 0 0 1 0 1 1 represents decimal 11.
Hence BCD code for 11 is
0 0 01 0 0 01
Q.22 Ans.(a)
When two numbers are added in excess –3 code and the sum is less than 9 then in order to get the correct
answer it is necessary to subtract 0011from the sum.
Q.23 Ans. (a)
Q.24 Ans. (c)
Binary equivalent of 13 is 1101. Now we convert this binary number to Gray code as follows
11
1+1=0
1 + 1 + 0 +1 1+0=1
0+1=1
1 0 1 1
4 6
Hence (100110)2 = (46)8
Q.26 Ans. (d)
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 25
(43)10 = (2 B)16
BCD equivalent of 43 is 0100 0011
Q.28 Ans. (b)
Integer
0.25 × 2 = 0.50 0
×
× 2 = 0.00 0
(0.25)10 = (0.01)2
Q.29 Ans. (d)
1. (BA)16 – (AB)16 = (186)10 – (171)10
= (15)10
= F
2. (BC)16 – (CB)16 = (188)10 – (203)10
= –(15)10
= –F
3. (CB)16 – (BC)16 = (203)10 – (188)10
= (15)10
= F
So none of 1,2 and 3 result in F16
Q.30 Ans. (d)
Binary
1 0 1 0 1 1
1 1 1 1 0 Gray
(101011)2 = (111110)G
Q.31 Ans.(d)
(135)x + (144)x = (323)x
By converting both sides in base 10, we get
x2 + 3x + 5 + x2 + 4x + 4 = 3x2 + 2x + 3
x2 – 5x – 6 = 0
x = 6, x = –1
Hence value of base x is 6
Q.32 Ans. (c)
The Gray code belongs to a class of codes called minimum change codes, in which only one bit in the code
group changes when moving from one step to the next. The Gray code is a non weighted code. It is also
called a unit distance code.
Q.33 Ans. (b)
ASCII :– American Standards Code for Information Interchange).
It is alphanumeric code.
www.digcademy.com digcademy@gmail.com
Number Systems DIGITAL ELECTRONICS 26
It represents a character with 7 bits which can be stored as one byte with one bit unused.
It is 7 bit code
Q.34 Ans. (c)
(a) EBCDIC :– (Extended Binary Coded Decimal Information Code) is an alphanumeric code is used in
IBM.
It uses 8 bits for each character and a 9th bit for parity.
(b) Gray Code :– It is non-weighted code. It is also called minimum change code.It is also called unit-
distance code.
(c) Hamming Code :– Hamming Code is an error correcting code
(d) ASCII :– (American Standard Code for Information Interchange). It is an alphanumeric code. The
ASCII code represnets a character with 7 bits, which can be stored as one byte with one bit unused.
Q.35 Ans. (a)
(3 E 8)16 = (x)10
(3 E 8)16 = 3 × 162 + E × 161 + 8 × 160
= 3 × 162 + 14 × 161 + 8 × 160
= 768 + 224 + 8
= (1000)10
www.digcademy.com digcademy@gmail.com