SlideShare a Scribd company logo
1 of 85
CSEN1051 - Digital Logic Circuits
UNIT – IV
COMBINATIONAL LOGIC
CIRCUITS
1
Syllabus
Design procedures,
Adders, Subtractors,
Multiplexers, Demultiplexers,
Encoders, Decoders, Priority encoder,
Code converters, seven segment display,
Magnitude comparator,
Decimal adder (BCD adder),
Binary Multiplier
2
Combinational Logic
• Logic circuits for digital systems may be combinational or sequential.
• A combinational circuit consists of input variables, logic gates, and
output variables.
• The logic circuit whose outputs at any instant of time entirely depend
upon the input signals present at that time are known as combinational
circuits. Hence a combinational circuit does not contain memory
elements.
3
BASIC LOGIC BLOCK - GATE
Types of Basic Logic Blocks
- Combinational Logic Block
Logic Blocks whose output logic value depends only on the input logic
values
- Sequential Logic Block
Logic Blocks whose output logic value depends on the input values and the
state (stored information) of the blocks
Functions of Gates can be described by
- Truth Table
- Boolean Function
.
.
Gate
.
Binary
Digital
Input
Signal
Binary
Digital
Output
Signal
COMBINATIONAL GATES
A
X X = (A + B)’
B
Name Symbol Function Truth Table
AND
A X = A • B
X or
B X = AB
0 0 0
0 1 0
1 0 0
1 1 1
0 0 0
0 1 1
1 0 1
1 1 1
OR
A
X X = A + B
B
I A X X = A’
0 1
1 0
Buffer A X X = A
A X
0 0
1 1
NAND
A
X X = (AB)’
B
0 0 1
0 1 1
1 0 1
1 1 0
NOR
0 0 1
0 1 0
1 0 0
1 1 0
XOR
Exclusive OR
A X = A  B
X or
B X = A’B + AB’
0 0 0
0 1 1
1 0 1
1 1 0
A X = (A  B)’
X or
B X = A’B’+ AB
0 0 1
0 1 0
1 0 0
1 1 1
XNOR
Exclusive NOR
or Equivalence
A B X
A B X
A X
A B X
A B X
A B X
A B X
LOGIC CIRCUIT DESIGN
x y z F
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
F = x + y’z
Boolean Algebra
x
y
z
F
Truth
Table
Boolean
Function
Logic
Diagram
Analysis Procedure
The analysis of a combinational circuit is the procedure by which
we can determine the output Boolean function and the truth table
of the circuit by using the following procedure.
1. Make sure that the given circuit is combinational circuit.
The combinational circuit has logic gates with no feedback
or memory elements.
2. Label all gate outputs that are a function of input variables
with arbitrary symbols and determine the Boolean
functions for each gate output.
3. Repeat the step 2 until the outputs of the circuit are
obtained.
4. Finally substituting previously defined Boolean functions,
obtain the output Boolean functions in terms of input
variables.
7
Example
F2 = AB + AC + BC; T1 = A + B + C; T2 = ABC; T3
= F2’T1;
F1 = T3 + T2
F1 = T3 + T2 = F2’T1 + ABC = A’BC’ + A’B’C + AB’C’ + ABC 8
Derive truth table from logic diagram
• We can derive the truth table in Table 4-1 by using the
circuit of Fig.4-2.
9
4-3. Design procedure
1. Table4-2 is a Code-Conversion example, first, we can
list the relation of the BCD and Excess-3 codes in the
truth table.
10
Karnaugh map
2. For each symbol of the Excess-3 code, we use 1’s to
draw the map for simplifying Boolean function.
11
Circuit implementation
z = D’; y = CD + C’D’ = CD + (C + D)’
x = B’C + B’D + BC’D’ = B’(C + D) + B(C + D)’
w = A + BC + BD = A + B(C + D)
12
4-4. Binary Adder-Subtractor
• A combinational circuit that performs the addition of two bits is
called a half adder.
• The truth table for the half adder is listed below:
S = x’y + xy’
C = xy
13
S: Sum
C: Carry
Implementation of Half-Adder
14
Full-Adder
• One that performs the addition of three bits(two
significant bits and a previous carry) is a full adder.
15
Simplified Expressions
S = x’y’z + x’yz’ + xy’z’ + xyz
C = xy + xz + yz
16
C
Full adder implemented in SOP
17
Another implementation
• Full-adder can also implemented with two half adders
and one OR gate (Carry Look-Ahead adder).
S = z ⊕ (x ⊕ y)
= z’(xy’ + x’y) + z(xy’ + x’y)’
= xy’z’ + x’yz’ + xyz + x’y’z
C = z(xy’ + x’y) + xy = xy’z + x’yz + xy
18
Subtractor
• A combinational circuit that performs the
subtractions of bits is called a Subtractor.
• There are two types of Subtractors.
1.Half Subtractor
2.Full Subtractor
19
Half Subtractor:
• A combinational circuit that performs the
subtraction of two bits is called Half
Subtractor. It receives two inputs and
produces two outputs Difference and Borrow.
The block diagram of the Half Subtractor is
given as
20
• Half Subtractor Truth Table:
21
22
23
• The logical diagram for the difference can
be obtained by using the exclusive OR-
Gate.
24
Full Subtractor:
• A combinational circuit that performs the
subtraction of three bits is called a Full
Subtractor. It receives three inputs and
produces two outputs Difference and Borrow.
The Block Diagram of the Full Subtractor is as
follows.
25
Full Subtractor Block Diagram:
26
27
Simplified Boolean Function of the Full
Subtractor:
28
Simplifying the above Boolean function by
using the Karnaugh Map K.Map
29
30
• Full Subtractor Logical Diagram:
31
Binary adder
• This is also called
Ripple Carry
Adder ,because of the
construction with full
adders are connected
in cascade.
32
Carry Propagation
• Fig.4-9 causes a unstable factor on carry bit, and produces a
longest propagation delay.
• The signal from Ci to the output carry Ci+1, propagates through an
AND and OR gates, so, for an n-bit RCA, there are 2n gate levels
for the carry to propagate from input to output.
33
Carry Propagation
• Because the propagation delay will affect the output signals on
different time, so the signals are given enough time to get the
precise and stable outputs.
• The most widely used technique employs the principle of carry
look-ahead to improve the speed of the algorithm.
34
Boolean functions
Pi = Ai ⊕ Bi steady state value
Gi = AiBi steady state value
Output sum and carry
Si = Pi ⊕ Ci
Ci+1 = Gi + PiCi
Gi : carry generate Pi : carry propagate
C0 = input carry
C1 = G0 + P0C0
C2 = G1 + P1C1 = G1 + P1G0 + P1P0C0
C3 = G2 + P2C2 = G2 + P2G1 + P2P1G0 + P2P1P0C0
• C3 does not have to wait for C2 and C1 to propagate.
35
Logic diagram of
carry look-ahead generator
• C3 is propagated at the same time as C2 and C1.
36
4-bit adder with carry lookahead
• Delay time of n-bit CLAA = XOR + (AND + OR) + XOR
37
Binary subtractor
M = 1subtractor ; M = 0adder
38
Overflow
• It is worth noting Fig.4-13 that binary numbers in the signed-
complement system are added and subtracted by the same basic
addition and subtraction rules as unsigned numbers.
• Overflow is a problem in digital computers because the number of
bits that hold the number is finite and a result that contains n+1
bits cannot be accommodated.
39
Overflow on signed and unsigned
• When two unsigned numbers are added, an overflow is detected
from the end carry out of the MSB position.
• When two signed numbers are added, the sign bit is treated as
part of the number and the end carry does not indicate an
overflow.
• An overflow cann’t occur after an addition if one number is
positive and the other is negative.
• An overflow may occur if the two numbers added are both
positive or both negative.
40
4-5 Decimal adder
BCD adder can’t exceed 9 on each input digit. K is the carry.
41
Rules of BCD adder
• When the binary sum is greater than 1001, we obtain a non-valid
BCD representation.
• The addition of binary 6(0110) to the binary sum converts it to
the correct BCD representation and also produces an output carry
as required.
• To distinguish them from binary 1000 and 1001, which also have a
1 in position Z8, we specify further that either Z4 or Z2 must have a
1.
C = K + Z8Z4 + Z8Z2
42
Implementation of BCD adder
• A decimal parallel
adder that adds n
decimal digits needs n
BCD adder stages.
• The output carry from
one stage must be
connected to the
input carry of the next
higher-order stage.
43
If =1
0110
4-6. Binary multiplier
• Usually there are more bits in the partial products and it is necessary to use full
adders to produce the sum of the partial products.
44
And
4-bit by 3-bit binary multiplier
• For J multiplier bits and K
multiplicand bits we need (J X
K) AND gates and (J − 1) K-bit
adders to produce a product
of J+K bits.
• K=4 and J=3, we need 12 AND
gates and two 4-bit adders.
45
4-7. Magnitude comparator
• The equality relation of each pair
of bits can be expressed logically
with an exclusive-NOR function as:
A = A3A2A1A0 ; B = B3B2B1B0
xi=AiBi+Ai’Bi’ for i = 0, 1, 2, 3
(A = B) = x3x2x1x0
46
Magnitude comparator
• We inspect the relative magnitudes
of pairs of MSB. If equal, we
compare the next lower significant
pair of digits until a pair of unequal
digits is reached.
• If the corresponding digit of A is 1
and that of B is 0, we conclude that
A>B.
(A>B)=
A3B’3+x3A2B’2+x3x2A1B’1+x3x2x1A0B’0
(A<B)=
A’3B3+x3A’2B2+x3x2A’1B1+x3x2x1A’0B0
47
4-8. Decoders
• The decoder is called n-to-m-line decoder, where
m≤2n
.
• the decoder is also used in conjunction with other
code converters such as a BCD-to-seven_segment
decoder.
• 3-to-8 line decoder: For each possible input
combination, there are seven outputs that are equal
to 0 and only one that is equal to 1.
48
Implementation and truth table
49
Decoder with enable input
• Some decoders are constructed with NAND gates, it becomes
more economical to generate the decoder minterms in their
complemented form.
• As indicated by the truth table , only one output can be equal to 0
at any given time, all other outputs are equal to 1.
50
Demultiplexer
• A decoder with an enable input is referred to as a
decoder/demultiplexer.
• The truth table of demultiplexer is the same with
decoder.
51
Demultiplexer
D0
D1
D2
D3
E
A B
3-to-8 decoder with enable implement the
4-to-16 decoder
52
Implementation of a Full Adder with a
Decoder
• From table 4-4, we obtain the functions for the combinational circuit in sum of
minterms:
S(x, y, z) = ∑(1, 2, 4, 7)
C(x, y, z) = ∑(3, 5, 6, 7)
53
4-9. Encoders
• An encoder is the inverse operation of a decoder.
• We can derive the Boolean functions by table 4-7
z = D1 + D3 + D5 + D7
y = D2 + D3 + D6 + D7
x = D4 + D5 + D6 + D7
54
Priority encoder
• If two inputs are active simultaneously, the output produces
an undefined combination. We can establish an input priority
to ensure that only one input is encoded.
• Another ambiguity in the octal-to-binary encoder is that an
output with all 0’s is generated when all the inputs are 0; the
output is the same as when D0 is equal to 1.
• The discrepancy tables on Table 4-7 and Table 4-8 can resolve
aforesaid condition by providing one more output to indicate
that at least one input is equal to 1.
55
Priority encoder
V=0no valid inputs
V=1valid inputs
X’s in output columns represent
don’t-care conditions
X’s in the input columns are
useful for representing a truth
table in condensed form.
Instead of listing all 16
minterms of four variables.
56
4-input priority encoder
• Implementation of
table 4-8
x = D2 + D3
y = D3 + D1D’2
V = D0 + D1 + D2 + D3
57
0
0
0
0
4-10. Multiplexers
S = 0, Y = I0 Truth Table S Y Y = S’I0 + SI1
S = 1, Y = I1 0 I0
1 I1
58
4-to-1 Line Multiplexer
59
Quadruple 2-to-1 Line Multiplexer
• Multiplexer circuits can be combined with common selection inputs to provide
multiple-bit selection logic. Compare with Fig4-24.
60
I0
I1
Y
Boolean function implementation
• A more efficient method for implementing a Boolean function of
n variables with a multiplexer that has n-1 selection inputs.
F(x, y, z) = (1,2,6,7)
61
4-input function with a multiplexer
F(A, B, C, D) = (1, 3, 4, 11, 12, 13, 14, 15)
62
Three-State Gates
• A multiplexer can be constructed with three-state gates.
63
4-11. HDL for combinational circuits
• A module can be described in any one of the
following modeling techniques:
1. Gate-level modeling using instantiation of primitive gates
and user-defined modules.
2. Dataflow modeling using continuous assignment statements
with keyword assign.
3. Behavioral modeling using procedural assignment
statements with keyword always.
64
Gate-level Modeling
• A circuit is specified by its logic gates and their interconnection.
• Verilog recognizes 12 basic gates as predefined primitives.
• The logic values of each gate may be 1, 0, x(unknown), z(high-impedance).
65
Gate-level description on Verilog code
The wire declaration is for internal connections.
66
• There are two basic types of design methodologies: top-down
and bottom-up.
• Top-down: the top-level block is defined and then the sub-
blocks necessary to build the top-level block are
identified.(Fig.4-9 binary adder)
• Bottom-up: the building blocks are first identified and then
combined to build the top-level block.(Example 4-2 4-bit adder)
67
Design methodologies
A bottom-up hierarchical description
68
Full-adder
69
4-bit adder
70
Three state gates
Gates statement: gate name(output, input, control)
>> bufif1(OUT, A, control);
A = OUT when control = 1, OUT = z when control = 0;
>> notif0(Y, B, enable);
Y = B’ when enable = 0, Y = z when enable = 1;
71
2-to-1 multiplexer
• HDL uses the keyword tri to
indicate that the output has
multiple drivers.
module muxtri (A, B, select, OUT);
input A,B,select;
output OUT;
tri OUT;
bufif1 (OUT,A,select);
bufif0 (OUT,B,select);
endmodule
72
Dataflow modeling
• It uses a number of operators that act on operands to produce
desired results. Verilog HDL provides about 30 operator types.
Table 4-10
Symbol Operation
+ binary addition
− binary subtraction
& bit-wise AND
| bit-wise OR
^ bit-wise XOR
~ bit-wise NOT
== equality
> greater than
< less than
{ } concatenation
?: conditional
73
Dataflow modeling
• A continuous assignment is a
statement that assigns a value
to a net.
• The data type net is used in
Verilog HDL to represent a
physical connection between
circuit elements.
• A net defines a gate output
declared by an output or wire.
74
Dataflow description of 4-bit adder
75
HDL Example 4-4
//Dataflow description of 4-bit adder
module binary_adder (A,B,Cin,SUM,Cout);
input [3:0] A,B;
input Cin;
output [3:0] SUM;
output Cout;
assign {Cout,SUM} = A + B +Cin;
endmodule
Data flow description of a 4-bit comparator
76
Dataflow description of 2-1 multiplexer
• Conditional operator( ? : )
• Condition? true-expression : false-expression;
77
Behavioral modeling
• It is used mostly to describe sequential circuits, but can be used
also to describe combinational circuits.
• Behavioral descriptions use the keyword always followed by a list
of procedural assignment statements.
• The target output of procedural assignment statements must be
of the reg data type. Contrary to the wire data type, where the
target output of an assignment may be continuously updated, a
reg data type retains its value until a new value is assigned.
78
Behavioral description of 2-1 multiplexer
79
4-to-1-line Multiplexer
80
Writing a simple test bench
• In addition to the always statement, test benches use the initial statement to
provide stimulus to the circuit under test.
• The always statement executes repeatedly in a loop. The initial statement
executes only once starting from simulation time=0 and may continue with any
operations that are delayed by a given number of time units as specified by the
symbol #.
For example:
initial
begin
A = 0; B = 0;
#10 A = 1;
#20 A = 0; B = 1;
end
81
Stimulus and design modules interaction
• The signals of test bench as inputs to the design module are reg
data type, the outputs of design module to test bench are wire
data type.
82
Example 4-9
83
Gate Level of Verilog Code of Fig.4-2
84
Test Bench of the Figure 4-2
85

