Professional Documents
Culture Documents
L02 Logic
L02 Logic
Bei Yu
byu@cse.cuhk.edu.hk
software
hardware
1011 1101 -3
0101
1110 -2
and add a 1 1111 -1
and add a 1
0000 0
1010 0001 1
0110
0010 2
complement all the bits 0011 3
0100 4
0101 5
0110 6
CENG3420 L02 Digital Logic. 10
23 - 1 = 0111 7 Spring 2018
EX: L02-2
q For an n-bit signed binary numeral system, what’s the
largest positive number and the smallest negative
number?
q Active LOW
● Low voltage means On
5.0 V
Logic 0 Logic 1
HIGH (1) 4.0 V
False True
Off On 3.0 V
LOW HIGH
2.0 V
No Yes
Open Closed LOW (0) 1.0 V
switch switch
0.0 V
XOR XNOR
Input . .
Output
Combinational
X . . Z
Circuits
Z = F(X)
In combinational circuits, the output at any time is a
direct function of the applied external inputs
Circuit
Specification
Truth Table
How many input/output?
Minimization
K-maps, Algebraic Manipulation, CAD tools
Logic Diagram
X
Z
Y
X Propagation
Inputs Delay of the
Y Circuit = τ
Output Z
≈ CLVDD2/2
Vo
Vi
CL
Ground
Fanout = 3
BUF_X1 BUF_X4
NAND
BUF_X16
n-to-2n .
n inputs . 2n outputs
.
Decoder
.
Add
Sub
And
op0 3-to-8 Xor
op1 Decoder Not Light
op2 C0 2-to-4 A/C
Load
Store C1 Decoder Door
Jump Light-A/C
Load a
Add b
Store c
.
.
S = ∑ (1,2,4,7)
C = ∑ (3,5,6,7)
X Y Z C S
3 inputs and 8 possible minterms
0 0 0 0 0 3-to-8 decoder can be used for implementing this circuit
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
. 2n-to-n
2n inputs . n outputs
.
Encoder
.
2n x 1
2n inputs one output
MUX
n select lines
A B C F
F(A,B,C)=∑(1,2,6,7)
0 0 0 0
F=C
0 0 1 1 C D0
0 1 0 1 C’ D1
F = C’ 0 D2 F
0 1 1 0 S1 S0
D3
1
1 0 0 0
F=0 A B
1 0 1 0
1 1 0 1
F=1
1 1 1 1
q A combinational circuit:
q At any time, outputs depend only on inputs
● Changing inputs changes outputs
q History is ignored !
q A sequential circuit:
q outputs depend on inputs and previous inputs
● Previous inputs are stored as binary information into
memory
● The stored information at any time defines a state
q next state depends on inputs and present state
=
q How to change the value stored?
R: reset signal
S: set signal
SR-Latch
q S=R=1:
q S=0,R=1:
q S=1,R=0:
q S=R=0:
=
q Master-slave positive-edge-triggered D flip-flop
Contamination and
Propagation Delays
A tpd
Combinational
A Y
tpd Logic Prop. Delay Logic
Y tcd
Flop
D Q D
tccq Latch/Flop Clk-Q Cont. Delay tpcq
Q tccq
tpdq Latch D-Q Prop Delay
0 1 … n-1