Digital
Electronics
NUMBERING SYSTEM QUESTIONS AND ANSWERS
Q1) Define: (a) bit (b) nibble (c) byte (d) word
Answer:
a. Bit: Binary digit (Either logic-1 or logic-0)
b. Nibble: 4-bits together is called a nibble
c. Byte: 8 bits or 2 nibbles
d. Word: 16 bits or 2 bytes
Q2) What is weighted code? Give example.
Answer:
The weighted code will have a fixed weight for each position. For example, in normal
binary system, the decimal equivalent can be obtained by multiplying the position
value with position weight and adding them together.
Q3) Give an example for Non-weighted code?
Answer:
Unlike weighted code, non-weighted codes will not any weights. For example,
Excess-3 code and Gray code. So the numbers that are represented using non-
weighted code can not be directly converted to decimal equivalents.
Q4) What is the key feature of Excess-3 code?
Answer:
Self-complementing: The 9’s complement of an excess 3 number can be obtained
simply by replacing its 1’s with 0’s and 0’s with 1’s.
Q5) In how many different ways can number 5 be represented using 2-4-2-1
code?
Answer:
2-4-2-1 represents the weights corresponding to bit
positions. So the two possible ways are: 1011, 0101
Q6) What are all the BCD numbers that can be uniquely represented in 2-4-2-1
weighted code?
Answer:
0, 1, 8 and 9 (Only these 4 numbers will have unique representations).
Q7) How many unused combinations are there in the representation of BCD
numbers using 7-4-2-1 weighted scheme? What are they?
Answer:
As BCD numbers range from 0 to 9, there are 5 unused combinations in 7-4-2-1
code. They are: 1011, 1100, 1101, 1110 and 1111.
Q8) What is the condition for a weighted code to be self-complementary?
Answer:
A weighted code is self-complimentary if the sum of the weights equals to
9. E.g.: 2-4-2-1 code. Sum of the weights = 2+4+2+1 = 9
Q9) Convert the binary number 011101010001 to octal and hexadecimal?
Answer:
(a) Binary: 011 101 010 001
Octal: 3 5 2 1
(b) Binary: 0111 0101 0001
Hex: 7 5 1
Q10) Formulate a simple procedure for converting base-3 numbers to base-9?
Answer:
Consider (Xn-1 Xn-2 .............. X3 X2 X1 X0) a n bit base 3 number.
The corresponding decimal equivalent is given by,
3n-1 Xn-1 + 3n-2 Xn-2................ + 33 X3 + 32X2 + 31X1 + 30X0
= 9(n-2)/2 (3 Xn-1 + Xn-2) + ...............+ 91(3 X3 + X2) + 90(3X1 + X0)
So take every to digits of base-3 number from LSB side, find their decimal
equivalent, it will be the corresponding base-9 digit. (Similar to the procedure of
converting a binary number to octal or hex)
Q11) Convert (211101222211122)3 to base-9?
Answer:
Base-3:(2 11 10 12 22 21 11 22)3
Base-9: 2 4 3 5 8 7 4 8
Q12) A number N has ‘n’ digits in a r-radix number system. What is its (r-1)’s
complement and r’s complement?
Answer:
(rn – 1)-N , (rn – N)
Q13) What is the 9’s complement of the BCD number 752?
Answer:
999 – 752 = 247
Q14) Convert the Gray code number 11001 to binary code?
Answer:
Conversion from gray to binary: Retain the MSB as it as. XOR the current input bit
with the previous output bit to get the new output bit. In this case, given gray code
number is 11001
So, the required binary number is 10001.
Q15) Give the procedure for converting a binary number to Gray code?
Answer:
Binary to Gray code conversion: Retain MSB. XOR Current bit of Binary input with
the previous bit of Binary input to get new bit of Gray code Output.
Q16) Represent 45 in the number systems (a) binary (b) BCD (c) Excess-3 (d)
Gray code
Answer:
(a) 101101
(b) To get BCD: Represent each digit separately in binary 0100 0101
(c) Excess-3: Add 3 to each digit and then represent them separately in binary 0111 1000
(d) Gray code: First convert to Binary and use the procedure shown in Q15: 111011
Q17) Give the range of the numbers that can be represented using n bits in 2’s
complement method?
Answer:
–(2 n – 1) to +(2 n – 1 – 1)
Q18) What is the minimum number of bits required to represent the numbers in
the range of -5 to 23 using 2’s complement method?
Answer:
(2 n – 1 – 1) > 23 => 2 n – 1 > 24 => 2 n – 1 = 32 => n-1 = 5 => n = 6 bits
Q19) What will be the result if all the zeros are retained from LSB side until 1 is
seen, including that 1, and complement all the following bits of a binary
number?
Answer:
2’s compliment of the binary number
E.g.: Consider 10010, Its 2’s compliment is given by 01110
Q20) In a particular design which uses 5 bits for integral part and 7 bits for
fractional part,the result of some operation is 7B8 hex. Find the corresponding
decimal equivalent?
Answer:
78B in hex = 01111.0111000 (5 integral bits and 7 fractional bits)
= 15.4375
Q21) Convert 0.95 to its binary equivalent?
Answer:
0.95 x 2 = 1.90 ----- 1
0.90 x 2 = 1.80 ----- 1
0.80 x 2 = 1.60 ----- 1
0.60 x 2 = 1.20 ----- 1
0.20 x 2 = 0.40 ----- 0
0.40 x 2 = 0.80 ----- 0
0.80 x 2 = 1.60 ---- 1 ……….
So, 0.95 = 0. 11 1100 1100 1100 1100....
Q22) AB16 – 3E16 = ?
Answer:
AB16 – 3E16 = (171) – (62)
= (109) = 6D16
Q23) Solve for x: (70)8 + (122)6 = (211)x?
Answer:
) 2x2+ x + 1 = 56 + 50 = 106 => x (2x+1) = 105 = 7 x 15 => x = 7
Q24) Solve for X in (135)12 = (X)8 + (78)9?
Answer:
(78)9 = 63 + 8 = (71)10
(135)12 = 144 + 36 + 5 = (181)10
(71)10 - (181)10 = (110)10 = (156)8
So, X = 156
Q25) Explain the detailed procedure for BCD addition?
Answer:
BCD addition is similar to any binary addition. But if the result is above 9, to get valid
BCD result, we need to add 6 to the result.
Q26) Perform BCD addition: (1001) + (0110)?
Answer:
1001
0110
1 1 1 1 (>9)
6,0 1 1 0
10101
So, the result is 0001 0101 = (1 5)