More Related Content

What's hot

12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...JatinJatin30
 
adder and subtractor
 adder and subtractor adder and subtractor
adder and subtractorUnsa Shakir
 
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...Arti Parab Academics
 
1.ripple carry adder, full adder implementation using half adder.
1.ripple carry adder, full adder implementation using half adder.1.ripple carry adder, full adder implementation using half adder.
1.ripple carry adder, full adder implementation using half adder.MdFazleRabbi18
 
Binary multipliers
Binary multipliersBinary multipliers
Binary multipliersSyed Saeed
 
NAND and NOR implementation and Other two level implementation
NAND and NOR implementation and  Other two level implementationNAND and NOR implementation and  Other two level implementation
NAND and NOR implementation and Other two level implementationMuhammad Akhtar
 
Decoders-Digital Electronics
Decoders-Digital ElectronicsDecoders-Digital Electronics
Decoders-Digital ElectronicsPaurav Shah
 
Decoder Full Presentation
Decoder Full Presentation Decoder Full Presentation
Decoder Full Presentation Adeel Rasheed
 
Floating point presentation
Floating point presentationFloating point presentation
Floating point presentationSnehalataAgasti
 
Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbersMOHAN MOHAN
 
1's and 2's complement
1's and 2's complement 1's and 2's complement
1's and 2's complement Shiraz Azeem
 
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptxJEEVANANTHAMG6
 

