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

Number_System-Exercises

The document outlines exercises related to number systems, including methods for finding complements and performing BCD addition and subtraction. It explains diminished radix and radix complements, as well as BCD arithmetic operations with examples. Additionally, it touches on binary codes and ASCII.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Number_System-Exercises

The document outlines exercises related to number systems, including methods for finding complements and performing BCD addition and subtraction. It explains diminished radix and radix complements, as well as BCD arithmetic operations with examples. Additionally, it touches on binary codes and ASCII.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Number Systems - Exercises

Q1.

Ans:
Q2.

Ans:
Q3.

Ans:
Q4.

Ans:
Q5.
Q6.
Q7.
Q8.
Complement of a number
Method-1:
Diminished radix (r-1) complement:
(rn - r-m) - N
Radix (r) complement
rn - N
Where, r - base/radix, n - number of integer part digits/bits, m - number of fractional part
digits/bits, and N - input number

Method-2:
Diminished radix (r-1) complement: Subtract every digit/bit by (r-1)
Radix (r) complement: Add 1 to (r-1)’s complement
1. Find, 11’s and 10’s complement of (576)11
Ans:
Method-1: 11’s complement →(11)3 - (576)11 = (1331)10 → (1000)11 - (576)11 = (535)11
10’s complement → (113 - 1) - (576)11 = (AAA)11 - (576)11 = (534)11
Method-2: 10’s complement → (AAA)11 - (576)11 = (534)11
11’s complement → 10’s complement of 576 + 1 = (535)11

2. 10’s complement of (23.324)10 is


Ans:
Method-1: 10’s complement → (10)2 - 23.324 = 76.676
9’s complement → (10)2 - (10)-3 - 23.324 = 76.675
Method-2: 9’s complement → 99.999 - 23.324 = 76.675
10’s complement → 9s’ complement + 0.001 = 76.676
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Binary Codes Note:
1. 8421, 2421, and 8,4,-2,-1
are weighted codes.
2. {8,4,-2,-1}, {2421} and
Excess-3 are
self-complementary codes.
3. A necessary condition for
a weighted code to be
self-complementing is that
the sum of the weights must
equal 9.
4. There exist only four
positively weighted
self-complementing codes,
namely, (2, 4, 2, 1), (3, 3, 2,
1), (4, 3, 1, 1), and (5,2, 1,
1).
Ans:
Ans:
BCD Addition:
Case-I: Sum <= 9 with carry = 0
Example: 4 + 5 → 0100 + 0101 = 1001 = 9 (final answer)

Case-II: Sum > 9 with carry = 0


Example: 9 + 5 = 1001 + 0101 = 1110 → Invalid BCD, so add 0110 → 1110 + 0110 =
0100 with carry = 1 → 14

Case-III: Sum <= 9 with carry = 1


Example: 9 + 7 = 1001 + 0111 = 0000 with carry = 1, so add 0110 to 0000 → 0000 +
0110 = 0110 with carry = 1 → 16
Example:
35 + 17 = 52

0011 0101 ←35’s BCD


+ 0001 0111 ←17’s BCD
+ 0110 1110 ← carry generated
--------------
0100 1100 ←Invalid BCD answer
+ 0000 0110 ←Adding 0110 to 1100
--------------
0101 0010 ← 52 (Final answer)
BCD Addition
BCD Addition
BCD Subtraction - I
Example: 56 - 32 = 24
Case-I: 0101 0110 - 0011 0010 = 0010 0100 → 24
Case-II (9’s complement):
= 0101 0110 + 0110 0111 (9’s complement of -32 = 67)
= 1011 1101 (Invalid BCD, so add 0110 0110)
= 0010 0011 with carry = 1. In 9’s complement, we add carry back to sum
= 0010 0100 → 24
Case-III (10’s complement)
= 0101 0110 + 0110 1000 (10’s complement of -32 = 68)
= 1011 1110 (Invalid BCD, so add 0110 0110)
= 0010 0100 (drop carry) → 24
BCD Subtraction - II
Example: 35 - 48 = -13
Case-I (9’s complement):
= 0011 0101 + 0101 0001 (9’s complement of -48 = 51)
= 1000 0110 → 86 (9’s complement of -13)

Case-II (10’s complement):


= 0011 0101 + 0101 0010 (10’s complement of -48 = 52)
= 1000 0111 → 87 (10’s complement of -13)
Excess-3 Arithmetic
Example: 5 + 9 = 14
= 1000 + 1100 = 1 0100 (carry=1 add 0011)
= 1 0100 + 0011 0011 = 0100 0111 → 1 4 (in excess-3)
Example: 5 - 9 = -4
= 1000 + 0011 (-9 → 0 (9’s complement) → 3 (excess-3))
= 1011 (carry = 0, subtract 0011)
= 1000 (carry = 0 means 1000 → 5 (excess-3) → -4 (9’s complement)
Example: 9 - 5 = 4
= 1100 + 0111 = 1 0011 (add 0011 and carry = 1)
= 0111 = 4 (in excess-3)
Example: 27 - 18 = 9
= 0101 1010 + 1011 0100 (-18 → 81 (9’s complement) → 1011 0100 (excess-3 of 81))
= 1 0000 1110 (add 0011 to 0000 and subtract 0011 from 1110)
= 1 0011 1011 (add carry = 1 to 1011)
= 0011 1100 → 0 9 (excess-3)
Example: 67 - 79 = -12
= 1001 1010 + 0101 0011 (-79 → 21 (9’s complement) → 0101 0100 (excess-3 of 21))
= 1110 1101 (subtract 0011 form 1110 and subtract 0011 from 1101)
= 1011 1010 →8 7 (excess-3) → -12 (9’s complement)
Gray Code
ASCII (American Standard Code for Information Interchange)

You might also like