Assignment 1 ECS
Assignment 1 ECS
Assignment 1 ECS
Part – A
i. Ones complement:
A=8 B=4
4 bit of B = 0100
1000
1011
=0100 ( 4 )
A=6 B=4
4 bit of B = 0100
0110
1100
= 0010( 2 )
=> When the sign of 2 numbers are different, adding them will never result in a overflow.
But when the sign of 2 numbers is same or the sign of the sum is different than the sign of either
numbers overflow occurs.
Eg:
1010(-6)
1100(-4)
3. Perform BCD Addition of the following decimals. Also indicate how many BCD corrections
are required in (a) and (b):
(a) 49 and 57
0100 1001
0101 0111
=1010 0110
1 BCD Correction
= 10 0 0
= 1000
3 BCD Corrections
4. Find the gray code equivalent for the 4-bit binary numbers. How we obtain the gray code
representation for (m+1) bits from m-bits:
We can obtain the gray code representation for (m+1) bits from m-bits by adding a 0 in front of each
code word in m-bit gray code and adding a 1 in front of each code word in the complement of the m-
bit gray code.
Part – B
1. 1011012 to Decimal
= 1 + 0 + 4 + 8 + 0 + 32
= 45
2. 1001.01012 to Decimal
= 9.3125
3. 25510 to Binary
255/2 127+1
127/2 63+1
63/2 31+1
31/2 15+1
15/2 7+1
7/2 3+1
3/2 1+1
1/2 0+1
= 11111111
4. 2378 to Decimal
= 7 + 24 +128
= 159
5. 27.12510 to Octal
27/8 3+3
3/8 0+3
=33
0.125 x 8 = 1+0
= 0.1
= 33.1
6. BEED to Decimal
= 48877
= 01010010
8. -1 to 2’s Complement
For -1,
+1 = 0001
= 1111