0% found this document useful (0 votes)
8 views24 pages

Chapter 6.1

Digital logic design Chapter 6 PPT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views24 pages

Chapter 6.1

Digital logic design Chapter 6 PPT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Chapter 6 :

FUNCTIONS OF COMBINATIONAL LOGIC


 Basic Adders
Comparators
Encoders
Decoders
 Multiplexers (Data Selector)
 Demultiplexers

1
Binary Arithmetic
1) Binary Addition (+)
2) Binary Subtraction (-)
3) Binary Multiplication (x)
4) Binary Division (/)
1) Binary Addition (+)
The four basic rules for adding binary digits (bits) are as follows
0+0= 0
0+1= 1
1+0= 1
1 + 1 = 10 (with a carry of 1)

2
2) Binary Subtraction (-)
• The four basic rules for subtracting binary digits (bits) are as
follows :
0-0=0
1-1=0
1-0=1
10 - 1 = 1 -> 0-1 with a borrow of 1
• Example :

111 (7) 10100 (20) 11110 (30)


- 101 (5) - 10000 (16) - 01111 (15)
010 (2) 00100 ( 4) 01111 (15)

3
3) Binary Multiplication (x)
• The four basic rules for multiplying binary digits (bits) are as follows
:
0x0=0
0x1=0
1x0=0
1x1=1
• Example :

11 (3) 111 (7)


x 11 (3) X 101 (5)
11 111
+ 11
000
1001 (9)
+ 111
100011 (35)

4
4) Binary Division (/)
• Division in binary = Division in decimal
• Example :
a) 110 / 11

Signed Number
• Signed binary number consist of sign and magnitude information.
• Sign Bit = left most bit in signed binary number.
= indicate number is positive (0) or negative (1).
• a) Sign-Magnitude form
• For example :
• +25 (8-bit signed number) = 00011001
• -25 (8-bit signed number) = 10011001

• In the sign-magnitude form, negative number has the same


magnitude bits as the corresponding positive number but the
sign bit is a 1 rather than a zero 5
1’s and 2’s Complements of Binary Number
 Finding the 1’s Complement of a Binary Number
 Changing all 1 to 0 and all 0 to 1.

 Ex : 1011 0010 (binary number)

 0100 1101 (1’s Complement form)


 Finding the 2’s Complement of a Binary Number
 2’s Complement = (1’s Complement) + 1

 Ex : Find the 2’s Complement of 1011 0010


1011 0010 (Binary Number)
0100 1101 (1’s Complement)
+ 1
0100 1110 (2’s Complement) 6
Arithmetic Operation with Signed Numbers

 a) Addition

 Both number positive


0000 0111 7
+ 0000 0100 + 4
0000 1011 11

 Positive number with larger than negative number


0000 1111 15
+ 1111 1010 + -6
1 0000 1001 9
Discard carry

7
Negative number with magnitude larger than positive number
0001 0000 16
+ 1110 1000 + -24
1111 1000 - 8

Both numbers negative


1111 1011 -5
+ 1111 0111 + -9
1 1111 0010 -14

Discard carry

Subtraction
 The sign of a positive or negative binary number is changed by taking its 2’s
complement.
Example :
8-3 = 8+(-3) = 5
0000 1000 (+8)
+ 1111 1101 (2’s complement of -3)
1 0000 0101 (Difference (+5)
8
 Multiplication
 The numbers in multiplication are the multiplicand and
multiplier
 Example : 8 (Multiplicand)
X 3 (Multiplier)
24 (Product)
 Two basic methods for multiplication

 A) Direct Addition.
 Add the multiplicand a number of times equal to the
multiplier
 B) Partial Product (If multiplier is a large number)
 The multiplicand is multiplied by each multiplier digit
beginning with the least significant digit.
 If the signs are the same, the product is positive

 If the signs are different, the product is negative

9
Basic Adder

• Basic adder operation is fundamental to the


study of digital system.
• Types of basic adder:
a) Half Adder
b) Full Adder
• Basic rules for binary addition
0+0= 0
0+1= 1
1+0= 1
1+1=10
10
Half Adder
An adder is a digital circuit that performs addition of
numbers.
Half adder has only two inputs and two outputs.
The XOR is applied to both inputs to produce sum and AND
gate is applied to both inputs to produce carry.
Half adder is a simple combinational circuit used to add two
single bits.
It accepts two inputs and produce two outputs that is a sum
output and a carry output.
A half adder consists of two logic gates 1) XOR and 2)
AND gate. And the carry operation performed by AND gate
thus carryout put will be A+B.
11
a) Half Adder
 Accepts two binary digits on its inputs and produces two
