Anda di halaman 1dari 38

Types of Digital Logic Circuits:

* Combinational (or Combinatorial )


* Sequential
Combinational Circuit:
* Consists of logic gates whose outputs at any time are
determined by the present combination of inputs
* Performs an operation specified logically by a set of
Boolean functions
* Has input variables, logic gates, and output variables
* Logic gates accept signals from inputs and generate
signals to outputs
Aloke Dutta/EE/IIT Kanpur 1
* Transforms binary informa- n i/ps
Combinational
tion from given input data Circuit
m o/ps
to required output data
* For n i /p variables, 2 n possible binary i /p combinations
* For each possible i /p combination, there is one possible
o /p value
 Can be represented by a Truth Table
 Can also be described by m Boolean functions, one
for each o/p variable
 Each o /p function is expressed in terms of n i /p
variables
Aloke Dutta/EE/IIT Kanpur 2
* Examples:
 Adders
 Subtractors
 Multipliers
 Comparators
 Decoders
 Encoders
 Multiplexers (MUX )
 De-Multiplexers (De -MUX )

Aloke Dutta/EE/IIT Kanpur 3


Sequential Circuit:
* Employ storage elements in addition to logic
gates
* O/ps function of i/ps and state of these storage
elements
* State of storage elements function of previous
i /ps
* O /ps depend not only on present values of
i /ps, but also on past i /ps
* Circuit behavior must be specified by a time
sequence of i /ps and internal states
Aloke Dutta/EE/IIT Kanpur 4
How to identify a Combinational Circuit ?
* Would have only logic gates with no
feedback paths or memory elements
* Feedback paths immediately denote
sequential circuits

Aloke Dutta/EE/IIT Kanpur 5


Adder:
* 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, 1 + 1 = 10
* First three cases have sums of 0 or 1, but no
carry (or 0 carry )
* Fourth case has a carry of 1, which should be
added to the next 2 significant bits
* Simple addition of 2 bits  Half Adder (HA)
* Addition of 3 bits ( 2 significant bits and 1 carry )
 Full Adder (FA)
* Note: 2 HAs can be used to implement a FA

Aloke Dutta/EE/IIT Kanpur 6


Half Adder (HA):
* 2 binary i /ps and 2 binary o /ps [Sum (S) and
Carry (C)]
* Thus, 0 + 0 = 0 (S) and 0 (C), 0 + 1 = 1 (S) and 0 (C),
1 + 0 = 1 (S) and 0 (C), 1 + 1 = 0 (S) and 1 (C)
* Thus, it can be clearly seen that for i/ps X and Y:
S = X  Y = XY +XY, and C = XY
X
S
Y

Aloke Dutta/EE/IIT Kanpur 7


Full Adder (FA):
* Arithmetic sum of 3 bits: 3 i /ps (X, X Y Cin S Cout
Y, and Cin ) and 2 o /ps (S and Cout ) 0 0 0 0 0
YCin 0 0 1 1 0
X 00 01 11 10
0 1 0 1 0
0
0
0
1
1
3
0
2
1 K-Map for S
4 5 7 6
S = XYCin + XYCin 0 1 1 0 1
1 1 0 1 0 + XYCin + XYCin
1 0 0 1 0
YCin
X 00 01 11 10 1 0 1 0 1
0
0
0
1
0
3
1
2
0 K-Map for Cout 1 1 0 0 1
Cout = XCin + XY
1
4
0
5
1
7
1
6
1 + YCin 1 1 1 1 1

Aloke Dutta/EE/IIT Kanpur 8


Optimization:
* Note: S = XYCin + XYCin + XYCin + XYCin
= Cin (XY + XY) + Cin (XY + XY)
= Cin (X  Y)  Cin (X  Y)
= Cin  (X  Y)
YCin
X 00 01 11 10 * Alternate K-map for Cout yields:
Cout = XYCin + XYCin + XY
0 1 3 2
0 0 0 1 0

= Cin (XY + XY) + XY


4 5 7 6
1 0 1 1 1

= Cin (X  Y) + XY

Aloke Dutta/EE/IIT Kanpur 9


Implementation:

Half Adder
Half Adder
X

Y S
Cin

Cout

* S = Cin  (X  Y) and Cout = Cin (X  Y) + XY


* Note: A Full Adder can be constructed using
two Half Adders and an OR gate
Aloke Dutta/EE/IIT Kanpur 10
Binary Adder:
* Performs arithmetic sum of two binary numbers
(B3 B2 B1B0 and A 3 A 2 A1A 0 ) and provides Sum
(S3S2S1S0 ) and Carry Out (C4 )

