e-ISSN:0976-5166
p-ISSN:2231-3850


INDIAN JOURNAL OF COMPUTER SCIENCE AND ENGINEERING

Call for Papers 2024

Feb 2024 - Volume 15, Issue 1
Deadline: 15 Jan 2024
Publication: 20 Feb 2024

Apr 2024 - Volume 15, Issue 2
Deadline: 15 Mar 2024
Publication: 20 Apr 2024

More

 

ABSTRACT

Title : Signed Numbers Conversions
Authors : J.Vijayasekhar, Y.Srinivas, N.Vamsi Krishna
Keywords : SAR, ROL, ROR, Overflow
Issue Date : February 2011
Abstract :
Signed integers are normally represented using 2’s complement representation. Addition and subtraction of signed numbers is done in the same manner as for unsigned numbers. However carry (or borrow) is simple ignored. Unlike unsigned number carry (or borrow) does not mean overflow or error. Doubling of a signed number can be done by shift left. However, halving of a signed number can not be done by shift right. Hence special arithmetic instruction SAR (Shift arithmetic right) is needed. We have defined an alternative representation for signed numbers. Here a positive number is represented by appended a zero (0) at right. Here a negative number is represented by inverting all bits in corresponding positive number. Two signed numbers are added by adding corresponding binary representation. After that carry is added to the result. Similarly two signed numbers are subtracted by subtracting corresponding binary representation. After that borrow is subtracted. Doubling and halving is done by ROL (Rotate left) and ROR (Rotate right) respectively. Following are drawbacks of our system. (A) Addition is done in two stages. In the first stage the numbers are added. In the second stage carry is added. Carry can not be ignored as in 2’s complement representation. (B) Same holds for subtraction. (C) When an odd number is halved then error results. In 2’s complement representation approximate answer appears. The advantage of our system is that entire arithmetic can be carried using ordinary logical instructions. No special instruction is needed. In 2’s complement representation a special instruction SAR is needed. This instruction is not used for any other purpose.
Page(s) : 43-47
ISSN : 0976-5166
Source : Vol.2, No.1