Vous êtes sur la page 1sur 11

Digital calculators and computers perform various arithmetic operations on binary numbers.

The basic operations are: addition, subtraction, multiplication and division.

Addition of Binary Numbers


Addition is the most important arithmetic operation in digital system because other operations of subtraction, multiplication and division actually use addition as their basic operation. The method of addition of two binary numbers is the same as the addition of decimal numbers. 0+0=0 1+0=1 1 + 1 = 10 = sum is 0 and a carry of 1 into next position 1 + 1 + 1 = 11 = sum is 1 and a carry of 1 into next position
S. Kal, IIT-Kharagpur

The half adder The half-adder adds two binary digits at a time and thus is a basic circuit for adders. The two binary digits, an addend and an augend, are added in a manner to generate a sum digit (S) and a carry digit (C)

S. Kal, IIT-Kharagpur

The full adder


A gate structure that adds three binary digits at a time is called a full adder. Thus a full adder also has a carry input. The addition of two mod-2 numbers of N digit, A = A N1 A N2 A0 and B = B N1 B N2 B0, is illustrated

There are two outputs namely, sum and carry, of the Boolean equations are given by S=A B C C = AB + AC + BC } Therefore, sum is 1 when number of input 1s is odd; carry is a 1 when two or more inputs are 1s
S. Kal, IIT-Kharagpur

A full-adder Circuit using two half-adders

Subtraction of Binary Numbers


The subtraction of a number A from B is, in fact, the addition of A and B. Thus an adder complements the magnitude of B and then magnitude of uncomplemented number (A) is added to the magnitude of the complement, B
S. Kal, IIT-Kharagpur

In order to subtract two four-bit binary numbers, e.g. subtraction of B3B2B1B0 from A3A2A1A0, we first invert each B-bit to get 1s complement of B3B2B1B0, i.e. B3B2B1B0 and then add to A3A2A1A0. Here A is the minuend, B the subtrahend, D = A B the difference, and C the borrow. When A = 0 and B = 1, it is necessary to borrow 1 from the minuend of the next higher order to allow the subtraction to be effected

A Full Adder Circuit


S. Kal, IIT-Kharagpur

Half subtractor
Half subtractor can subtract two digits at a time and produce an output of a difference and a borrow. It accepts A and B as inputs and yields d and b as outputs. From the truth table of a half subtractor, it follows that

d = A B,

b=

S. Kal, IIT-Kharagpur

Full subtractor
A full subtractor accepts the minuend (A), the subtrahend (B), and a borrow from a previous order (c) as inputs. Two half-subtractor may be combined to construct a full-subtractor, as shown below. One half-subtractor yields Ai Bi, while the second half-subtractor produces (Ai Bi) Ci1. A borrow must be transferred to the next higher order if either or both of the subtractions results in a borrow. Thus, the two individual borrow outputs are transferred to the next order through an OR gate.

S. Kal, IIT-Kharagpur

Multiplication of Binary Numbers The process of multiplication of binary numbers is similar to that of decimal numbers. As the numbers are only 0 or 1, the process is much simpler. An illustration of unsigned binary number multiplication process is given below
1001 n Multiplicand ! 910 1101 n Multiplier ! 1310 1001 0000 n Partial products 1001 1001 1110101 n Final product ! 11710
In digital computer all the partial products cannot be added together at the same time, rather two partial products are added at a time and the result is added to the subsequent partial product, and so on. Multiplication of signed numbers are done by 2s-complement method.
S. Kal, IIT-Kharagpur

Binary Division

The division of one binary number (dividend) by another (divisor) can be performed by repeated subtraction. Thus, the subtractions that are a part of division operation is usually carried out using 2s complement method. The digital circuits for division of binary numbers require adders, registers, basic gates and counters. In case of division of negative numbers, they are made positive by complimenting and the division is then carried out.
S. Kal, IIT-Kharagpur

10

The Arithmetic Logic Unit (ALU)


 One of the important and essential functions of a computer and electronic calculator is to perform arithmetic and logical operations. These operations are performed in a arithmetic logic unit (ALU) of a computer, where logic gates and flip-flops are combined so that they can add, subtract, multiply and divide binary numbers.  ALU is an extremely useful and versatile device because it makes possible of performing many different logical and arithmetic operations in a single IC package at a short time.  The ALU is the heart of every microprocessor unit, where the ALU is combined with shift registers, ROMs and RAMs so that a complex sequence of arithmetic and logic operations can be performed.  A typical emitter coupled logic (ECL) type ALU chip is MC 10181. The unit accepted as inputs are two 4-bit words A,B and a carry input C. This ALU can add two 4-bit numbers in approx. 6.5 ns, and typically output carry is generated in less than 5 ns.
S. Kal, IIT-Kharagpur

11

Vous aimerez peut-être aussi