Uploaded by dsb wzw

6 Design Verilog Structural Instances

advertisement
EEC554/4
Digital Integrated
Circuit Design
Digital Circuit Design with Verilog :
Connection of Instances
Associate Prof. Dr. Bakhtiar Affendi Bin
Rosdi
eebakhtiar@usm.my
Ext : 6083
Room No. : 4.09
Module internals
 Internals of each module
 Can be described based on
 Structural : Function is performed by connections of
components
 Connection of instances
 Connection of primitive gates
 Behavioral : What the circuit will do, not how to
build it in h/ware
 Continuous Assignment (assign statement)
 Procedural Constructs (always, initial block)
 Can mix structural and behavioral
Connection of instances
Instances
 Module is a template
 Actual objects are created from a module
 Each object has its own
 Name, variables, parameters and I/O interface
 Process creating objects from module
 called instantiation
 created objects are called instances
Hierarchical Design
 In general, a digital circuit is designed hierarchically
 Examples:-
By Tan Chee Wei (2013)
Hierarchical Design
 In general, a digital circuit is designed hierarchically
 Examples:-
By Tan Yong Tat (2013)
Hierarchical Design
 In general, a digital circuit is designed hierarchically
 Examples:-
By Ching Chee Chow (2015)
Hierarchical Design
 In general, a digital circuit is designed hierarchically
 Examples:-
By Ng Xin Yi (2016)
Hierarchical Design
 In general, a digital circuit is designed hierarchically
 Examples:-
By Mohamed Hassan (2017)
Hierarchical Design
 In general, a digital circuit is designed hierarchically
 Examples:-
By Dineis Mani (2018)
Hierarchical Design
 In general, a digital circuit is designed hierarchically
 Examples:-
By Lew King Yew (2019)
Hierarchical Design
 In general, a digital circuit is designed hierarchically
 Examples:-
By Yana Tejasukmana (2022)
Example 1 : 1-bit Full Adder
 Design a 1-bit Full adder by instantiating 1-bit Half Adder
cin
cout
a
b
FA
sum
How to instantiate following module to be FA?
cout
a
b
HA
sum
Example 1 : 1-bit Full Adder
 Design a 1-bit Full adder by instantiating 1-bit Half Adder
FA
c1
s1
c2
img source : http://en.wikibooks.org/wiki/Practical_Electronics/Adders
Example 2 : 4-bit Ripple Carry Adder
 Design a 4-bit Ripple carry adder by instantiating 1-bit Full
Adder
cin
cout
a
FA
b
sum
cin
a
4
cout
FA
b
4
sum
4
Example 2 : 4-bit Ripple Carry Adder
Block Diagram
a[0] b[0]
c_in
Full
adder
fa0
a[1] b[1]
c1
sum[0]
Full
adder
fa1
a[2] b[2]
c2
sum[1]
Full
adder
fa2
a[3] b[3]
c3
sum[2]
Full
adder
fa3
c_out
sum[2]
Example 2 : 4-bit Ripple Carry Adder
Example 3 : Simple ALU
 Design a simple ALU with following specification
 If s = 0, out = (x & y)
 If s = 1, out = (y or ~z)
 s, x, y and z are 1-bit
 You have to use concept of connection of instances for the top
level module, where the top level module only consists of low
level modules. You have to use connection of gates for low level
module.
y | ~z
x
y
z
s
mux
2-1
x&y
out
Example 3 : Simple ALU
Download