Bel 13 Digital Arithmatic

Embed Size (px)

Citation preview

  • 8/3/2019 Bel 13 Digital Arithmatic

    1/11

  • 8/3/2019 Bel 13 Digital Arithmatic

    2/11

    2

    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, multiplicationand division actually use addition as their basic operation. Themethod of addition of two binary numbers is the same as theaddition 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

  • 8/3/2019 Bel 13 Digital Arithmatic

    3/11

    3

    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

  • 8/3/2019 Bel 13 Digital Arithmatic

    4/11

    4

    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 twomod-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 equationsare 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 whentwo or more inputs are 1s

    S. Kal, IIT-Kharagpur

  • 8/3/2019 Bel 13 Digital Arithmatic

    5/11

    5

    Subtraction of Binary Numbers

    The subtraction of a numberA from B is, in fact, the addition ofAand B. Thus an adder complements the magnitude of B andthen magnitude of uncomplemented number (A) is added to themagnitude of the complement, B

    A full-adder Circuit using two half-adders

    S. Kal, IIT-Kharagpur

  • 8/3/2019 Bel 13 Digital Arithmatic

    6/11

    6

    In order to subtract two four-bit binary numbers, e.g. subtraction ofB3B2B1B0 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 isnecessary to borrow 1 from

    the minuend of the nexthigher order to allow thesubtraction to be effected

    A Full Adder Circuit

    S. Kal, IIT-Kharagpur

  • 8/3/2019 Bel 13 Digital Arithmatic

    7/11

    7

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

    d = A B, b = B

    S. Kal, IIT-Kharagpur

    Half subtractor

  • 8/3/2019 Bel 13 Digital Arithmatic

    8/11

    8

    A full subtractor accepts the minuend (A), the subtrahend (B), and aborrow from a previous order (c) as inputs. Two half-subtractor maybe combined to construct a full-subtractor, as shown below. Onehalf-subtractor yields Ai Bi, while the second half-subtractorproduces (Ai Bi) Ci1. A borrow must be transferred to the nexthigher order if either or both of the subtractions results in a borrow.

    Thus, the two individual borrow outputs are transferred to the nextorder through an OR gate.

    S. Kal, IIT-Kharagpur

    Full subtractor

  • 8/3/2019 Bel 13 Digital Arithmatic

    9/11

    9

    The process of multiplication of binary numbers is similar to that ofdecimal numbers. As the numbers are only 0 or 1, the process ismuch simpler. An illustration of unsigned binary numbermultiplication process is given below

    10

    10

    10

    1171110101

    1001

    1001

    0000

    1001

    131101

    91001

    !n

    n

    !n

    !n

    productFinal

    productsPartial

    Multiplier

    ndMultiplica In digital computer all the

    partial products cannot be ad-ded together at the same time,rather two partial products areadded at a time and the resultis added to the subsequentpartial product, and so on.

    Multiplication of signed numb-ers are done by 2s-comple-ment method.

    S. Kal, IIT-Kharagpur

    Multiplication of Binary Numbers

  • 8/3/2019 Bel 13 Digital Arithmatic

    10/11

    10

    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 operationis usually carried out using 2s complement method. Thedigital circuits for division of binary numbers requireadders, registers, basic gates and counters. In case ofdivision of negative numbers, they are made positive bycomplimenting and the division is then carried out.

    S. Kal, IIT-Kharagpur

    Binary Division

  • 8/3/2019 Bel 13 Digital Arithmatic

    11/11

    11

    The Arithmetic Logic Unit (ALU)

    One of the important and essential functions of a computer andelectronic 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 makespossible of performing many different logical and arithmetic operationsin a single IC package at a short time.

    The ALU is the heart of every microprocessor unit, where the ALU iscombined with shift registers, ROMs and RAMs so that a complexsequence of arithmetic and logic operations can be performed.

    A typical emitter coupled logic (ECL) type ALU chip is MC 10181. Theunit 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 typicallyoutput carry is generated in less than 5 ns.

    S. Kal, IIT-Kharagpur