Combinational Circuits in Computer Science

 
Unit 5
COMBINATIONAL CIRCUITS-1
 
College of Computer and Information Sciences
Department of Computer Science
 CSC 220: Computer Organization
 
Unit 5: Combinational Circuits-1
Overview
Introduction 
to Combinational Circuits
Adder
Ripple Carry Adder
 Subtraction
Adder/Subtractor
 
 
C
h
a
p
t
e
r
-
3
M
.
 
M
o
r
r
i
s
 
M
a
n
o
,
 
C
h
a
r
l
e
s
 
R
.
 
K
i
m
e
 
a
n
d
 
T
o
m
 
M
a
r
t
i
n
,
 
L
o
g
i
c
 
a
n
d
 
C
o
m
p
u
t
e
r
 
D
e
s
i
g
n
F
u
n
d
a
m
e
n
t
a
l
s
,
 
G
l
o
b
a
l
 
(
5
t
h
)
 
E
d
i
t
i
o
n
,
 
P
e
a
r
s
o
n
 
E
d
u
c
a
t
i
o
n
 
L
i
m
i
t
e
d
,
 
2
0
1
6
.
 
I
S
B
N
:
9
7
8
1
2
9
2
0
9
6
1
2
4
 
Adder
 
Design an Adder for 1-bit numbers?
1. Specification:
2 inputs (X,Y)
2 outputs (C,S)
 
Adder
 
Design an Adder for 1-bit numbers?
1. Specification:
2 inputs (X,Y)
2 outputs (C,S)
2. Formulation:
 
 
Adder
 
Design an Adder for 1-bit numbers?
1. Specification:                     3. Optimization/Circuit
2 inputs (X,Y)
2 outputs (C,S)
2. Formulation:
 
 
Half Adder
 
This adder is called a Half Adder
Q: Why?
 
 
Full Adder
 
A combinational circuit that adds 3 input bits to generate a Sum
bit and a Carry bit
 
Full Adder
 
A combinational circuit that adds 3 input bits to generate a Sum
bit and a Carry bit
 
X
 
YZ
 
0
1
 
00         01           11         10
 
0        1            0            1
1        0            1           0
 
X
 
YZ
 
0
1
 
00         01           11         10
 
0        0            1            0
0        1            1            1
 
Sum
 
Carry
 
S = X’Y’Z + X’YZ’
+ XY’Z’ +XYZ
= X 
 Y 
 Z
 
C = XY + YZ + XZ
 
Full Adder = 2 Half Adders
 
Manipulating the Equations:
 
 S =   X 
 Y  
 Z
      C = XY + XZ + YZ
 
Full Adder = 2 Half Adders
 
Manipulating the Equations:
 
 S = ( X 
 Y ) 
 Z
      C = XY + 
XZ
 + 
YZ
         = XY + 
XYZ + XY’Z
 + 
X’YZ + XYZ
         = XY( 1 +  Z) +  Z(XY’ + X’Y)
         = XY + Z(X 
 Y )
 
Full Adder = 2 Half Adders
 
Manipulating the Equations:
 
 S = ( X 
 Y ) 
 Z
      C = XY + XZ + YZ  = XY + Z(X 
 Y )
 
Src: Mano’s Book
Think of
Z as a
carry in
 
Bigger Adders
 
How to build an adder for n-bit numbers?
Example: 4-Bit Adder
Inputs ?
Outputs ?
What is the size of the truth table?
How many functions to optimize?
 
Bigger Adders
 
How to build an adder for n-bit numbers?
Example: 4-Bit Adder
Inputs ?  
9 inputs
Outputs ? 
5 outputs
What is the size of the truth table? 
512 rows!
How many functions to optimize? 
5 functions
 
Ripple Carry Adder
 
To add n-bit numbers:
Use n Full-Adders in parallel
The carries propagates as in addition by hand
Use Z in the circuit as a C
in
 
                                    1  0  0  0
                           0 1 0 1
                           0 1 1 0
                           1 0 1 1
 
Binary Parallel Adder
 
To add n-bit numbers:
Use n Full-Adders in parallel
The carries propagates as in addition by hand
 
This adder is called
 ripple carry adder
 
Src: Mano’s Book
 
Subtraction (2’s Complement)
 
How to build a subtractor using 2’s complement?
 
Subtraction (2’s Complement)
 
How to build a subtractor using 2’s complement?
1
 
S = A + ( -B)
 
Src: Mano’s Book
 
Adder/Subtractor
 
How to build a circuit that performs both addition and
subtraction?
 
Adder/Subtractor
 
Ahmad Almulhem, KFUPM 2009
 
Src: Mano’s Book
Using full adders and XOR we can build an Adder/Subtractor!
0 : Add
1: subtract
 
Binary Parallel Adder (Again)
 
To add n-bit numbers:
Use n Full-Adders in parallel
The carries propagates as in addition by hand
 
This adder is called
 ripple carry adder
 
Src: Mano’s Book
 
Carry Look Ahead Adder
 
How to reduce propagation delay of ripple carry adders?
Carry look ahead adder:
  All carries are computed as a function of C
0
(independent of n !)
It works on the following standard principles:
A carry bit is generated when both input bits Ai and Bi are 1, or
When one of input bits is 1, and a carry in bit exists
 
Cn Cn-1…….Ci……….C2C1C0
 
     An-1…….Ai……….A2A1A0
 
     Bn-1…….Bi……….B2B1B0
 
