Binary Adder & Subtractor – Construction, Types & Applications

Digital Binary Adder & Subtractor

What is Binary Adder ?

A digital binary adder is a digital device that adds two binary numbers and gives its sum in binary format.

The two numbers to be added are known as “Augand” and “Addend”. The first number in addition is occasionally referred as “Augand”.

Digital adders are mostly used in computer’s ALU (Arithmetic logic unit) to compute addition. Digital calculators use adders for athematic addition. Micro controllers use adders in arithmetic additions,PC (program counter) and timers etc. Every device that uses some kind of increment or arithmetic process contains adders.

The building block of digital adder is Half Adder. Half adders come together to form full adder.

We will briefly discuss them one by one.

Types of Binary Adder & Subtractor

  • Half Adder
  • Full Adder
  • 4 Bit Adder
  • Subtractor
  • Adder / Subtractor

We will discuss one by one as follow:

Half Adder

Half adder can add 2 single bit numbers.

Consider the two numbers A, B, and the output being “Sum” and “carry”.

Truth Table

The truth table of half adder is given below.

 

half adder truth table

Half Adder using Discrete Logic Gates

Sum

According to the truth table of half adder and the K-map, the SOP expression for “Sum” is:

Sum       =          A̅B + AB̅

Schematic for “Sum” using discrete logic gates is given below.

Schematic for “Sum” using discrete logic gates

The expression for “Sum” is same as XOR with input A and B so it can be replaced with a single XOR gate as shown below:

Sum       =       A XOR B

XOR gate

Carry

According to the truth table of half adder the SOP expression for “Carry” is:

Carry     =       AB

“Carry” is AND of input A,B as shown below.

Construction of Half Adder

Complete half adder is made by combining “sum” and “carry” schematic as shown in figure below;

Half adder

Half Adder using Universal Gates
Half Adder using NAND Gates

NAND gate is a Universal gate which means any kind of logic gate or function can be implemented with NAND gate.

SOP (Sum of products) expression can easily get implemented with NAND gates.

Sum

SOP expression for“Sum of half adder”.

Sum       =             A̅B + AB̅

(Sum)’    =            (A̅B + AB̅)’

(Sum)’    =            {(A̅B)’ & (AB̅)’}

(Sum)’    =            [ { (A &A)’&B}’ & {A &(B & B)’}’]

Sum       =            [ { (A &A)’&B}’ & {A &(B & B)’}’]’

This expression for “sum” can be implemented using NAND gates as shown below:

SOP expression for Sum of half adder using NAND Gate

Carry

SOP expression for “half adder’s carry” output is :

Carry     =             AB

(Carry)’  =             (AB)’

Carry     =             (AB)’’

In other word INVERT of NAND gate is AND gate, and schematic of “Carry” using NAND gate is given below.

Half adder

NOW we will combine these two schematics to make half adder using NAND gates.

half adder using NAND gates

Half Adder using NOR Gate

NOR gate is also a universal gate and POS (product of sums) expressions can easily be implemented using NOR gates.

Sum

According to half adder truth table, POS expression for the sum is:

Sum       =               (A̅+B̅) & (A+B)

(Sum)’    =             {(A̅+B̅) & (A+B)}’

(Sum)’    =             {(A̅+B̅)’ + (A+B)’}

Sum       =             {(A̅+B̅)’ + (A+B)’}’

Sum       =             [{(A+A)’+ (B+B)’}’ + (A+B)’]’

Schematic of “Sum” using NOR gates are given below:

Half Adder Schematic of “Sum” using NOR gates

Carry

Expression for “carry” is

Carry     =             AB

(Carry)’  =             (AB)’

(Carry)’  =             (A’+B’)

Carry     =             (A’+B’)’

Carry     =             {(A+A)’+(B+B)’}’

The schematic for “Carry” using NOR gates is given below:

Half adder Schematic using NOR Gates

Now if we combined these two schematics together it will form half adder using NOR gates.

half adder using NOR gates

Half adder can add only two 1-bit numbers and it cannot add the third number (carry) which comes from previous numbers addition which is why it is known as HALF ADDER.