What's hot (20)

12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
 
Code conversion
Code conversionCode conversion
Code conversion
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
adder and subtractor
 adder and subtractor adder and subtractor
adder and subtractor
 
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
 
Binary arithmetic
Binary arithmeticBinary arithmetic
Binary arithmetic
 
1.ripple carry adder, full adder implementation using half adder.
1.ripple carry adder, full adder implementation using half adder.1.ripple carry adder, full adder implementation using half adder.
1.ripple carry adder, full adder implementation using half adder.
 
Binary multipliers
Binary multipliersBinary multipliers
Binary multipliers
 
NAND and NOR implementation and Other two level implementation
NAND and NOR implementation and  Other two level implementationNAND and NOR implementation and  Other two level implementation
NAND and NOR implementation and Other two level implementation
 
Decoders-Digital Electronics
Decoders-Digital ElectronicsDecoders-Digital Electronics
Decoders-Digital Electronics
 
Decoder Full Presentation
Decoder Full Presentation Decoder Full Presentation
Decoder Full Presentation
 
Floating point presentation
Floating point presentationFloating point presentation
Floating point presentation
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
 
Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbers
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
BCD ADDER
BCD ADDER BCD ADDER
BCD ADDER
 
Fulll Adder
Fulll AdderFulll Adder
Fulll Adder
 
