Professional Documents
Culture Documents
Amity School of Engineering & Technology: B. Tech. (CSE), V Semester Computer Architecture Jitendra Rajpurohit
Amity School of Engineering & Technology: B. Tech. (CSE), V Semester Computer Architecture Jitendra Rajpurohit
Amity School of Engineering & Technology: B. Tech. (CSE), V Semester Computer Architecture Jitendra Rajpurohit
Arithmetic Microoperations
Introduction
A microoperation is an elementary operation performed with the data stored in registers. The microoperations can be classified into four categories: o Register transfer microoperations o Arithmetic microoperations o Logic microoperations o Shift microoperations The basic arithmetic microoperations are addition, subtraction, increment and decrement. The other basic arithmetic microoperations are listed in the table .
3
3
Arithmetic Microoperations
Symbolic designation R3 R1 + R2 R3 R1 R2 R2 R2 R2 R2 + 1 R3 R1 + R2+1 Description Contents of R1 plus R2 transferred to R3 Contents of R1 minus R2 transferred to R3 Complement the contents of R2 (1s complement) 2s complement the contents of R2 (negate) R1 plus the 2s complement of R2 (subtraction)
R1 R1 + 1
R1 R1 - 1
Introduction(cont.)
The increment and decrement microoperations are symbolized by plus-one and minus-one operations,respectively. o These microoperations are implemented with a combinational circuit The arithmetic operations of multiply and divide are not included in the basic set of microoperations. o The multiplication operation is implemented with a sequence of add and shift microoperations. o Devision is implemented with a sequence of subtract and shift microoperations. The binary adder is constructed with full-adder circuits connected in cascade. See figure.
5
5
FA
C3
FA
C2
FA
C1
C4
S3
S2
S1
S0
Adder-subtractor
The addition and subtraction operations can be combined into one common circuit by including an exclusive-OR gate with each full-adder.
o o
When M=0 the circuit is an adder. When M=1 the circuit become a subtractor.
For signed numbers, this gives A-B if A>B or the 2s complement of (B-A) if A<B For unsigned numbers, the result is A-B provided that there is no overflow.
4-bit adder-subtractor
A3
A2
A1
A0
HA y
HA y
HA y
HA y
C4
S3
S2
S1
S0
Arithmetic Circuit
The basic component of an arithmetic circuit is the parallel adder. The diagram of a 4-bit arithmetic circuit is shown in next figure
10 10
11 11
Select S1 S0 Cin
0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1
Input Y
B B
Output D=A+Y+Cin
D= A+B D= A+B+1 D= A+B D= A+B+1 D=A D=A+1 D=A-1 D=A
Microoperation
Add Add with carry Subtract with borrow Subtract Transfer A Increment A Decrement A Transfer A
0 0 1 1
12 12