Amity School of Engineering & Technology: B. Tech. (CSE), V Semester Computer Architecture Jitendra Rajpurohit

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

Amity School of Engineering & Technology

Amity School of Engineering & Technology


B. Tech. (CSE), V Semester
Computer Architecture Jitendra Rajpurohit

Amity School of Engineering & Technology

Arithmetic Microoperations

Amity School of Engineering & Technology

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

Amity School of Engineering & Technology

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

Increment the contents of R1 by one Decrement the contents of R1 by one

Amity School of Engineering & Technology

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

Amity School of Engineering & Technology

4-bit binary adder


B3 A3 B2 A2 B1 A1 B0 A0 C0 FA

FA

C3

FA

C2

FA

C1

C4

S3

S2

S1

S0

A = 1001 B = 0101 Perform A+B

Amity School of Engineering & Technology

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.

Amity School of Engineering & Technology

4-bit adder-subtractor

A = 1001 B = 0101 Implement the circuit when M=0 and M=1


8
8

Amity School of Engineering & Technology

4-bit binary incrementer


The increment microoperation adds one to a number in a register. This can be accomplished by means of half-adders connected in cascade.

A3

A2

A1

A0

HA y

HA y

HA y

HA y

C4

S3

S2

S1

S0

Amity School of Engineering & Technology

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

Amity School of Engineering & Technology

11 11

Amity School of Engineering & Technology

Arithmetic circuit function table

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

You might also like