CS302 Assignment Solution 2

No Comments
ABC(A XOR B)X =NOT(A XOR B)Y =B XOR CX AND Y
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
1
1
1
0
0
1
1
0
0
0
0
1
1
0
1
1
0
0
1
1
0
0
1
0
0
0
0
1
0



BCD conversion codes representing the decimal digits 0 to 9:-
Decimal  BCD  Decimal  BCD
0            0000     5            0101
1            0001     6            0110
2            0010     7            0111
3            0011     8            1000
4            0100     9            1001


478  Decimal to Binary conversion:
478/2             239             Remainder  0
239/2             119             Remainder  1
119/2              59              Remainder  1
59/2               29               Remainder  1
29/2                14              Remainder  1
14/2               7                 Remainder  0
7/2                3                  Remainder  1
3/2                1                  Remainder  1
1/ 2               0                  Remainder  1
     478   = 111011110


  1. a.      BCD  conversion
478   = 111011110     
= 0001 1101   1110
129   = 10000001
= 1000 0001



BCD

129
0001 0010 1001
478
0100 0111 1000
 Question 2                                                                                                                                          [5Marks]

   b.  BCD addition of “129”  and “478”
            
                   0001 0010 1001
                  0100 0111 1000
                  0101 1010  0001 
                    1001          9
                   1000           8
                   0001          17
                   0110         adding 6              
                  0111


               0010         2
               0111         7       
              1010        10
              0110         adding 6               
         1   0000
  Carry  bit is added to next  most significant digit             
          0001
         0100
        0110                                       
  The answer is=   0110   0000  0111




Next PostNewer Post Previous PostOlder Post Home

0 comments

Post a Comment