It cannot be used for addition of more than 1-bit.

Full Adder

A full adder can add numbers with carry from previous additions.

It consists of 3 inputs. 2 inputs being “Augend” and “addend” and the third one is “carry in” from previous additions.

It has 2 output;“Sum” and Cout as carry out.

Consider 2 numbers A,B, and Cin as input and “sum”, Cout as output.

Truth Table

Truth table of full adder is given below;

full adder Truth Table

Sum

According to the truth table of a full adder, the SOP expression for “Sum” is:

Sum       =             C̅inA̅B + C̅inAB̅ + CinA̅B̅ + CinAB

Sum       =             C̅in(A̅B + AB̅) + Cin(A̅B̅ + AB)

Sum       =             C̅in(A XOR B) + Cin(A XNOR B)

Sum       =             C̅in(A XOR B) + Cin(A̅̅ X̅O̅R̅̅ B̅)

Sum       =             CinXOR (A XOR B)

Schematic Diagrams of Full Adders

According to this expression schematic for full adder’s Sum is.

According to Karnaugh’s map for Sum given below, there is no pair so the expression will be same and cannot be minimized;

Full Adder Karnaugh’s map for Sum

Carry out

Full Adder using truth table

According to the full adders truth table, SOP expression for Cout is

Cout              =             C̅inAB + CinA̅B + CinAB̅ + CinAB

Cout              =             C̅inAB + CinAB   + CinA̅B + CinAB̅

Cout              =             AB(C̅in + Cin)   + Cin(A̅B + AB̅)

Cout              =             AB + Cin(A XOR B)

Schematic for Cout is given below

Schematic for Cout using full adders truth table

Full Adder using Karnaugh Map

According to karnaugh’s map for C­out the expression will be:

karnaugh’s map for C­out

Cout              =           AB + CinB + CinA

Cout             =            AB + Cin(A+B)

Schematic for Cout using karnaugh map’s expression

Schematic for Cout using karnaugh map’s expression

The schematics of Full adder are shown in the figures below:

Full Adder using individual half adders

A full adder can be implemented using two half adders in cascaded setup.

A half adders output is:

HA_Sum                 =             (A XOR B)            =             A̅B + AB̅

HA_C                     =              AB

Half adder sum is denoted by HA_sum and carry out is denoted by HA_C

Full adder output expression is:

Sum                        =             CinXOR (A XOR B)

Sum                        =             CinXOR (HA_sum_1)                (HA_sum_1; sum of first half adder whose input is A,B)

Sum                        =             HA_sum_2                               (HA_sum_2; sum of second half adder whose input is HA_sum_1 and Cin)

Cout                        =             AB + Cin(A XOR B)

Cout                        =             AB + Cin(HA_sum_1)

Cout                        =             HA_C_1 + HA_C_2                   (HA_C_1; carry out of first adder whose input is A,B

 HA_C_2; carry out of the second adder whose input is Cin,HA_sum_1)

According to the equation of Sum and Cout. the schematic of a full adder using half adder is given below.

Full Adder using universal gates
Full Adder using NAND Gates

We have designed half adders using NAND gates.

We will use NAND gate half adder in the cascaded setup as discussed above.

Sum                              =             Sum of second half adder

Cout                                       =             HA_C_1 + HA_C_2

Cout                                     =             (HA_C_1 + HA_C_2)’

Cout                                     =             (HA_C_1)’ & (HA_C_2)’

Cout                                     =             {(HA_C_1)’ & (HA_C_2)’}’

In “NAND half adder carry out” schematic, “carry out” has been inverted at the end. We will bypass the inverter and feed it to NAND gate as shown in the expression above.

Full adder using NOR Gates

For NOR gate we will use NOR gate half adders.

Sum                        =             Sum of second half adder

Cout                        =             HA_C_1 + HA_C_2

Cout’                       =             (HA_C_1 + HA_C_2)’

Cout‘’                      =             (HA_C_1 + HA_C_2)’’

Thus the schematic for Full adder using NOR gate will be :