Bcd
BcdBcd
Bcd
 
1's and 2's complement
1's and 2's complement 1's and 2's complement
1's and 2's complement
 
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
 

Similar to combinational-circuit (1).ppt

combinational-circuit.pptx it tis creative study of digital electronics for ...
combinational-circuit.pptx it tis creative study of  digital electronics for ...combinational-circuit.pptx it tis creative study of  digital electronics for ...
combinational-circuit.pptx it tis creative study of digital electronics for ...RishabhSingh308993
 
combinational-circuit presenmtation .ppt
combinational-circuit presenmtation .pptcombinational-circuit presenmtation .ppt
combinational-circuit presenmtation .pptFilibertoMoralesGarc
 
combinational-circuit.ppt
combinational-circuit.pptcombinational-circuit.ppt
combinational-circuit.pptShivamRathod34
 
combinational circuits dispositivos .ppt
combinational circuits dispositivos .pptcombinational circuits dispositivos .ppt
combinational circuits dispositivos .pptFilibertoMoralesGarc
 
Logic System Design KTU Chapter-4.ppt
Logic System Design KTU Chapter-4.pptLogic System Design KTU Chapter-4.ppt
Logic System Design KTU Chapter-4.pptAlbin562191
 
UNIT - II.pptx
UNIT - II.pptxUNIT - II.pptx
UNIT - II.pptxamudhak10
 
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECEDigital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECESeshaVidhyaS
 
Combinational and sequential logic
Combinational and sequential logicCombinational and sequential logic
Combinational and sequential logicDeepak John
 
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptxDLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptxSaveraAyub2
 
