Arithmetic circuits in computer architecture( fundamentals of computer system). PDF

Title Arithmetic circuits in computer architecture( fundamentals of computer system).
Author shahna Ibrahim
Course B.Sc. Computer Science
Institution Bharathiar University
Pages 12
File Size 644.5 KB
File Type PDF
Total Downloads 58
Total Views 146

Summary

An arithmetic circuit is a set of gates with a separate set of inputs for each number that has to be processed. The gates are connected so as to carry out an arithmetic action and the outputs of the gate circuit are the digits of the result (addition, subtraction, multiplication, or division)....


Description

Arithmetic Circuits: Half adder, Full adder, Parallel binary adder, BCD adder, Half subtractor, Full subtractor, Parallel binary subtractor - Digital Logic: the Basic Gates – NOR, NAND, XOR Gates

Arithmetic Circuits: Arithmetic circuit such as binary adders, parallel binary adder and BCD adder are explained with circuit diagram. Half adder

Half adder logic diagram The half adder adds two single binary digits A and B. It has two outputs, sum (S) and carry (C). The carry signal represents an overflow into the next digit of a multi-digit addition. The value of the sum is 2C + S. The simplest half-adder design, pictured on the right, incorporates an XOR gate for S and an AND gate for C. With the addition of an OR gate to combine their carry outputs, two half adders can be combined to make a full adder. [1] The half adder adds two input bits and generates a carry and sum, which are the two outputs of a half adder. The input (variables of a half adder are called the augend and addend bits. The output variables are the sum and carry. The truth table for the half adder is: Inputs Outputs A B C S 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0

Full adder

Logic diagram for a full adder.

Schematic symbol for a 1-bit full adder with Cin and Cout drawn on sides of block to emphasize their use in a multi-bit adder A full adder adds binary numbers and accounts for values carried in as well as out. A one-bit full adder adds three one-bit numbers, often written as A, B, and Cin; A and B are the operands, and Cin is a bit carried in from the previous less-significant stage.[2] The full adder is usually a component in a cascade of adders, which add 8, 16, 32, etc. bit binary numbers. In this implementation, the final OR gate before the carry-out output may be replaced by an XOR gate without altering the resulting logic. Using only two types of gates is convenient if the circuit is being implemented using simple IC chips which contain only one gate type per chip. A full adder can be constructed from two half adders by connecting A and B to the input of one half adder, connecting the sum from that to an input to the second adder, connecting Ci to the other input and OR the two carry outputs. The critical path of a full adder runs through both XOR-gates and ends at the sum bit The truth table for the full adder is: Inputs Outputs A B Cin Cout S 000 0 0 001 0 1

0 0 1 1 1 1

1 1 0 0 1 1

0 1 0 1 0 1

0 1 0 1 1 1

1 0 1 0 0 1

PARALLEL BINARY ADDER Parallel binary adder is used to add two binary numbers. As for example, if we want to add two four-bit binary numbers, we need to construct a four bit parallel binary adder as shown below. Such an adder requires one Half-Adder denoted by HA and three Full-Adders denoted by FA. The binary numbers being added are A4 A3 A2 A1 and B4 B3 B2 B1 and the answer is: A4 A3 A2 A1 + B4 B 3 B 2 B 1

The first column requires only a Half-Adder. For any column above the first, there may be a carry from the preceding column. Therefore, we must use a Full-Adder for each column above the first. To illustrate how parallel binary adder of the above picture works, let us take an example. If we want to add two numbers say 9 and 11. The binary equivalent of decimal 9 is 1001 and that of decimal 11 is 1011. The given block diagram shown below shows how the binary adder works with these inputs.

As shown in the above picture, the Half-Adder adds the binary bits 1 + 1 to give a sum of 0 and a carry 1. This carry goes into the first Full-Adder which adds 0 + 1 + 1 to get a sum of 0 and a carry of 1. Now, this carry goes into the next Full-Adder that adds 0 + 0 + 1 to get a sum of 1 and a carry of 0. The last Full-Adder adds 1 + 1 + 0 to get a sum of 0 and a carry of 1. The final input of the system is 10100. The decimal equivalent of binary 10100 is 20 which is the correct decimal sum of 9 and 11. The parallel binary adder of above figure has limited capacity. The largest binary numbers that can be added using it are 1111 and 1111. BCD Adder BCD or Binary Coded Decimal is that number system or code which has the binary numbers or digits to represent a decimal number. A decimal number contains 10 digits (0-9). Now the equivalent binary numbers can be found out of these 10 decimal numbers. In case of BCD the binary number formed by four binary digits, will be the equivalent code for the given decimal digits. In BCD we can use the binary number from 0000-1001 only, which are the decimal equivalent from 0-9 respectively. Suppose if a number have single decimal digit then it’s equivalent Binary Coded Decimal will be the respective four binary digits of that decimal number and if the number contains two decimal digits then it’s equivalent BCD will be the respective eight binary of the given decimal number. Four for the first decimal digit and next four for the second decimal digit. It may be cleared from an example. Let, (12)10 be the decimal number whose equivalent Binary coded decimal will be 00010010. Four bits from L.S.B is binary equivalent of 2 and next four is the binary equivalent of 1.is of four bit but in case of BCD it is an eight bit number. This is the main difference between Binary number and binary coded decimal. For 0 to 9 decimal numbers both binary and BCD is equal but when decimal number is more than one bit BCD differs from binary.

Decimal number 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Binary number 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

Binary Coded Decimal(BCD) 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 0001 0000 0001 0001 0001 0010 0001 0011 0001 0100 0001 0101

Half Subtractor : Half Subtractor is used for subtracting one single bit binary digit from another single bit binary digit.The truth table of Half Subtractor is shown below.

Like Adders Here also we need to calculate the equation of Difference and Borrow for more details please read What is meant by Arithmetic Circuits? Difference = A'B+AB'=A Borrow=A'B

B

The logic Diagram of Half Subtractor is shown below.

Full Subtractor : A logic Circuit Which is used for Subtracting Three Single bit Binary digit is known as Full Subtractor.The Truth Table of Full Subtractor is Shown Below.

From the Truth Table The Difference and Borrow will written as Difference=A'B'C+A'BB'+AB'C'+ABC Reduce it like adder Then We got Difference=A

B

C

Borrow=A'B'C+A'BC'+A'BC+ABC =A'B'C+A'BC'+A'BC+A'BC+A'BC+ABC ----------> A'BC=A'BC+A'BC+A'BC =A'C(B'+B)+A'B(C'+C)+BC(A'+A) Borrow=A'C+A'B+BC The logic diagram of Full Subtractor is Shown below

Digital logic: Digital logic gate is an electronic component which results in a particular output after implementing its logic on the input signals. These serve as the basic building blocks of any digital system irrespective of its complexity. Digital logic gates (Figure 1) can be categorized into two types. Basic Gates NOT gate has one input and one output, where the output will always be the inversion (i.e. negation) of the input. This means that if the input is zero, then output will be one and vice-versa. AND gate can have multiple inputs, while its output is restricted to be a single one. Here the output will be high only if all the inputs are high; for any other case the output will be low. OR gate is a multi-input, single-output gate which has its output equal to logic 'zero' when all the inputs to the gate are low. Further for all other remaining combination of inputs, where in at least one of the inputs will be high, the output will be logically high. OR gate performs logical or operation which means outputs is logical 1 if at least one of the inputs is 1. Just like AND gate an OR gate may also have two or any more numbers of inputs but only one output. Only if all of the inputs are only in low state or

logical 0 the output is low or 0 and in all other inputs conditions the output will be high or logical 1.The logical symbol of OR gate is shown below,

Truth Table of OR Gate From above explanation the truth table of logical OR gate can be represented as,

In digital electronics there are several logical gates which work or operate on different logical operations, say logical addition, logical multiplication etc. AND Gate is a logical gate which is widely used having two or more inputs and a single output. This gate works or operates on logical multiplication rules. In this gate if either of the inputs is low (0), then the output is also low, but if all the inputs are high (1) the output will also be high (1). There are many integrated circuit which works on this logic we will come to it later. First of all let us gather some idea how output with respect to inputs is observed in case of AND Gate. We just told that an AND gate

performs multiplication operation of binary digits. We also know there are two binary digits 1 and 0. In multiplying 0 with 0 we will get 0, 1 with 0 or 0 with 1 we will get 0. Only we get 1 when 1 is multiplied by 1. In other words, an AND gate is a digital device which produces high output only when all inputs are high and produces low output at all other inputs conditions. High digital signal means logically 1 and low digital signal means logically 0. An AND gate may have any number of input probes but only one output probe.

NOT gate is a logical gate which only inverts the input digital signal. This is why, a NOT gate sometimes is referred as inverter. A NOT gate always have high or logical 1 output when its input is low or logical 0. On the other hand a logical NOT gate always have low or logical 0 output when input is high or logical 1. The logical symbol of a NOT gate is shown

below, If the input binary variable of a NOT gate is considered as A, then the output binary variable of the gate will be Ā. As the symbol of not operation is ( - ) bar. If the value of A is 1. then Ā = 0 and in opposite if the value of A is then Ā = 1. The truth table of a NOT gate hence can be represented as,

X OR Gate and X NOR Gate

Modulo sum of two variables in binary system is like this, The gate performs this modulo sum operation without including carry is known as X OR gate. An X OR gate is normally two inputs logic gate where, output is only logical 1 when only one input is logical 1. When both inputs are equal, that is either both are 1 or both are 0, the output will be logical 0. This is the reason an X OR gate also called anti-coincidence gate or inequality detector. This gate is called as X OR or exclusive OR gate because, its output is only 1 when one of its input is exclusively 1. The truth table of X OR gate is given below,

The binary operation of above truth table is known as exclusive OR operation and it is represented as, A ⊕ B. The symbol of exclusive OR operation is represented by a plus ring surrounded by a circle ⊕.

NOR Gate NOR gate means NOT OR gate. In a NOR gate an OR gate is inverted through a NOT gate. Actually an inverted OR operation is NOR operation and the logic gate performs this operation is called NOR gate. A NOT gate followed by an OR gate makes a NOR gate. The basic logic construction

of

the

NOR

gate

is

shown

below,

The symbol of OR gate is similar to OR gate but one bubble is drawn at the output point of the OR gate in the case of OR gate. NOR gate means not an OR gate which means output of this gate is just reverse of that of a similar OR gate. We know that output an OR gate is 0 only when all inputs of OR gate is 0. But in the case of NOR gate the output is 1 only when all inputs are 0. In all other cases, that is for all other combinations of inputs the output is 0. Hence, the truth table of a NOR gate is shown below,

It is Like OR gate, NOR gate may also have more than two inputs. A NOR gate is also referred as universal gate. Because all binary operations can be realized by only using NOR gates. As we know that there are only three basic operations AND, OR and NOT. Also we know that all complex binary operations can be realized by using these three basic operations. If we can prove that AND, OR and NOT operations can be realized by using only NOR gate, then we can easily say that all binary operations can be realized by using only NOR gates.

Points to remember: A number system of base (also called radix) r is a system, which have r distinct symbols for r digits Representation of units tens,hundreds,thousands etc are called weights. The integer part and the fractional part in a decimal number system are seperated by a decimal point. A 4- bit binary word is called as a Nibble. A 8- bit binary word is called as a byte. A 16- bit binary word is called as a word. A 32- bit binary word is called as a double word. BCD or Binary Coded Decimal is that number system or code which has the binary numbers or digits to represent a decimal number....


Similar Free PDFs