Beruflich Dokumente
Kultur Dokumente
Unsigned Notation
By Sherwin Chiu
Unsigned Notation
Introduction
Definition
of Unsigned Notation
Addition
Subtraction
Multiplication
Division
Introduction
Most frequently preformed operation is
copying data from one place to another:
From
Definition of Unsigned
Notation
Unsigned Notation: The notation does not
have a separate bit to represent the sign of
the number.
Unsigned Notation
There are two types of unsigned notation:
Non-negative notation
2. 2s complement notation
1.
Non-negative versus
2s complement
Binary Representation
Non-negative
2s Complement
0000
0001
0111
7 (2 n-1- 1)
1000
-8 (2 n-1 )
1001
-7
1111
15 (2 - 1)
-1
Addition
Can
A little
Straightforward Addition
Adding
When
Implementation of
ADD: XX+Y
Overflow
When
Subtraction
Essentially
Overflow
Implementation of
SUB: X X Y
Multiplication
We could
It
People to Shift-Add
Multiplication
Binary Multiplication
Using
Shift-Add Multiplication
in RTL Form
X,U,V n bit register
C 1 bit register for carry
Start initiates
1: U0, i n
Vo 2: CU U + X
2: i i 1
3: shr(CUV)
Z3: GOTO 2
Z 3: FINISH1
1: U0, i n
3: shr(CUV)
Conditions
Vo 2: CUU + X
Z3: GOTO 2
Micro-operations
START
2: i i 1
Z 3: FINISH1
i
xxxx
1011
U0, i 4
Vo 2,2
CUU+X, ii1
3, Z3
shr(CUV), GOTO 2
Vo 2,2
CUU+X, ii 1
3, Z3
shr(CUV), GOTO 2
3, Z3
ii 1
shr(CUV), GOTO 2
Vo 2,2
CUU+X, ii 1
3, Z 3
shr(CUV), FINISH1
FINISH
0
0000
1101
0110
0011
1001
1101
0
1110
0
0100
0001
1000
1111
1
1111
Implementation of Shift-Add
Multiplication Algorithm
Division
Can
Shifting
Micro-operations
START
1001
0011
xxxx
1100
11
CUU+X+1
12
U U+X
Y 0,OVERFLOW 0,i 4
shl(CUV),shl(Y),i i-1
C41
U U+X+1
C42,Z42
Y0 1,GOTO 3
shl(CUV),shl(Y),i i-1
C41
CU U+X+1
C42,Z42
U U+X,GOTO 3
shl(CUV),shl(Y),i i-1
C41
U U+X+1
C42,Z42
Y0 1,GOTO 3
shl(CUV),shl(Y),i i-1
C41
U U+X+1
C42,Z42
Y0 1,FINISH1
FINISH
0
1001
1
0010
0110
0000
0000
0101
0001
2
1010
1101
1100
0010
1000
0100
1010
1
0101
1000
0101
0
0001
0000
1010
0100
1011
Implementation of shift-sub
division algorithm
Conclusion
Basic