【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch08
2011-03-22 10:03
1716 查看
Chapter 8. Tasks and Functions
8.5 Exercises
1. Define a function to calculate the factorial of a 4-bit number. The output is a 32-bit value. Invoke the function by using stimulus and check results.my answer:
# Factorial of 4 is 3628800
2. Define a function to multiply two 4-bit numbers a and b. The output is an 8-bit value. Invoke the function by using stimulus and check results.
my answer:
# a x b= 150
3. Define a function to design an 8-function ALU that takes two 4-bit numbers a and b and computes a 5-bit result out based on a 3-bit select signal. Ignore overflow or underflow bits.
Select Signal | Function Output |
3’b000 | a |
3’b001 | a+b |
3’b010 | a-b |
3’b011 | a/b |
3’b100 | a%b |
3’b101 | a<<1 |
3’b110 | a>>1 |
3’b111 | (a>b) |
4. Define a task to compute the factorial of 4-bit number. The output is a 32-bit value. The result is assigned to the output after a delay of 10 time units.
my answer:
5. Define a task to compute even parity of a 16-bit number. The result is a 1-bit value that is assigned to the output after three positive edges of clock.(Hint: Use a repeat loop in the task).
my answer:
6. Using named events, tasks, and functions, design the traffic signal controller .
my answer:
相关文章推荐
- 【原创】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)—ch07-II
- 【原创】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)--ch06
- 【原创】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)--ch05
- 【原创】The solutional manual of the Verilog HDL: A Guide to Digital Design and Synthesis (2nd)--ch04
- 【原创】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)--ch09
- 【原创】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)—ch07-I
- The Scientist and Engineer's Guide to Digital Signal Processing一书的阅读总结
- Guide to Television and Video Technology, Fourth Edition: The Guide for the Digital Age - from HDTV,
- 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
- Introduction to The Design and Analysis of Algorithms (1)
- The Essential Guide to CSS and HTML Web Design
- 《The Scientist and Engineer's Guide to Digital Signal Processing 》Study Noting
- How to design DL model(2):Inception(v4)-ResNet and the Impact of Residual Connections on Learning