binary digits on its outputs, a sum bit and a carry bit

S
A S Sum
Half adder
Input bits Output bits Logic
B Cout
Carry
Symbol

 Cout = AB
 Output carry is 1 only when A and B are 1s.

 S =A + B

 Sum output is a 1, if A and B are not equal.


12
a) Half Adder
 Half adder Truth Table

A B Cout S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0

 Half adder Logic Diagram

13
B. FULL ADDER
The full adder adds 3 one bit numbers, where two can be referred to as
operands and one can be referred to as bit carried in.
It produces 2-bit output and these can be referred to as output carry and
sum.
The full-adder has three inputs and two outputs.
The first two inputs are A and B and the third input is an input carry as C-
IN.
When a full-adder logic is designed, you string eight of them together to
create a byte-wide adder and cascade the carry bit from one adder to the
next.
A full adder is a digital circuit that performs addition.
Full adders are implemented with logic gates in hardware.
A full adder adds three one-bit binary numbers, two operands and a carry
bit. The adder outputs two numbers, a sum and a carry bit.
14
 The Boolean expression for a full adder is as follows.
 For the CARRY-OUT (Cout) bit: CARRY-OUT = A AND B ORCin(A
XOR B) = A.B + Cin(A ⊕ B)
 Accepts two input bits and an input carry and generates a sum
output and an output carry.
S
A S Sum
Full adder
B Logic
Cout Output Carry
Input Carry Cin Symbol

 . A B Cin Cout
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0 Full adder
1 0 0 0 1 Truth Table
1 0 1 1 0
1 1 0 1 0
15
1 1 1 1 1
Comparators
 Compares two n-bit binary values to determine which
one is larger.
 Inputs : 2 single-bit inputs (X and Y).
 Outputs : 3 lines: X>Y, X=Y, X<Y.

16
Basic comparator operation. Equality

Logic diagram for equality comparison of two 2-bit numbers.

17
Example

Logic symbol for a 4-bit comparator with inequality indication.

Compare B3 and A3 first,


if TRUE then immediately set,
If NOT check B2 and A2 ….

18
Decoders
 A decoder is a combinational circuit that converts binary information
from n input lines to a maximum of 2n unique output lines.
 Function – detect the presence of a specified combination of bits
(code) on its inputs and to indicate the presence of that code by a
specified output level.
 Decoder has n input lines to handle n bits and from one to 2n output
lines to indicate the presence of one or more n-bit combinations.
 Output is 1 if its label matches input

19
Encoders
• Encoder does the opposite from decoder
• Encoder accepts an active level on one of its inputs representing a
digit, such as a decimal or octal digit and converts it to a coded output,
such as BCD or binary.
• An encoder is a device, circuit, software program, algorithm or person
that converts information from one format or code to another.
• The purpose of encoder is standardization, speed, secrecy, security, or
saving space by shrinking size. If a device output code has fewer bits
than the input code has, the device is usually called an encoder.
• Encoder can also be devised to encode various symbols and alphabetic
characters.
Decimal-to-BCD encoder

20
Multiplexer
Multiplexer means many to one.
MUX is a combinational circuit which is often used when the
information from many sources must be transmitted over long
distances and it is less expensive to multiplex data onto a single wire
for transmission.
Multiplexer can be considered as multi-position or rotary switch as
n – inputs and one output.
The switch position is controlled by the selector lines. The select
inputs decide which input is connected to the output.
A list of popular applications is given below.
1. Data routing 2. Data bussing
3. Switch setting comparator 4. Multiplexer as a function generator
5. Parallel to serial converter 6. Cable TV signal distribution
7. Telephone network 8. Sharing printer /resources
21
Demultiplexer
Demultiplexer has a single input and n output lines.
Demultiplexer can be visualized as reverse multi-position
switch.
The select lines permit input data from single line to be
switched to any one of the many output lines.
Applications of Demultiplexers
1.Data demultiplexing 2.Clock demultiplexing
3.Memory addressing 4.Four phase clock generator
5.Function generation using DMUX 6.Switch encoding
7.Serial to parallel converter

22
Multiplexers is called Data Selectors
A demultiplexer is also called a data distributor.

23
24

You might also like