Answer:
(10000000)₂ = -128 in decimal
(11001100)₂ = -52 in decimal
(10110111)₂ = -73 in decimal
Explanation:
<u>NOTE:</u> If Most Significant Bit is 0, it is positive number and if MSB is 1, it is negative number. If number is positive we can simply convert it to decimal. But if number is negative, follow following formula:
- (complement of the number) +1
<u>EXAMPLE 1</u>
(10000000)₂
(01 1 1 1 1 1 1)₂ ↔ complement of the number
<u>+ 1</u>
(10000000)₂ = 1 ×= 128 (magnitude in decimal)
But we remember MSB was 1 so answer is -128.
<u>EXAMPLE 2</u>
(1 1 0 0 1 1 00)₂
(0 0 1 1 0 0 1 1)₂
<u>+ 1 </u>
(0 0 1 1 0 1 0 0)₂ = 52 (magnitude in decimal)
But we remember MSB was 1 so answer is -52.
<u>EXAMPLE 3</u>
(1 0 1 1 0 1 1 1)₂
(0 1 00 1 000)₂
<u>+ 1 </u>
(01 00 1 00 1)₂ = 73 (magnitude in decimal)
But we remember MSB was 1 so answer is -73.
Answer:
In recursive methods, if a temporary variable is used to store intermediate results, then number of copies it will make is equal to recursive calls made during recursions
Explanation:
If a temporary variable is used to store intermediate result than it make a new copy every time when the recursive method calls itself until the last recursive call. So for that recursive methods are not storage efficient because they push and pop results of each call on memory.
Answer:
huwugsgssuaihsux h baiThatha svaadishht us