Unit 3 combinational circuits
Unit 3  combinational circuitsUnit 3  combinational circuits
Unit 3 combinational circuitsAmrutaMehata
 
Chapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdfChapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdfTamiratDejene1
 
18CSC203J_COA_Unit 2 final.pptx
18CSC203J_COA_Unit 2 final.pptx18CSC203J_COA_Unit 2 final.pptx
18CSC203J_COA_Unit 2 final.pptxtakix43466
 
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and  BCD Add...DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and  BCD Add...
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...SaveraAyub2
 
Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIChapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIEr. Nawaraj Bhandari
 

Similar to combinational-circuit (1).ppt (20)

combinational-circuit (1).ppt
combinational-circuit (1).pptcombinational-circuit (1).ppt
combinational-circuit (1).ppt
 
combinational-circuit.pptx it tis creative study of digital electronics for ...
combinational-circuit.pptx it tis creative study of  digital electronics for ...combinational-circuit.pptx it tis creative study of  digital electronics for ...
combinational-circuit.pptx it tis creative study of digital electronics for ...
 
combinational-circuit presenmtation .ppt
combinational-circuit presenmtation .pptcombinational-circuit presenmtation .ppt
combinational-circuit presenmtation .ppt
 
combinational-circuit.ppt
combinational-circuit.pptcombinational-circuit.ppt
combinational-circuit.ppt
 
combinational circuits dispositivos .ppt
combinational circuits dispositivos .pptcombinational circuits dispositivos .ppt
combinational circuits dispositivos .ppt
 
Logic System Design KTU Chapter-4.ppt
Logic System Design KTU Chapter-4.pptLogic System Design KTU Chapter-4.ppt
Logic System Design KTU Chapter-4.ppt
 
UNIT - II.pptx
UNIT - II.pptxUNIT - II.pptx
UNIT - II.pptx
 
Chapter-04.pdf
Chapter-04.pdfChapter-04.pdf
Chapter-04.pdf
 
Unit 4 dica
Unit 4 dicaUnit 4 dica
Unit 4 dica
 
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECEDigital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
 
Combinational and sequential logic
Combinational and sequential logicCombinational and sequential logic
Combinational and sequential logic
 
Digital Logic Design
Digital Logic Design Digital Logic Design
Digital Logic Design
 
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptxDLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
 
5. Arithmaticn combinational Ckt.ppt
5. Arithmaticn combinational Ckt.ppt5. Arithmaticn combinational Ckt.ppt
5. Arithmaticn combinational Ckt.ppt
 
Chapter 4: Combinational Logic
Chapter 4: Combinational LogicChapter 4: Combinational Logic
Chapter 4: Combinational Logic
 
Unit 3 combinational circuits
Unit 3  combinational circuitsUnit 3  combinational circuits
Unit 3 combinational circuits
 
Chapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdfChapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdf
 
18CSC203J_COA_Unit 2 final.pptx
18CSC203J_COA_Unit 2 final.pptx18CSC203J_COA_Unit 2 final.pptx
18CSC203J_COA_Unit 2 final.pptx
 
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and  BCD Add...DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and  BCD Add...
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...
 
Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIChapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSI
 

Recently uploaded

Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfParomita Roy
 
WAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsWAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsCharles Obaleagbon
 
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130Suhani Kapoor
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfAmirYakdi
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...kumaririma588
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵anilsa9823
 
VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...Call Girls in Nagpur High Profile
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...Pooja Nehwal
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...Call Girls in Nagpur High Profile
 
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...BarusRa
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...home
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130Suhani Kapoor
 
Delhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Tapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the FunnelTapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the Funneljen_giacalone
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxjanettecruzeiro1
 
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Government polytechnic college-1.pptxabcd
Government polytechnic college-1.pptxabcdGovernment polytechnic college-1.pptxabcd
Government polytechnic college-1.pptxabcdshivubhavv
 
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call GirlsCBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girlsmodelanjalisharma4
 

Recently uploaded (20)

Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
 
WAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsWAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past Questions
 
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
 
VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Dange Chowk (8250192130) Pune Escorts Nearby with Comple...
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
 
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
 
Delhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Paharganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Tapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the FunnelTapestry Clothing Brands: Collapsing the Funnel
Tapestry Clothing Brands: Collapsing the Funnel
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptx
 
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Government polytechnic college-1.pptxabcd
Government polytechnic college-1.pptxabcdGovernment polytechnic college-1.pptxabcd
Government polytechnic college-1.pptxabcd
 
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
 
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call GirlsCBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
 

