GATE 2002
56 questions
MCQ 561-mark 56
Questions 21–25 of 56
Sign extension is a step in
Answer: (D)
Sign extension means copying the sign bit into the new upper bits when a signed number is stored in more bits. Positive numbers get 0s and negative numbers get 1s, so the value stays the same. For example, the 4-bit number becomes the 8-bit number .
This is the step used when converting a signed integer from one size to a larger one, which is option (D).
The other options do not need it: floating point multiplication adds exponents and multiplies mantissas, 16-bit addition works on operands that already have the same width, and an arithmetic left shift only fills the right end with 0s.
Answer: (D)
This is the step used when converting a signed integer from one size to a larger one, which is option (D).
The other options do not need it: floating point multiplication adds exponents and multiplies mantissas, 16-bit addition works on operands that already have the same width, and an arithmetic left shift only fills the right end with 0s.
Answer: (D)
The 2's complement represent representation of the decimal value -15 is
Answer: (D)
Find the binary value of 15 with one extra bit for the sign. , so with a sign bit it is (5 bits).
Invert:
Add 1:
Check: in 5-bit 2's complement the top bit has weight , so .
At least 5 bits are needed, because 4 bits only cover to . Options (A) 1111, (B) 11111 and (C) 111111 are all in their own widths (4, 5 and 6 bits).
Answer: (D)
Invert:
Add 1:
Check: in 5-bit 2's complement the top bit has weight , so .
At least 5 bits are needed, because 4 bits only cover to . Options (A) 1111, (B) 11111 and (C) 111111 are all in their own widths (4, 5 and 6 bits).
Answer: (D)
The decimal value of 0.25
Answer: (B)
Convert the fraction by repeated multiplication by 2. The integer part of each product is the next bit after the binary point.
, integer part 0 (first bit).
, integer part 1 (second bit). The fractional part is now 0, so stop.
So . Check: .
Option (A) is wrong: . Option (D) is wrong: , so it has an exact binary form.
Option (C), 0.00111... with the 1s repeating, sums to . It is the same number as 0.01, in the way 0.0999... equals 0.1 in decimal. But it is only a non-terminating way of writing it; the conversion gives the exact finite form 0.01, which is option (B).
Answer: (B)
, integer part 0 (first bit).
, integer part 1 (second bit). The fractional part is now 0, so stop.
So . Check: .
Option (A) is wrong: . Option (D) is wrong: , so it has an exact binary form.
Option (C), 0.00111... with the 1s repeating, sums to . It is the same number as 0.01, in the way 0.0999... equals 0.1 in decimal. But it is only a non-terminating way of writing it; the conversion gives the exact finite form 0.01, which is option (B).
Answer: (B)
What are the states of the Auxiliary Carry (AC) and Carry Flag (CY) after executing the following 8085 program ?
MVI H, 5DH
MVI L, 6BH
MOV A, H
ADD L
MVI H, 5DH
MVI L, 6BH
MOV A, H
ADD L
Answer: (C)
H is loaded with 5DH and L with 6BH. Then H is copied into A, and L is added to A.
Add the two numbers:
- Lower nibble: . The value is above 15, so a carry goes from bit 3 to bit 4. So AC = 1.
- Upper nibble: . It fits in 4 bits, so no carry comes out of bit 7. So CY = 0.
The result is A = C8H, with AC = 1 and CY = 0.
Answer: (C)In 8085 which of the following modifies the program counter ?
Answer: (D)
Every instruction changes the PC. PCHL copies the content of the HL pair into the PC. CALL and JMP change the PC to the address they jump to. When ADD is executed, the PC is incremented so the next instruction can be fetched.