These full adders can be used for adding ‘n’ bit number sif ‘n’ number of full adders are connected in a cascaded setup with cout connected to the Cin of the next full adder.

4-bit Full adder

n’ bit adder can be made using ‘n’ full adders in series. This way, 4-bit adder can be made using 4 full adders.

Each full adder for separate bit addition and Cout of one adder will be fed to the succeeding adder’s Cin and the last Adder’s Cout will be the Cout of 4-bit adder.Each full adder will give single bit of Sum as output.

The Cin of the first Full adder will be hard wired to the ground (0).

4-bit Full adder

Digital Binary Subtractor

A combinational digital device capable of subtracting the second binary number forms the first one is called digital Subtractor.

First, we will discuss how subtraction works.

Consider two numbers A and B being subtracted.

OUT        =             A – B

OUT        =             A + (-B)

This equation means that these numbers are added together like in adder but the second number is negative of itself.

In Binary system the negative of a number is 2’s complement of that number.

To take 2’s complement of a number; first, we need to invert all the bits of that number this inversion is known as 1’s complement. And then add 1 with it as shown below.

                                          B              =             B3B2B1B0

1’s complement               B              =             B̅3210                     

2’s complement               B              =             B̅321 + 1

The MSB of signed number is sign bit. It is 1 for negative sign and 0 for positive,

Thus we need to invert the 2nd input of Adder and set Cinto “1” to get added in B for subtraction as shown in the figure below.

Digital Subtractor

We can use adder as subtractor if we make Cin input as a selector between addition and subtraction. And we use a multiplexer (input line selector) for the second input.

If Cin is low ”0” ; it will select B as input thus addition will occur.

If Cin is high ”1” ; it will select B̅ as input and Cin will get added in, thus subtraction will occur.

Digital Subtraction using 4-bit Full Adder

Schematic of Half and full Subtractor

Schematic of Half and full Subtractor and logical equation

Logical Equation for Half Adder and Full Adder.

D = A ⊕ B and W = Ā B

Adder and Subtractor

Simulation diagrams of Adder and Subtractor is given below.

Binary Adder IC Configuration & Pin out.

Some of Adder ICs with pin configuration is given below:

  • 4008 CMOS 4-BIT Binary Full Adder
  • 74283 TTL 4-BIT Binary  Full Adder

Applications of Adders and Subtractor

  • Adders & Subtractors are wildly used in in computer’s ALU (Arithmetic logic unit) to compute addition as well as CPU (Central Processing unit) and GPU (Graphics Processing unit) for graphics applications to reduce the circuit complexity.
  • Adder and subtractor are basically used for performing arithmetical functions like addition, subtraction, multiplication and division in electronic calculators and digital instruments.
  • Adders are used in digital calculators for arithmetic addition and devises that uses some kind of increment or arithmetic process
  • They are also used in microcontrollers for arithmetic additions, PC (program counter) and timers.
  • It is also used in processors to calculate address, tables and slimier operations
  • It is also used in networking and DSP (Digital signal processor) oriented system

You may also read:

The post Binary Adder & Subtractor – Construction, Types & Applications appeared first on Electrical Technology.



May 22, 2018 at 01:42AM by Department of EEE, ADBU: https://ift.tt/2AyIRVT

Binary Decoder – Construction, Types & Applications

Digital Binary Decoder – Types & Construction

What is Binary Decoder?

A digital combinational circuit used for converting “n” bits of binary number into a combination of “n” or less unique and separate output lines is called digital binary decoder. In simple words, Binary Decoder used to decode a Binary Codes.

There is an enable input which can enable and disable the whole circuit. Enable can be active high and active low. Active high; when enable input is high the decoder is enabled when its low the circuit is disabled. Active low; when enable input is low the decoder is enabled.

Digital Binary DecoderIt actually converts coded information in one format to another format. In other words, the data may be decoded by decoders same like data encoded by encoders in term of reverse operation. A decoder generates min-terms. Min-terms are products of the input, which means that decoder is made up of AND gate and NOT gates.  It can be designed with NAND gate considering the output of the decoder will be invert of AND gate decoder.

