CS 2204: Digital Circuits
Lecture 5
More behavioural constructions
Now use the standar “=”
operator instead of the
assign.
– x=y; //”Blocking”
assignment similar to
s/w. Happens ONCE and
you move on to the next
statement. If y changes
subsequently, x will NOT
be updated
If s equals 0
(exactly like
C/C++)else
No. If inputs x1, x2 or s change, f is NOT
re-evaluated.
More behavioural constructions
Now use the standar “=”
operator instead of the
assign.
– x=y; //”Blocking”
assignment similar to
s/w. Happens ONCE and
you move on to the next
statement. If y changes
subsequently, x will NOT
be updated
“Trigger this
code any time
either x1
changes, or x2
changes or s
changes!”
More behavioural constructions
Now use the standar “=”
operator instead of the
assign.
– x=y; //”Blocking”
assignment similar to
s/w. Happens ONCE and
you move on to the next
statement. If y changes
subsequently, x will NOT
be updated
Because “=”
statements cant
“drive” outputs
reg f was NOT needed when we used the “assign” statements because assign statements
“drive” outputs. Similarly not needed for structural statements likes not(f,x)
Back to Implementing boolean logic functions
Given a Boolean function (as a truth table) how do we
implement (“synthesize”) it using NOT, AND and OR gates?
Step 1: Convert truth table to Boolean logic
function
Step 2: Simplify the logic function
Converting truth table to boolean logic fn
We will begin by studying the so-called
“sum-of-products” form
Each entry of a
truth-table is associated
with a “min-term.”
A Boolean function f can
be written as the “sum/OR”
of minterms for which f=1
Example SOP form
Simplifying further
Gate level realization
From sop to pos
We can also write f in “product-of-sum”
form as follows
Each entry of a
truth-table is also
associated with a
“max-term.” E.g.
A Boolean function f can
be written as the
“product” of maxterms
over rows for which f=0
Example pos form
Example pos form
Implementation using and/or gates
Minimization using k-maps
Consider the truth table:
1
1
0
1
Can we speed this up?
K = “Karnaugh”
k-map
First re-arrange your truth table as 2-d “map”
1
1
0
1
1
1 1
0
k-map
1
1 1
0
More examples
1 1
0 0
1 0
0 1
0 0
0 1
3-variable k-maps
Combination rules
1
11
1