MSB MSB LSB LSB


B3 A3 B2 A2 B1 A1 B0 A0

C3 C2 C1
FA4 FA3 FA2 FA1
C4 C0 = 0
(Carry In)

S3 S2 S1 S0
(MSB) (LSB)
4-Bit Adder
Aloke Dutta/EE/IIT Kanpur 11
* FAs connected in cascade, with the o/p carry
from each FA connected to the i/p carry of the
next FA
* Also known as Ripple Carry Adder
* Limitation: Gate Delay :
 S0 and C1 generated first, then S1 and C 2 , then
S2 and C3 , and finally S3 and C4
 Thus, all o/ps will be valid only after 4
gate delays
 This is known as the Carry Propagation
Problem
Aloke Dutta/EE/IIT Kanpur 12
Binary Subtractor:
* Recall: Subtraction is equivalent to adding two
numbers, with the number to be subtracted
expressed in 2's complement notation
* 2's complement: Invert all bits and add 1 to LSB
MSB MSB LSB LSB
B3 A3 B2 A2 B1 A1 B0 A0

C3 C2 C1
FA4 FA3 FA2 FA1
C4 C0 = 1
(Ignored) (Adding 1
to LSB)
S3 S2 S1 S0
(MSB) (LSB)
4-Bit Subtractor (Subtracting B3B2B1B0 from A3A2A1A0)
Aloke Dutta/EE/IIT Kanpur 13
Binary Adder /Subtractor:
* Uses a Control Signal M ( = 0 for Adder and = 1
for Subtractor ) (Note: 1  B = B, 0  B = B)
B3 B2 B1 B0
Control
Signal (M)

A3 A2 A1 A0

C3 C2 C1
FA4 FA3 FA2 FA1
C4

S3 S2 S1 S0

4-Bit Adder/Subtractor (M = 0: Adder, M = 1: Subtractor)


Aloke Dutta/EE/IIT Kanpur 14
Binary Multiplier:
* Note: Multiplication is an AND operation, i.e., the
product will be 1 only if both the bits are 1
* Example: B1B0 multiplied by A1A 0
B1 B0 * S0 = (A 0 AND B0 )
A1 A0 * S1 = (A 0 AND B1 ) ADD
A 0 B1 A 0 B0 (A1 AND B0 )  can be
A1B1 A1B0 implemented using an
S3 S2 S1 S0 Half Adder (HA)

Aloke Dutta/EE/IIT Kanpur 15


* S2 = (A1 AND B1 ) ADD (Any Carry of S1 )
* S3 = Carry of S2  S2 and S3 can be implemented
by using another HA
Implementation:
A1 B1 A1 B0 A0 B1 A0 B0

S0
HA HA

Carry
S Carry S1
(S3) 2

Aloke Dutta/EE/IIT Kanpur 16


Magnitude Comparator:
* Compares 2 bits A and B, and produces 3 outputs
(f1 , f 2 , and f 3 respectively) depending on whether:
i) A < B, ii) A = B, or iii) A > B

i) A < B ii) A = B iii) A > B


B B B
0 1 0 1 0 1
A A A
0 0 1 0 1 0 0 0 0

1 0 0 1 0 1 1 1 0

f1 = AB f2 = (AB) f3 = AB

A A A
f1 f2 f3
B B B

Aloke Dutta/EE/IIT Kanpur 17


Decoder:
* Note: Binary code of n bits is capable of
representing 2 n coded information
* Decoder is a combinational circuit that
converts binary information from n i /p
lines to 2 n o /p lines
* May have fewer than 2 n o /ps, if some of
the combinations are unused
* Called n-to-m Line Decoder, where m  2 n

Aloke Dutta/EE/IIT Kanpur 18


* Example: 3-to-8 Line Decoder, where for
inputs XYZ (X = MSB, Z = LSB), one of the
output lines D0 -D7 will go high in sequence
 XYZ = 000, D0 = 1, D1 -D7 = 0
 XYZ = 001, D1 = 1, D 0 and D 2 -D 7 = 0

 XYZ = 111, D7 = 1, D 0 -D 6 = 0
* Sometimes, uses Enable (E) signal: For E = 0,
all o /ps are disabled (0), while for E = 1, the
decoder circuit is enabled

Aloke Dutta/EE/IIT Kanpur 19


D0 Positive Logic:
X
D1
(MSB)
3-to-8 D2 E = 0 (Disable): all D lines 0
Y Line D3
Decoder D4
Z E = 1 (Enable): depending
D5
(LSB)
D6 on X, Y, and Z, only one of
D7 the D lines will go high

