Professional Documents
Culture Documents
Combinational Circuits (Continued) : (Materials Taken Primarily From: And)
Combinational Circuits (Continued) : (Materials Taken Primarily From: And)
(Continued)
(Materials taken primarily from:
http://sites.google.com/site/ece3724/ and
http://www.cs.Princeton.EDU/~cos126 )
Summary of Last Lecture
• Digital signals are binary (0 or I)
• Binary values can be viewed as logic values:
– digital signals treated as logic propositions
– digital circuits treated as functions and represented as Boolean
expressions and truth tables
• Sum-of-Product (SOP) Boolean expressions can be formed from a truth
table
• Digital circuits are made from assemblies of logic gates: AND, OR, NOT,
NAND, XOR…
• Each Boolean expression specifies a combinatorial digital circuit built using
logic gates
– gates correspond to logic operators
• The axioms of Boolean algebra can be used to simplify Boolean
expressions
– Karnaugh Maps “automate” this process
– Used to optimize circuit design
Example 1
• Odd Parity
– 1 if odd number of inputs are 1
– 0 otherwise
• Using Logisim
Adder
• Build a 4-bit adder: 9 inputs, 4 outputs
Truth Table
• Fuller adder is to big: 29 rows!
Revised Adder
• Design 1 bit at a time
– Chain together 1-bit adders to make
a 4-bit adder
• Design carry bit and sum bit
circuits separately
4-Bit Adder
Sum
1-Bit Adder
4-Bit Adder
Carry
Logisim Model
From Gates to Switches
OR gate:
From Gates to Switches
AND gate:
Switch Inputs
High True switch Vdd is power
Vdd Vdd supply voltage,
typically 5V or
3.3V
L H
Gnd is 0 V
Gnd Gnd
H L
Gnd Gnd
S: source
G: gate
D: drain
transistor
operation of P, N
types is
complementary
to each other
V 0.4 38
Buffer - takes 4 transistors
In digital logic,
logic NMOS must be connected to ground,
ground PMOS to
VDD. V 0.4 39
NAND gate - takes 4 transistors
AB Y
L L H
L H H
H L H
H H L
AB Y
0 0 1 out
0 1 1
1 0 1
1 1 0
V 0.4 40
Another logic gate - takes 4 transistors
AB Y
0 0
0 1
1 0
1 1
V 0.4 41
How do we make an AND gate?
The only
Th l way with
i h CMOS transistors
i iis to connect an iinverter
after a NAND gate.
V 0.4 45
Copyright 2005. Thomson/Delmar Learning, All rights
reserved.
Binaryy Adder
F (A,B,C) = A xor B xor C G = AB + AC + BC
A B
Cout = AB + Cin A + Cin B
Cout Cin = AB + Cin (A + B)
Co Ci
S
V 0.4 46
4 Bit Ripple Carry Adder
A(3) B(3) A(2) B(2) A(1) B(1) A(0) B(0)
Cout C(4) A B
C(3)
A B
C(2)
A B
C(1)
A B
C(0)
Co Ci Co Ci Co Ci Co Ci Cin
S S S S
A[3:0]
[ ]
SUM[3:0]
B[3:0]
+
V 0.4 47
Incrementer
A(3) A(2) A(1) A(0)
EN
If EN = 1 th
then Y = A + 1
A[3:0] inc Y[3:0]
If EN = 0 then Y = A
EN
V 0.4 48
Combinational Right Shifter
A combinational block that can either shift right or pass data
unchanged
V 0.4 49
ALU Overview
ALU Interface.
• Add, subtract, bitwise and, bitwise xor, shift left, shift right,
copy.
• Associate 3-bit integer with 5 primary ALU operations.
- ALU performs operations in parallel
-control wires select which result ALU outputs
ALU Implementation