The quantity of AND gates used is equal to the number of output lines (min-terms). The NOT gate is used for inverting each input lines so the quantity of NOT gates depends on input lines.

Each minterm is associated with a unique set of binary inputs when that specific combination of binary input is applied to the decoder the concerned output is set to high or low depending on the gate(AND, NAND) used.

Types of Decoders

Some of the Line decoders are given below with details.

  • 2-to-4 Line Binary Decoder
  • 3-to-8 Line Decoder
  • 4-to-16 Line Decoder

Also read: Counter and Types of Electronic Counters

2 to 4 Line Decoder

This decoder has 2 input lines and 22 = 4 output lines. The input is in binary format so there will be 4 possible combinations of input and for each of these combinations, there is a separate output line which goes high or low when these inputs are applied. There is an active high enable input which can enable and disable the whole decoder.

 

2 to 4 line decoder

Construction of 2 to 4 Line Decoder using AND Gate

In this decoder, for a specific binary input combination, the specified output line gives “1” and all the other output lines become “0”. Schematic of 2 to 4 Line Decoder Using AND Gate is given below after truth table.

Truth Table

The truth table of 2 to 4 line decoder using AND gate is given below:

En is enable bit and A, B are input lines. D0 – D3 ­are output lines.

2 to 4 line decoder using AND gate truth table

According to the truth table of “2 to 4 line decoder”, the expression for output is

D0 = A̅B̅ = m­0,      D1 = A̅B = m1,      D2 = AB̅ = m2,      D3 = AB = m3

To implement these expression we need two NOT gates and 4 AND gates for each Min-term as shown in the figure below.2 to 4 line decoder the expression for output two NOT gates and 4 AND gates

As you can see, each of these outputs represents a min term m0, m1, m2, m3 which makes it easy to implement any Boolean function with 2 variables. En is applied to every AND gate whenever En = 0, all output lines will be 0.

Example:

Half Adder Implementation Using Decoder

Half adder Boolean function can be implemented with 2-4 line decoder.

Sum    =  A̅B + AB̅    =   ∑(m1+m2)

Carry  =  AB              =   m3

Thus the 2nd and 3rd output of decoder will be ORed (sum) to form Sum and the 4th output will be Carry as shown in the figure below.

Half adder implementation using decoder

Construction of 2 to 4 Line Decoder Using NAND Gates

NAND gate is invert of AND gate so using NAND gate instead of AND gate in decoder will invert the output of the decoder. For a specific combination of the input signal, a separate output line will give “0” instead of 1 and all other outputs will be “1”.

Truth Table

The truth table of 2-4 line decoder using NAND gate is given below. En is enable bit and A, B are input lines. D0-D3 ­are output lines.

truth table of 2-4 line decoder using NAND gate

According to the truth table the expression for output will be;

 D̅0 = A̅B̅,               D̅1 = A̅B,                D̅2 = AB̅,                D̅3 = AB

Implementation of these expression using NAND gates is shown in the figure below. 4 NAND gates and 2 NOT gates are used.

Binary Decoder expression for output using NAND gates

This decoder produces “0” on a separate output line, for a specific binary input combination.

3 to 8 Line Decoder

This decoder has 3 binary inputs and 8 output lines. 3 binary inputs mean there are 8 different combinations of inputs and for each combination of input, there is a separate output line to respond.

3 to 8 line decoder

It is also known as binary to octal decoder because it converts binary format into octal number where each output line represents a number in the octal system.

3 to 8 Line Decoder using AND Gates

For a specific input combination, a single output line goes “1” and all other outputs become “0”. Schematic diagram of 3 to 8 Line Decoder using AND Gates is given below right after truth table.

Truth Table

The truth table of 3 to 8 line decoder using AND gate is given below. En is enable bit and A, B, C are input lines. D0-D7 ­are output lines.

 

truth table of 3 to 8 line decoder using AND gate

According to the truth table, the output expression is:

D0 = A̅B̅C̅         D1 = A̅B̅C        D2 = A̅BC̅       D3 = A̅BC

D4 = AB̅C̅         D5 = AB̅C        D6 = ABC̅       D7 = ABC

