Professional Documents
Culture Documents
Q.-1
Convert the following numbers in to binary, rotate it to right three times and
convert the result again to decimal.
Ans.
1) 27
Sol:
Binary:
00011011
Rotate right: 10001101
Rotate right: 11000110
Rotate right: 01100011
Decimal:
99
2) 33
Sol:
Binary:
00100001
Rotate right: 10010000
Rotate right: 01001000
Rotate right: 00100100
Decimal:
36
3) 45
Sol:
Binary:
00101101
Rotate right: 10010110
Rotate right: 01001011
Rotate right: 10100101
Decimal:
165
4) 57
Sol:
Binary:
00111001
Rotate right: 10011100
Rotate right: 01001110
Rotate right: 00100111
Decimal:
39
5) 61
Sol:
Binary:
00111101
Rotate right: 10011110
11) 143
Sol:
Binary:
10001111
Rotate right: 11000111
Rotate right: 11100011
Rotate right: 11110001
Decimal:
241
12) 155
Sol:
Binary:
10011011
Rotate right: 11001101
Rotate right: 11100110
Rotate right: 01110011
Decimal:
115
13) 160
Sol:
Binary:
10100000
Rotate right: 01010000
Rotate right: 00101000
Rotate right: 00010100
Decimal:
20
14) 167
Sol:
Binary:
10100111
Rotate right: 11010011
Rotate right: 11101001
Rotate right: 11110100
Decimal:
244
15) 183
Sol:
Binary:
10110111
Rotate right: 11011011
Rotate right: 11101101
Rotate right: 11110110
Decimal:
246
16) 199
Sol:
Binary:
11000111
Rotate right: 11100011
Rotate right: 11110001
Rotate right: 11111000
Decimal:
248
17) 224
Sol:
Binary:
11100000
Rotate right: 01110000
Rotate right: 00111000
Rotate right: 00011100
Decimal:
28
18) 240
Sol:
Binary:
11110000
Rotate right: 01111000
Rotate right: 00111100
Rotate right: 00011110
Decimal:
30
Q.-2
Convert the following numbers in to binary, rotate it to left six times and
convert the result again to decimal.
Ans.
1) 27
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
00011011
00110110
01101100
11011000
10110001
01100011
11000110
198
2) 33
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
00100001
01000010
10000100
00001001
00010010
00100100
01001000
72
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
00101101
01011010
10110100
01101001
11010010
10100101
01001011
75
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
00111001
01110010
11100100
11001001
10010011
00100111
01001110
78
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
00111101
01111010
11110100
11101001
11010011
10100111
01001111
79
3) 45
Sol:
4) 57
Sol:
5) 61
Sol:
6) 68
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
01000100
10001000
00010001
00100010
01000100
10001000
00010001
17
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
01010010
10100100
01001001
10010010
00100101
01001010
10010100
148
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
01100001
11000010
10000101
00001011
00010110
00101100
01011000
88
7) 82
Sol:
8) 97
Sol:
9) 129
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
10000001
00000011
00000110
00001100
00011000
00110000
01100000
96
10) 137
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
10001001
00010011
00100110
01001100
10011000
00110001
01100010
98
11) 143
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
10001111
00011111
00111110
01111100
11111000
11110001
11100011
227
12) 155
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
10011011
00110111
01101110
11011100
10111001
01110011
11100110
230
13) 160
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
10100000
01000001
10000010
00000101
00001010
00010100
00101000
40
14) 167
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
10100111
01001111
10011110
00111101
01111010
11110100
11101001
233
15) 183
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
10110111
01101111
11011110
10111101
01111011
11110110
11101101
237
16) 199
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
11000111
10001111
00011111
00111110
01111100
11111000
11110001
241
17) 224
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
11100000
11000001
10000011
00000111
00001110
00011100
00111000
56
18) 240
Sol:
Binary:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Rotate left:
Decimal:
11110000
11100001
11000011
10000111
00001111
00011110
00111100
60