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


INDIAN JOURNAL OF COMPUTER SCIENCE AND ENGINEERING

Call for Papers

Apr 2019 - Volume 10, Issue 2
Deadline: 5 Apr 2019
Notification: 15 Apr 2019
Publication: 30 Apr 2019

June 2019 - Volume 10, Issue 3
Deadline: 5 June 2019
Notification: 15 June 2019
Publication: 30 June 2019

Indexed in

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