Sn Sn-1…….Si……….S2S1S0
 
Carry Out
 
Carry bits
undefined
 
For Review
 
24
 
25
Slide Note
Embed
Share

Explore the fundamentals of combinational circuits in computer science, including adders, subtractors, half adders, and full adders. Learn about circuit design, optimization, and manipulation of equations to enhance computational efficiency.

  • Combinational Circuits
  • Adders
  • Circuit Design
  • Computer Science
  • Logic Design

Uploaded on Aug 09, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. College of Computer and Information Sciences Department of Computer Science CSC 220: Computer Organization Unit Unit 5 5 COMBINATIONAL CIRCUITS COMBINATIONAL CIRCUITS- -1 1

  2. Unit 5: Combinational Circuits-1 Overview Overview Introduction to Combinational Circuits Adder Ripple Carry Adder Subtraction Adder/Subtractor Chapter-3 M. Morris Mano, Charles R. Kime and Tom Martin, Logic and Computer Design Fundamentals, Global (5th) Edition, Pearson Education Limited, 2016. ISBN: 9781292096124

  3. Adder Adder Design an Adder for 1-bit numbers? 1. Specification: 2 inputs (X,Y) 2 outputs (C,S)

  4. Adder Design an Adder for 1-bit numbers? 1. Specification: 2 inputs (X,Y) 2 outputs (C,S) 2. Formulation: X 0 0 1 1 Y 0 1 0 1 C 0 0 0 1 S 0 1 1 0

  5. Adder Design an Adder for 1-bit numbers? 1. Specification: 3. Optimization/Circuit 2 inputs (X,Y) 2 outputs (C,S) 2. Formulation: X 0 0 1 1 Y 0 1 0 1 C 0 0 0 1 S 0 1 1 0

  6. Half Adder This adder is called a Half Adder Q: Why? X 0 0 1 1 Y 0 1 0 1 C 0 0 0 1 S 0 1 1 0

  7. Full Adder A combinational circuit that adds 3 input bits to generate a Sum bit and a Carry bit

  8. Full Adder A combinational circuit that adds 3 input bits to generate a Sum bit and a Carry bit Sum YZ X 0 0 0 0 1 1 1 1 Y 0 0 1 1 0 0 1 1 Z 0 1 0 1 0 1 0 1 C 0 0 0 1 0 1 1 1 S 0 1 1 0 1 0 0 1 X 00 01 11 10 0 1 0 1 S = X Y Z + X YZ + XY Z +XYZ 0 1 1 0 1 0 = X Y Z Carry YZ X 00 01 11 10 0 0 1 0 0 1 0 1 1 1 C = XY + YZ + XZ

  9. Full Adder = 2 Half Adders Manipulating the Equations: S = X Y Z C = XY + XZ + YZ

  10. Full Adder = 2 Half Adders Manipulating the Equations: S = ( X Y ) Z C = XY + XZ + YZ = XY + XYZ + XY Z + X YZ + XYZ = XY( 1 + Z) + Z(XY + X Y) = XY + Z(X Y )

  11. Full Adder = 2 Half Adders Manipulating the Equations: S = ( X Y ) Z C = XY + XZ + YZ = XY + Z(X Y ) Think of Z as a carry in Src: Mano s Book

  12. Bigger Adders How to build an adder for n-bit numbers? Example: 4-Bit Adder Inputs ? Outputs ? What is the size of the truth table? How many functions to optimize?

  13. Bigger Adders How to build an adder for n-bit numbers? Example: 4-Bit Adder Inputs ? 9 inputs Outputs ? 5 outputs What is the size of the truth table? 512 rows! How many functions to optimize? 5 functions

  14. Ripple Carry Adder Ripple Carry Adder To add n-bit numbers: Use n Full-Adders in parallel The carries propagates as in addition by hand Use Z in the circuit as a Cin 1 0 0 0 0 1 0 1 0 1 1 0 1 0 1 1

  15. Binary Parallel Adder To add n-bit numbers: Use n Full-Adders in parallel The carries propagates as in addition by hand Src: Mano s Book This adder is called ripple carry adder

  16. Subtraction (2s Complement) How to build a subtractor using 2 s complement?

  17. Subtraction (2s Complement) How to build a subtractor using 2 s complement? 1 Src: Mano s Book S = A + ( -B)

  18. Adder/ Adder/Subtractor Subtractor How to build a circuit that performs both addition and subtraction?

  19. Adder/Subtractor 0 : Add 1: subtract Src: Mano s Book Using full adders and XOR we can build an Adder/Subtractor! Ahmad Almulhem, KFUPM 2009

  20. Binary Parallel Adder (Again) To add n-bit numbers: Use n Full-Adders in parallel The carries propagates as in addition by hand Src: Mano s Book This adder is called ripple carry adder

  21. Carry Look Ahead Adder How to reduce propagation delay of ripple carry adders? Carry look ahead adder: All carries are computed as a function of C0 (independent of n !) It works on the following standard principles: A carry bit is generated when both input bits Ai and Bi are 1, or When one of input bits is 1, and a carry in bit exists Cn Cn-1 .Ci .C2C1C0 An-1 .Ai .A2A1A0 Bn-1 .Bi .B2B1B0 Carry bits Carry Out Sn Sn-1 .Si .S2S1S0

  22. For Review 24

  23. 25

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#