1
Digital Logic
http://www.pds.ewi.tudelft.nl/~iosup/Courses/2011_ti1400_1.ppt
Outline
1. Basics of Boolean algebra and digital implementation
2. Sum of products form and digital implementation3. Functional Units4. Repeated Operations5. Other Building Blocks
TU-DelftTI1400/11-PDS
3
Unit of Information
• Computers consist of digital (binary) circuits• Unit of information: bit (Binary digIT), e.g. 0 and 1• There are two interpretations of 0 and 1:
• as data values• as truth values (true and false)
TU-DelftTI1400/11-PDS
4
Bit Strings
• By grouping bits together we obtain bit strings• e.g <10001>
which can be given a specific meaning• For instance, we can represent non-negative
numbers by bitstrings:
0123
<00><01><10><11>
<10><00><01><11>
TU-DelftTI1400/11-PDS
5
Boolean Logic
• We want a computer that can calculate, i.e transform strings into other strings:
1 +2 = 3 <01> <10> = <11>• To calculate we need an algebra being able to use
only two values• George Boole (1854) showed that logic (or symbolic
reasoning) can be reduced to a simple algebraic system
TU-DelftTI1400/11-PDS
6
Boolean algebra
• Rules are the same as school algebra:
• There is, however, one exception: !
x y y x
x y y x
x(y z) x y x z
(x y) z x (y z)
Commutative Law
Distributive Law
Associative Law
x x x
TU-DelftTI1400/11-PDS
7
Boolean algebra
• To see this we have to find out what the operations “+” and “.” mean in logic
• First the “.” operation: x.y (or x y )• Suppose x means “black” and y means “cows”.
Then, x.y means “black cows”• Hence “.” implies the class of objects that has both
properties. Also called AND function.
TU-DelftTI1400/11-PDS
8
Boolean algebra
• The “+” operation merges independent objects: x + y (or x y)
• Hence, if x means “man” and y means “woman”• Then x+y means “man or woman”• Also called OR function
TU-DelftTI1400/11-PDS
9
Boolean algebra
• Now suppose both objects are identical, for example x means “cows”
• Then x.x comprises no additional information• Hence
x x x 2 x
x x x
TU-DelftTI1400/11-PDS
10
Boolean algebra
• Next, we select “0” and “1” as the symbols in the algebra
• This choice is not arbitrary, since these are the only number symbols for which holds x2 = x
• What do these symbols mean in logic?• “0” : Nothing• “1” : Universe
• So 0.y = 0 and 1.y = y
TU-DelftTI1400/11-PDS
11
Boolean algebra
• Also, if x is a class of objects, then 1-x is the complement of that class
• It holds that x(1-x) = x -x2 = x-x =0• Hence, a class and its complement have nothing in
common• We denote 1-x as xx
TU-DelftTI1400/11-PDS
12
Boolean algebra
• A nice property of this system that we write any function f(x) as
• We can show this by observing that virtually every mathematical function can be written in polynomial form, i.e
f (x) ax b(1 x)
f (x) a0x a1x a2x 2 ...
TU-DelftTI1400/11-PDS
13
Boolean algebra
• Now• Hence,
• Let b = a0 and a = a0 + a1
• Then we have• From this it follows that
f (x) a0 a1x
f (x) ax b(1 x)
f (1) a
f (0) b
TU-DelftTI1400/11-PDS
14
Boolean algebra
• So
• More dimensional functions can be derived in an identical way:
f (x) f (1)x f (0)x
f (x, y) f (1,1)x y f (1,0)x y f (0,1)x y f (0,0)x y
TU-DelftTI1400/11-PDS
15
Binary addition
• We apply this on the modulo-2 addition
x y
0 0 01 0 10 1 11 1 0
x y x y y x
TU-DelftTI1400/11-PDS
16
Binary multiplication
• Same for modulo-2 multiplication
x y
0 0 01 0 00 1 01 1 1
x y x y
TU-DelftTI1400/11-PDS
17
Functions
• Let X denote bitstring, e.g., <x4 x3 x2 x1 >
• Any polynomial function Y=f(X) can be constructed using Boolean logic
• Also holds for functions with more arguments
• Functions can be put in table form or in formula form
TU-DelftTI1400/11-PDS
18
Gates
• We use basic components to represent primary logic operations (called gates)
• Components are made from transistors
xy
OR
x+y xy
x.y
x x
AND
INVERT
TU-DelftTI1400/11-PDS
19
Networks of gates
• We can make networks of gates
x
y
EXOR
x y
x y x y
TU-DelftTI1400/11-PDS
Outline
1. Basics of Boolean algebra and digital implementation2. Sum of products form and digital implementation3. Functional Units4. Repeated Operations5. Other Building Blocks
TU-DelftTI1400/11-PDS
21
Sum of product form
x y f
0 0 01 0 10 1 11 1 1
xy
f
simplify
f x y x y x y
TU-DelftTI1400/11-PDS
22
Minimization of expressions
• Logic expressions can often be minimized• Saves components• Example:
f x y z x y z x y z x y z
f x y (z z) y z(x x)
f x y 1 y z1f x y y z
TU-DelftTI1400/11-PDS
23
Karnaugh maps (1)
• Alternative geometrical method
00 01 11 10
00 1 1 0 1
01 1 1 0 1
11 0 0 0 0
10 1 1 1 0
x yv w
f v x v w x v w y v x y
TU-DelftTI1400/11-PDS
24
Karnaugh maps (2)
w
v
y
x
Different drawing
TU-DelftTI1400/11-PDS
25
Don’t Cares
• Some outputs are indifferent• Can be used for minimization
x y f
0 0 01 0 10 1 d1 1 1
TU-DelftTI1400/11-PDS
26
NAND and NOR gates
• NAND and NOR gates are universal• They are easy to realize
de Morgan’s Laws
x y x y
x y x y
TU-DelftTI1400/11-PDS
Outline
1. Basics of Boolean algebra and digital implementation2. Sum of products form and digital implementation3. Functional Units4. Repeated Operations5. Other Building Blocks
TU-DelftTI1400/11-PDS
28
Delay
• Every network of gates has delays
input
output
transition time
propagation delay
1
0
1
0time
TU-DelftTI1400/11-PDS
29
Packaging
Vcc
Gnd
TU-DelftTI1400/11-PDS
30
Making functions
time
A,B Y
delay
A
BYADD
nand gates
TU-DelftTI1400/11-PDS
31
Functional Units
• It would be very uneconomical to construct separate combinatorial circuits for every function needed
• Hence, functional units are parameterized• A specific function is activated by a special control
string F
TU-DelftTI1400/11-PDS
32
Arithmetic and Logic Unit
F add subtract compare or
f1 f0 0 0 0 1 1 0 1 1
A
BYF
F
F
A B
Y
F
TU-DelftTI1400/11-PDS
Outline
1. Basics of Boolean algebra and digital implementation2. Sum of products form and digital implementation3. Functional Units4. Repeated Operations5. Other Building Blocks
TU-DelftTI1400/11-PDS
34
Repeated operations
• Y : = Y + Bi, i=1..n
• Repeated addition requires feedback• Cannot be done without intermediate storage of
results
BYF
F
TU-DelftTI1400/11-PDS
35
Registers
BYF
F = storage element
TU-DelftTI1400/11-PDS
36
SR flip flop
• Storage elements are not transient and are able to hold a logic value for a certain period of time
S R Qa Qb
0 0 0/1 1/0
0 1 0 1
1 0 1 0
1 1 0 0
R
S
Qa
Qb
TU-DelftTI1400/11-PDS
37
Clocks
• In many circuits it is very convenient to have the state changed only at regular points in time
• This makes design of systems with memory elements easier
• Also, reasoning about the behavior of the system is easier
• This is done by a clock signal
clock period
TU-DelftTI1400/11-PDS
38
D flip flop
• D flip flop samples at clock is high and stores if clock is low
Qn
Qn
C
D
D Qn+1
0 0
1 1
TU-DelftTI1400/11-PDS
39
Edge triggered flip flops
• In reality most systems are built such that the state only changes at rising edge of the clock pulse
• We also need a control signal to enable a change
state change
TU-DelftTI1400/11-PDS
40
Basic storage element
O
C
I
R/W
time
C D
Q
C
I
O
R/W
enables a state change
TU-DelftTI1400/11-PDS
Outline
1. Basics of Boolean algebra and digital implementation2. Sum of products form and digital implementation3. Functional Units4. Repeated Operations5. Other Building Blocks
TU-DelftTI1400/11-PDS
42
4-bit register
C
R/W
C D
Q
I
O
C D
Q
I
O
C D
Q
I
O
C D
Q
I
O
TU-DelftTI1400/11-PDS
43
Some basic circuits
Y
MPLEXm
A B
Y = A if m=1Y = B if m=0
Y
Decoder
A
Only output yA= 1, rest is 0
TU-DelftTI1400/11-PDS
44
Decoder
Y
Decoder
A
Only output yA= 1, rest is 0
a2
a1
0
1
2
3
a1 a2 #y0 0 00 1 11 0 21 1 3
TU-DelftTI1400/11-PDS
45
Multiplexer
Y
MPLEXm
A B
Y = A if m=1Y = B if m=0
y
m
a
b
TU-DelftTI1400/11-PDS
End of Lecture
• Comments?• Questions?
TU-DelftTI1400/11-PDS
47
Memory
REG1
REG2
REG3
REG4
mplex
decoder
Address
Din
Dout
R/W
TU-DelftTI1400/11-PDS
48
Counter
MPLEX
INC
0001
R/W
preset
output
REG
TU-DelftTI1400/11-PDS
49
Sequential circuits
• The counter example shows that systems have state
• The state of such systems depend on the current inputs and the sequence of previous inputs
• The state of a system is the union of the values of the memory elements of that system
TU-DelftTI1400/11-PDS
50
State diagrams
• We call the change from one state to another a state transition
• Can be represented as a state diagram
S0 S1
S2
state
0 0 S00 1 S11 0 S20 0 S0
code
TU-DelftTI1400/11-PDS
51
Conditional Change
S0 S1
S2
x=0
x=1
Presentstate
Nextx=0
Statex=1
S0 S1 S2
S1 S2 S2
S2 S0 S0
TU-DelftTI1400/11-PDS
52
Coding of State
Presentstate
yz
Nextx=0YZ
Statex=1YZ
00 01 10
01 10 10
10 00 00
TU-DelftTI1400/11-PDS
53
Put in Karnaugh map
0 0 d 1
1 0 d 1x
y
z
1 0 d 0
0 0 d 0x
y
z
Y
Z
Y x y z
Z x y z (x z)y
TU-DelftTI1400/11-PDS
54
Scheme
DQ
DQ
x
Y
Z
z
y
x y
x y z
x z
(x z)y
TU-DelftTI1400/11-PDS
55
General scheme
Combinatorial Logic
Delay elements
Inputs Outputs
TU-DelftTI1400/11-PDS
56
Procedure FST
1. Make State Diagram2. Make State Table3. Give States binary code4. Put state update functions in Karnaugh Map5. Make combinatorial circuit to realize functions
Top Related