【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch04
2011-03-12 13:21
2571 查看
Chapter 4. Modules and Ports
4.5 Exercises
1. What are the basic components of a module? Which components are mandatory?my answer:
1) Module Name, Port List, Port Declarations, Parameters, Declarations of wires, regs and other variables, Data flow statements, Instantiation of lower level modules, always and initial blocks, Tasks and functions, endmodule statement.
2) module, module name,and endmodule.
2. Does a module that does not interact with its environment have any I/O ports? Does it have a port list in the module definition?
my answer:
1) have
2) no
3. A 4-bit parallel shift register has I/O pins as shown in the figure bellow. Write the module definition for this module shift_reg. Include the list of ports and port declarations. You do not need to show the internals.
my answer:
module shift_reg(reg_out,reg_in,clock);
output reg [3:0]reg_out;
input [3:0]reg_in;
input clock;
endmodule
4. Declare a top-level module stimulus. Define REG_IN(4-bit)and CLK(1-bit)as reg register variables and REG_OUT(4-bit)as wire. Instanitiate the module shift_reg and call it sr1. Connect the ports by ordered list.
my answer:
module stimulus;
reg [3:0]REG_IN;
reg CLK;
wire [3:0]REG_OUT;
shift_reg sr1(REG_OUT,REG_IN,CLK);
endmodule
5. Connect the ports in Step 4 by name.
my answer:
shift_reg(.reg_out(REG_OUT),.reg_in(REG_IN),.clock(CLK));
6.Write the hierarchical names for variables REG_IN,CLK,REG_OUT;
my answer:
stimulus.REG_IN, stimulus.CLK, stimulus.REG_OUT
7. Write the hierarchical name for the instance sr1. Write the hierarchical names for its ports clock and reg_in.
my answer:
stimulus.sr1,
stimulus.sr1.clock
stimulus.sr1.reg_in
Reference
Smair Palnitkar, <Verilog HDL: A Guide to Digital Design and Synthesis (2nd) >相关文章推荐
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)—ch07-II
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch03
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch06
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch12
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch05
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch10
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch08
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch02
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)—ch07-III
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch09
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)—ch07-I
- Guide to Television and Video Technology, Fourth Edition: The Guide for the Digital Age - from HDTV,
- How to design DL model(2):Inception(v4)-ResNet and the Impact of Residual Connections on Learning
- The Semantic Web : A Guide to the Future of XML, Web Services, and Knowledge Management
- The Essential Guide to User Interface Design: An Introduction to GUI Design Principles and Technique
- Design and Usability of Digital Libraries: Case Studies in the Asia Pacific
- The Essential Guide to CSS and HTML Web Design
- A step-by-step guide to the use of the Intel OpenCV library and the Microsoft DirectShow technology
- A Guide to Blocks & Grand Central Dispatch (and the Cocoa API's making use of them)
- 《The Scientist and Engineer's Guide to Digital Signal Processing 》Study Noting