E
(Enable)

X X
Y Y
D2 D5
Z Z
E=1 E=1

Aloke Dutta/EE/IIT Kanpur 20


2 -to-4 Line Decoder Using NAND Gates:
* Uses negative logic (E = 0 enables the decoder ,
while E = 1 disables it )
* The selected D line goes low under this case
* Recall: NAND gate o /p is 0 if and only if all
the inputs are 1 : If any of the i /ps is 0, o /p is 1
* Since E = 0 enables the circuit, it is also known
as Active-Low Enable Circuit

Aloke Dutta/EE/IIT Kanpur 21


Truth Table:
A
B D0 E A B D0 D1 D2 D3
1 X X 1 1 1 1
A
B D1 0 0 0 0 1 1 1
0 0 1 1 0 1 1
A
B D2 0 1 0 1 1 0 1
0 1 1 1 1 1 0
A
B D3

* The first row corresponds to


disabled decoder with all output
E lines high (i /ps DON'T CARE)
Aloke Dutta/EE/IIT Kanpur 22
Constructing Large Decoders:
Example: Construction of a 4-to-16 Line Decoder
using two 3-to-8 Line Decoders:
X
3-to-8
Y D0 to D7
Decoder
Z (LSB)
E
W (MSB)

3-to-8
D8 to D15
Decoder

Uses positive logic: When W = 0, top decoder enabled and bottom


decoder disabled: Outputs D0 to D7 correspond to XYZ = 000 to
111; and when W = 1, top decoder disabled and bottom decoder
enabled: Outputs D8 to D15 correspond to WXYZ = 1000 to 1111
(One of the o/p lines D0-D15 goes high depending on WXYZ)
Aloke Dutta/EE/IIT Kanpur 23
Combinational Logic Implementation Using Decoders:
Example: Full Adder:
BCin
A B Cin S Cout A 00 01 11 10
0 1 3 2
0 0 1 0 1
0 0 0 0 0
4 5 7 6
1 1 0 1 0
0 0 1 1 0
0 1 0 1 0 S = m(1,2,4,7)

0 1 1 0 1
BCin
1 0 0 1 0 A 00 01 11 10
0 1 3 2

1 0 1 0 1 0 0 0 1 0
4 5 7 6
1 0 1 1 1
1 1 0 0 1
1 1 1 1 1 Cout = m(3,5,6,7)

Aloke Dutta/EE/IIT Kanpur 24


0 Unused

1
A
S
2

3
3-to-8
B
Decoder
4
Cout
5
Cin
6

Full Adder Using 3-to-8 Line Decoder


(May or may not have Enable signal)

Aloke Dutta/EE/IIT Kanpur 25


Encoder:
* Performs inverse operation of a Decoder
* Has 2 n or fewer i /p lines, and n o /p lines
* O /p lines generate binary code corresponding
to i /p values
* Only one i /p should be high, and corresponding
to that i /p, only one particular o /p combination
will be generated
* Uses Active High logic
* May or may not have Enable signal
* Anomaly: When all o /ps are 0, it may be due to
either the least significant i /p is 1, or all i /ps 0
Aloke Dutta/EE/IIT Kanpur 26
Example: Octal -to-Binary Encoder:
* Has eight i /ps (I7 -I 0 ) and three o /ps (O2 -O0 )
I7 I6 I5 I4 I3 I2 I1 I0 O2 O1 O0
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 1 0 0 0 1 0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0 1 0 1
0 1 0 0 0 0 0 0 1 1 0
1 0 0 0 0 0 0 0 1 1 1
Aloke Dutta/EE/IIT Kanpur 27
* From the Truth Table: O 0 = I1 + I3 + I5 + I7 ,
O1 = I 2 + I3 + I6 + I 7 , and O 2 = I 4 + I5 + I 6 + I7
* Implementation:
I7
I6
O2
I5
I4

I0: Not Used


Note: O2-O0 all are 0, either
O1
for I0 = 1, or all i/ps 0 I3
I2
 Anomaly

O0
I1

Aloke Dutta/EE/IIT Kanpur 28


Mutiplexer (MUX) and De -Multiplexer (De -MUX):
* MUX: Many -to-1, and De-MUX: 1-to-Many

X0 0

X1 1

X2 2
o/p Line
X3 3
N-Bit
N-Bit Data
Address
X4 Address 4
. .
. .
XN–1 N–1
Data o/p Lines

MUX De-MUX

Aloke Dutta/EE/IIT Kanpur 29


Multiplexer (MUX ):
* Also known as Data Selector
* Selects binary information from one of many i /p
lines and directs it to a single o /p
* Needs Selection Lines to select which i /p goes to o /p
* 2 n i /p lines and n Selection Lines
* Example: 2-to-1 Line MUX:
I0

I0
2-to-1 S S = 0: I0 gets selected
Y Y
MUX S = 1: I1 gets selected
I1 I1

S
S

Aloke Dutta/EE/IIT Kanpur 30


Boolean Function Implementation Using MUX :
* If proper i/ps can be routed to the o/p, then a
MUX can implement Boolean functions
* Individual minterms can be selected by data
i /ps
* A Boolean function having n variables can be
implemented with a MUX having (n  1)
Selection i /ps

Aloke Dutta/EE/IIT Kanpur 31


* The first (n  1) variables of the function are
connected to the Selection i /ps of the MUX
* The remaining single variable of the function
is used for the data i /ps
* If the single varible is denoted by Z, then the
data i /ps of the MUX would be Z, Z, 1, or 0

Aloke Dutta/EE/IIT Kanpur 32


Example : F(X,Y, Z) =  m  1,2,6,7 :
MSB LSB
X Y Z F Z 0
Z 1 4-to-1
F
0 0 0 0 0 2 MUX
1 3
S0
0 0 1 1 F=Z S1

0 1 0 1
X Y
0 1 1 0 F = Z
1 0 0 0 Exercise: Implement
1 0 1 0 F=0 F(A,B,C,D) =
1 1 0 1 M  0, 2, 4,5,9,13,15 
1 1 1 1 F=1 using an 8-to-1 MUX
Aloke Dutta/EE/IIT Kanpur 33
De -Multiplexer (De -MUX ):
* Also known as Data Router
* Selects binary information from one i /p line
and routes it to one of many o /p lines
* Needs Selection lines to select the o /p line to
which the i /p gets routed
* 2 n o /p lines and n selection lines
*  Decoder + Enable   De-MUX

Data S
E = 1: S = 0 (Disabled)
Enable (E) E = 0: S = Data

Aloke Dutta/EE/IIT Kanpur 34


Example : 1-to-4 De -MUX :
S1 S0 I goes to
0 0 O0 O0

0 1 O1 S1

1 0 O2
O1
1 1 O3 S0

0 O0
O2
1 O1 I
I 1-to-4 Output
input De-MUX Lines
2 O2

3 O3 O3

S1 S0
Select Lines
Aloke Dutta/EE/IIT Kanpur 35
Higher -Order De -MUX :
1-to-8
D0-D7
* Construction of a De-MUX

1-to-32 De-MUX C B A

using 1-to-4 and 1-to-8


Trunk De-MUX
D8-D15
1-to-8 De-MUX ED=00
ED=01
Data 1-to-4
* Trunk and Branches De-MUX
ED=10 C B A
ED=11
Architecture 1-to-8
D16-D23
E D De-MUX
* Control Signal: EDCBA
C B A
(E: MSB, A: LSB)
* 1-to-4 De -MUX controls the 2 most 1-to-8
D24-D31
De-MUX
significant bits, 1-to-8 De -MUX
C B A
control the 3 least significant bits Branches
Aloke Dutta/EE/IIT Kanpur 36
Decoder as De -MUX & Vice -Versa:

* Use the i /p line (I) as the


0 O0
Enable (E) signal
1 O1 * Use the Select lines (S1 -S0 )
I 1-to-4 Output
input De-MUX Lines as the i /p lines of the decoder
2 O2

3 O3 * When I (or E) = 0, all o /ps 0


* When I (or E) = 1:
S1 S0
Select Lines  S1 S0 = 00, O0 = 1, all others 0
1-to-4 De-MUX as  S1 S0 = 01, O1 = 1, all others 0
2-to-4 Decoder
 S1 S0 = 10, O2 = 1, all others 0
 S1 S0 = 11, O3 = 1, all others 0
Aloke Dutta/EE/IIT Kanpur 37
* Use Enable (E) line
as the i /p line (I)
0 O0 * Use the i /ps (A and B)
A
2-to-4
1 O1
Output
as Select lines (S1 -S0 )
Decoder Lines
2 O2 * When E (or I) = 0, all o /ps 0
B
3 O3 * When E (or I) = 1:
 AB = 00, O0 = 1, all others 0
E
(Enable)  AB = 01, O1 = 1, all others 0
2-to-4 Decoder as
1-to-4 De-MUX
 AB = 10, O2 = 1, all others 0
 AB = 11, O3 = 1, all others 0

Aloke Dutta/EE/IIT Kanpur 38

Anda mungkin juga menyukai