in Digital Logic edited by
4,168 views
27 votes

Sign extension is a step in 

  1. floating point multiplication
  2. signed $16$ bit integer addition
  3. arithmetic left shift
  4. converting a signed integer from one size to another
in Digital Logic edited by
4.2k views

3 Comments

Can any implement it on following ?

101101
0
edited by
in which size do you  want change this ?

0110  i want to extend this to 8 bit

as it is sign o so positive number 00000110

if it will be like 1110 then its sign 1 so its -ve number  in 1's complement number it will be 10000110... just shift sign bit to msb of extended form ...

and in 2's number representation it will 11111110 ... as 2's complement  is weighted ..so simply write sign bit in all places from msb to extra bit in extended form
2

I think even option D is not completely correct because 

  1. If the sign number is positive then it will work fine  e.g. 0101 = + 5 (4 bit) ---> 00101 = + 5 (5 bit)
  2. If the sign number is negative then it won’t work e.g. 101 = -1 (3 bit) ----> 1101 = – 5 (4 bit)
0

Subscribe to GO Classes for GATE CSE 2022

4 Answers

28 votes
 
Best answer

(D) is the answer. Sign extension (filling the upper bits using the sign bit) is needed while increasing the number of bits for representing a number. For positive numbers, $0$ is extended and for negative numbers $1$ is extended.

edited by

5 Comments

also used in Airthmetic right shift.
7
i think it is used to increase no of bits.
0

rajoramanoj, only increasing the number of bits is not enough along with it  we  also have to maintain the sign of number.

1

To understand sign extension, follow below link:

https://andybargh.com/binary-sign-extension/

0

Sign extension is also used in arithmetic right shift.

Ref: https://stackoverflow.com/questions/15729765/sign-extension-with-bitwise-shift-operation

0
8 votes
It is used if we want to store one register value into another register.

for example if we want to transfer a register value which can store 8 bits into register which can store 16 bits in that case we have

to fill the empty bits in 16 bits register with signed values
3 votes
D it is used to increment the number of bits of a number
0 votes
Answer:

Related questions