These expressions can be implemented using 8 AND gates and 4 NOT gates as shown in the figure below.

binary decoder binary decoder expressions using 8 AND gates and 4 NOT gates

Each output represents a min-term and therefore it can be used to implement any Boolean function of 3 variables.

3 to 8 Line Decoder Using 2 to 4 Line Decoder

3 to 8 line decoder can be made with two 2 to 4 line decoder with enable inputs as shown in the figure below.

Making of 3 to 8 line decoder Using 2 to 4 line decoder

Enable En will be taken as the Input MSB, when En = 0, the upper decoder will be enabled and output D0-D3 will be generated based on the combination of input A, B. And when En = 1, then the lower decoder will turn on and output D4-D7 will be generated based on input A, B.

Implementation of Full Adder

A full adder can be implemented with a 3 to 8 line decoder. Full adder has 3 inputs Cin,A,B and 2 output Sum and Carry. The SOP expression for sum and carry is

Sum     =         C̅in A̅B + C̅in AB̅ + Cin A̅B̅ + Cin AB       =        ∑( m1 + m2 + m4 + m7 )

Carry    =         C̅in AB + Cin A̅B + Cin AB̅ + Cin AB       =        ∑( m3 + m5 + m6 + m7 )

Thus the specified min-terms (output) of the decoder will be ORed (sum) together to form Full adder as shown in the figure below:

Implementation of Full adder with a 3 to 8 line decoder

3 to 8 Line Decoder using NAND Gates

For a specific combination of 3-bit binary input, a single out of 8 output lines will give “0” and all other output lines will produce “1”.

Truth Table

The truth table of 3 to 8 line decoder using NAND gate is given below. E is enable bit and A, B, C are input lines. D0-D7 ­are output lines.

truth table of 3 to 8 line decoder using NAND gate

According to the truth table of 3 to 8 line decoder, the Boolean expression for is:

0 = A̅B̅C̅          D̅1 = A̅B̅C          D̅2 = A̅BC̅         D̅3 = A̅BC

4 = AB̅C̅          D̅5 = AB̅C          D̅6 = ABC̅         D̅7 = ABC

 These output expressions can be implemented using 8 NAND gates and 4 NOT gate as shown in the figure below.

binary decoder output expressions binary decoder implemented using 8 NAND gates and 4 NOT gate

Binary Decoder IC Configuration & Pinouts

This is NAND gate based IC. A single output line will give “0” on a unique binary input combination.

The inputs to the IC are C, B, A. Enable G̅L̅ is known as Latch-enable. When it goes from low to high it stores the input data and provides output corresponding to the stored input, ignoring the upcoming changes in the input data as long as G̅L̅ is high. When G̅L̅ is low then the input is not stored

The decoder will give output only and only when G̅2̅ and G1 are set LOW and HIGH respectively otherwise all output lines will be HIGH state “1”.

74137 TTL 3 to 8 Line Decoder with Pin Configurations

Digital Binary Decoder IC Details

Pin Configuration of IC 74137 TTL 3 to 8 line decoder.

Pin Number Configuration
1 Input  A, LSB
2 Input B
3 Input  C, MSB
4 Active LOW Enable, G̅L̅
5 Active LOW Enable, G̅2̅
6 Active HIGH Enable G1
7 Output Y7
8 GND
9 Output Y6
10 Output  Y5
11 Output Y4
12 Output Y3
13 Output Y2
14 Output Y1
15 Output Y0
16 Vcc, power supply

Applications of Binary Decoders

Binary decoders are widely used in digital electronics systems. Some common application and uses of decoders are as follow:

  • It is used as binary to decimal decoder.
  • It is used as address decoder in memory systems of computer and CPU memory location identifications..
  • It is also used as instruction decoder in the control unit of Central Processing unit (CPU).
  • They can also be used to make half adder and full adder.
  • Decoders are used in seven segment displays as well as data demultiplexing.

You may also read:

The post Binary Decoder – Construction, Types & Applications appeared first on Electrical Technology.



May 21, 2018 at 03:55AM by Department of EEE, ADBU: https://ift.tt/2AyIRVT