combinational-circuit (1).ppt

  • 1. CSEN1051 - Digital Logic Circuits UNIT – IV COMBINATIONAL LOGIC CIRCUITS 1
  • 2. Syllabus Design procedures, Adders, Subtractors, Multiplexers, Demultiplexers, Encoders, Decoders, Priority encoder, Code converters, seven segment display, Magnitude comparator, Decimal adder (BCD adder), Binary Multiplier 2
  • 3. Combinational Logic • Logic circuits for digital systems may be combinational or sequential. • A combinational circuit consists of input variables, logic gates, and output variables. • The logic circuit whose outputs at any instant of time entirely depend upon the input signals present at that time are known as combinational circuits. Hence a combinational circuit does not contain memory elements. 3
  • 4. BASIC LOGIC BLOCK - GATE Types of Basic Logic Blocks - Combinational Logic Block Logic Blocks whose output logic value depends only on the input logic values - Sequential Logic Block Logic Blocks whose output logic value depends on the input values and the state (stored information) of the blocks Functions of Gates can be described by - Truth Table - Boolean Function . . Gate . Binary Digital Input Signal Binary Digital Output Signal
  • 5. COMBINATIONAL GATES A X X = (A + B)’ B Name Symbol Function Truth Table AND A X = A • B X or B X = AB 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 1 1 1 0 1 1 1 1 OR A X X = A + B B I A X X = A’ 0 1 1 0 Buffer A X X = A A X 0 0 1 1 NAND A X X = (AB)’ B 0 0 1 0 1 1 1 0 1 1 1 0 NOR 0 0 1 0 1 0 1 0 0 1 1 0 XOR Exclusive OR A X = A  B X or B X = A’B + AB’ 0 0 0 0 1 1 1 0 1 1 1 0 A X = (A  B)’ X or B X = A’B’+ AB 0 0 1 0 1 0 1 0 0 1 1 1 XNOR Exclusive NOR or Equivalence A B X A B X A X A B X A B X A B X A B X
  • 6. LOGIC CIRCUIT DESIGN x y z F 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 F = x + y’z Boolean Algebra x y z F Truth Table Boolean Function Logic Diagram
  • 7. Analysis Procedure The analysis of a combinational circuit is the procedure by which we can determine the output Boolean function and the truth table of the circuit by using the following procedure. 1. Make sure that the given circuit is combinational circuit. The combinational circuit has logic gates with no feedback or memory elements. 2. Label all gate outputs that are a function of input variables with arbitrary symbols and determine the Boolean functions for each gate output. 3. Repeat the step 2 until the outputs of the circuit are obtained. 4. Finally substituting previously defined Boolean functions, obtain the output Boolean functions in terms of input variables. 7
  • 8. Example F2 = AB + AC + BC; T1 = A + B + C; T2 = ABC; T3 = F2’T1; F1 = T3 + T2 F1 = T3 + T2 = F2’T1 + ABC = A’BC’ + A’B’C + AB’C’ + ABC 8
  • 9. Derive truth table from logic diagram • We can derive the truth table in Table 4-1 by using the circuit of Fig.4-2. 9
  • 10. 4-3. Design procedure 1. Table4-2 is a Code-Conversion example, first, we can list the relation of the BCD and Excess-3 codes in the truth table. 10
  • 11. Karnaugh map 2. For each symbol of the Excess-3 code, we use 1’s to draw the map for simplifying Boolean function. 11
  • 12. Circuit implementation z = D’; y = CD + C’D’ = CD + (C + D)’ x = B’C + B’D + BC’D’ = B’(C + D) + B(C + D)’ w = A + BC + BD = A + B(C + D) 12
  • 13. 4-4. Binary Adder-Subtractor • A combinational circuit that performs the addition of two bits is called a half adder. • The truth table for the half adder is listed below: S = x’y + xy’ C = xy 13 S: Sum C: Carry
  • 15. Full-Adder • One that performs the addition of three bits(two significant bits and a previous carry) is a full adder. 15
  • 16. Simplified Expressions S = x’y’z + x’yz’ + xy’z’ + xyz C = xy + xz + yz 16 C
  • 18. Another implementation • Full-adder can also implemented with two half adders and one OR gate (Carry Look-Ahead adder). S = z ⊕ (x ⊕ y) = z’(xy’ + x’y) + z(xy’ + x’y)’ = xy’z’ + x’yz’ + xyz + x’y’z C = z(xy’ + x’y) + xy = xy’z + x’yz + xy 18
  • 19. Subtractor • A combinational circuit that performs the subtractions of bits is called a Subtractor. • There are two types of Subtractors. 1.Half Subtractor 2.Full Subtractor 19
  • 20. Half Subtractor: • A combinational circuit that performs the subtraction of two bits is called Half Subtractor. It receives two inputs and produces two outputs Difference and Borrow. The block diagram of the Half Subtractor is given as 20
  • 21. • Half Subtractor Truth Table: 21
  • 22. 22
  • 23. 23
  • 24. • The logical diagram for the difference can be obtained by using the exclusive OR- Gate. 24
  • 25. Full Subtractor: • A combinational circuit that performs the subtraction of three bits is called a Full Subtractor. It receives three inputs and produces two outputs Difference and Borrow. The Block Diagram of the Full Subtractor is as follows. 25
  • 26. Full Subtractor Block Diagram: 26
  • 27. 27
  • 28. Simplified Boolean Function of the Full Subtractor: 28
  • 29. Simplifying the above Boolean function by using the Karnaugh Map K.Map 29
  • 30. 30
  • 31. • Full Subtractor Logical Diagram: 31
  • 32. Binary adder • This is also called Ripple Carry Adder ,because of the construction with full adders are connected in cascade. 32
  • 33. Carry Propagation • Fig.4-9 causes a unstable factor on carry bit, and produces a longest propagation delay. • The signal from Ci to the output carry Ci+1, propagates through an AND and OR gates, so, for an n-bit RCA, there are 2n gate levels for the carry to propagate from input to output. 33
  • 34. Carry Propagation • Because the propagation delay will affect the output signals on different time, so the signals are given enough time to get the precise and stable outputs. • The most widely used technique employs the principle of carry look-ahead to improve the speed of the algorithm. 34
  • 35. Boolean functions Pi = Ai ⊕ Bi steady state value Gi = AiBi steady state value Output sum and carry Si = Pi ⊕ Ci Ci+1 = Gi + PiCi Gi : carry generate Pi : carry propagate C0 = input carry C1 = G0 + P0C0 C2 = G1 + P1C1 = G1 + P1G0 + P1P0C0 C3 = G2 + P2C2 = G2 + P2G1 + P2P1G0 + P2P1P0C0 • C3 does not have to wait for C2 and C1 to propagate. 35
  • 36. Logic diagram of carry look-ahead generator • C3 is propagated at the same time as C2 and C1. 36
  • 37. 4-bit adder with carry lookahead • Delay time of n-bit CLAA = XOR + (AND + OR) + XOR 37
  • 38. Binary subtractor M = 1subtractor ; M = 0adder 38
  • 39. Overflow • It is worth noting Fig.4-13 that binary numbers in the signed- complement system are added and subtracted by the same basic addition and subtraction rules as unsigned numbers. • Overflow is a problem in digital computers because the number of bits that hold the number is finite and a result that contains n+1 bits cannot be accommodated. 39
  • 40. Overflow on signed and unsigned • When two unsigned numbers are added, an overflow is detected from the end carry out of the MSB position. • When two signed numbers are added, the sign bit is treated as part of the number and the end carry does not indicate an overflow. • An overflow cann’t occur after an addition if one number is positive and the other is negative. • An overflow may occur if the two numbers added are both positive or both negative. 40
  • 41. 4-5 Decimal adder BCD adder can’t exceed 9 on each input digit. K is the carry. 41
  • 42. Rules of BCD adder • When the binary sum is greater than 1001, we obtain a non-valid BCD representation. • The addition of binary 6(0110) to the binary sum converts it to the correct BCD representation and also produces an output carry as required. • To distinguish them from binary 1000 and 1001, which also have a 1 in position Z8, we specify further that either Z4 or Z2 must have a 1. C = K + Z8Z4 + Z8Z2 42
  • 43. Implementation of BCD adder • A decimal parallel adder that adds n decimal digits needs n BCD adder stages. • The output carry from one stage must be connected to the input carry of the next higher-order stage. 43 If =1 0110
  • 44. 4-6. Binary multiplier • Usually there are more bits in the partial products and it is necessary to use full adders to produce the sum of the partial products. 44 And
  • 45. 4-bit by 3-bit binary multiplier • For J multiplier bits and K multiplicand bits we need (J X K) AND gates and (J − 1) K-bit adders to produce a product of J+K bits. • K=4 and J=3, we need 12 AND gates and two 4-bit adders. 45
  • 46. 4-7. Magnitude comparator • The equality relation of each pair of bits can be expressed logically with an exclusive-NOR function as: A = A3A2A1A0 ; B = B3B2B1B0 xi=AiBi+Ai’Bi’ for i = 0, 1, 2, 3 (A = B) = x3x2x1x0 46
  • 47. Magnitude comparator • We inspect the relative magnitudes of pairs of MSB. If equal, we compare the next lower significant pair of digits until a pair of unequal digits is reached. • If the corresponding digit of A is 1 and that of B is 0, we conclude that A>B. (A>B)= A3B’3+x3A2B’2+x3x2A1B’1+x3x2x1A0B’0 (A<B)= A’3B3+x3A’2B2+x3x2A’1B1+x3x2x1A’0B0 47
  • 48. 4-8. Decoders • The decoder is called n-to-m-line decoder, where m≤2n . • the decoder is also used in conjunction with other code converters such as a BCD-to-seven_segment decoder. • 3-to-8 line decoder: For each possible input combination, there are seven outputs that are equal to 0 and only one that is equal to 1. 48
  • 50. Decoder with enable input • Some decoders are constructed with NAND gates, it becomes more economical to generate the decoder minterms in their complemented form. • As indicated by the truth table , only one output can be equal to 0 at any given time, all other outputs are equal to 1. 50
  • 51. Demultiplexer • A decoder with an enable input is referred to as a decoder/demultiplexer. • The truth table of demultiplexer is the same with decoder. 51 Demultiplexer D0 D1 D2 D3 E A B
  • 52. 3-to-8 decoder with enable implement the 4-to-16 decoder 52
  • 53. Implementation of a Full Adder with a Decoder • From table 4-4, we obtain the functions for the combinational circuit in sum of minterms: S(x, y, z) = ∑(1, 2, 4, 7) C(x, y, z) = ∑(3, 5, 6, 7) 53
  • 54. 4-9. Encoders • An encoder is the inverse operation of a decoder. • We can derive the Boolean functions by table 4-7 z = D1 + D3 + D5 + D7 y = D2 + D3 + D6 + D7 x = D4 + D5 + D6 + D7 54
  • 55. Priority encoder • If two inputs are active simultaneously, the output produces an undefined combination. We can establish an input priority to ensure that only one input is encoded. • Another ambiguity in the octal-to-binary encoder is that an output with all 0’s is generated when all the inputs are 0; the output is the same as when D0 is equal to 1. • The discrepancy tables on Table 4-7 and Table 4-8 can resolve aforesaid condition by providing one more output to indicate that at least one input is equal to 1. 55
  • 56. Priority encoder V=0no valid inputs V=1valid inputs X’s in output columns represent don’t-care conditions X’s in the input columns are useful for representing a truth table in condensed form. Instead of listing all 16 minterms of four variables. 56
  • 57. 4-input priority encoder • Implementation of table 4-8 x = D2 + D3 y = D3 + D1D’2 V = D0 + D1 + D2 + D3 57 0 0 0 0
  • 58. 4-10. Multiplexers S = 0, Y = I0 Truth Table S Y Y = S’I0 + SI1 S = 1, Y = I1 0 I0 1 I1 58
  • 60. Quadruple 2-to-1 Line Multiplexer • Multiplexer circuits can be combined with common selection inputs to provide multiple-bit selection logic. Compare with Fig4-24. 60 I0 I1 Y
  • 61. Boolean function implementation • A more efficient method for implementing a Boolean function of n variables with a multiplexer that has n-1 selection inputs. F(x, y, z) = (1,2,6,7) 61
  • 62. 4-input function with a multiplexer F(A, B, C, D) = (1, 3, 4, 11, 12, 13, 14, 15) 62
  • 63. Three-State Gates • A multiplexer can be constructed with three-state gates. 63
  • 64. 4-11. HDL for combinational circuits • A module can be described in any one of the following modeling techniques: 1. Gate-level modeling using instantiation of primitive gates and user-defined modules. 2. Dataflow modeling using continuous assignment statements with keyword assign. 3. Behavioral modeling using procedural assignment statements with keyword always. 64
  • 65. Gate-level Modeling • A circuit is specified by its logic gates and their interconnection. • Verilog recognizes 12 basic gates as predefined primitives. • The logic values of each gate may be 1, 0, x(unknown), z(high-impedance). 65
  • 66. Gate-level description on Verilog code The wire declaration is for internal connections. 66
  • 67. • There are two basic types of design methodologies: top-down and bottom-up. • Top-down: the top-level block is defined and then the sub- blocks necessary to build the top-level block are identified.(Fig.4-9 binary adder) • Bottom-up: the building blocks are first identified and then combined to build the top-level block.(Example 4-2 4-bit adder) 67 Design methodologies
  • 68. A bottom-up hierarchical description 68
  • 71. Three state gates Gates statement: gate name(output, input, control) >> bufif1(OUT, A, control); A = OUT when control = 1, OUT = z when control = 0; >> notif0(Y, B, enable); Y = B’ when enable = 0, Y = z when enable = 1; 71
  • 72. 2-to-1 multiplexer • HDL uses the keyword tri to indicate that the output has multiple drivers. module muxtri (A, B, select, OUT); input A,B,select; output OUT; tri OUT; bufif1 (OUT,A,select); bufif0 (OUT,B,select); endmodule 72
  • 73. Dataflow modeling • It uses a number of operators that act on operands to produce desired results. Verilog HDL provides about 30 operator types. Table 4-10 Symbol Operation + binary addition − binary subtraction & bit-wise AND | bit-wise OR ^ bit-wise XOR ~ bit-wise NOT == equality > greater than < less than { } concatenation ?: conditional 73
  • 74. Dataflow modeling • A continuous assignment is a statement that assigns a value to a net. • The data type net is used in Verilog HDL to represent a physical connection between circuit elements. • A net defines a gate output declared by an output or wire. 74
  • 75. Dataflow description of 4-bit adder 75 HDL Example 4-4 //Dataflow description of 4-bit adder module binary_adder (A,B,Cin,SUM,Cout); input [3:0] A,B; input Cin; output [3:0] SUM; output Cout; assign {Cout,SUM} = A + B +Cin; endmodule
  • 76. Data flow description of a 4-bit comparator 76
  • 77. Dataflow description of 2-1 multiplexer • Conditional operator( ? : ) • Condition? true-expression : false-expression; 77
  • 78. Behavioral modeling • It is used mostly to describe sequential circuits, but can be used also to describe combinational circuits. • Behavioral descriptions use the keyword always followed by a list of procedural assignment statements. • The target output of procedural assignment statements must be of the reg data type. Contrary to the wire data type, where the target output of an assignment may be continuously updated, a reg data type retains its value until a new value is assigned. 78
  • 79. Behavioral description of 2-1 multiplexer 79
  • 81. Writing a simple test bench • In addition to the always statement, test benches use the initial statement to provide stimulus to the circuit under test. • The always statement executes repeatedly in a loop. The initial statement executes only once starting from simulation time=0 and may continue with any operations that are delayed by a given number of time units as specified by the symbol #. For example: initial begin A = 0; B = 0; #10 A = 1; #20 A = 0; B = 1; end 81
  • 82. Stimulus and design modules interaction • The signals of test bench as inputs to the design module are reg data type, the outputs of design module to test bench are wire data type. 82
  • 84. Gate Level of Verilog Code of Fig.4-2 84
  • 85. Test Bench of the Figure 4-2 85