写verilog程序时怎么提高硬件意识?是一个深奥的问题,但是如果你看了下面的程序、电路、仿真,明白什么样的程序生成什么样的电路,绝对能提高你的硬件意识,硬件意识是其中一方面,还要有系统意识。
D-type flip flop reg q; always @ (posedge clk) |
D type flip flop with asynchronous reset reg q; always @ (posedge clk or posedge reset) |
D type flip flop with synchronous reset reg q; always @ (posedge clk) |
D type flip flop with gated clock reg q; always @ (posedge gtd_clk) |
Data enbled D type flip flop reg q; always @ (posedge clk) |
Negative edge triggered D type flip flop reg q; always @ (negedge clk) |
Latch reg q; always @ (q or enable) |
Two input multiplexer (using if else) reg y; always @ (a or b or select) |
Two input multiplexer (using ternary operator ? wire t = (select ? a : b);
|
Two input multiplexer (using case statement) reg w; // mux version 3 |
Two input multiplexer (using default assignment and if) reg p; // mux version 4 |
Three input priority encoded mux multiplexer (using if else) reg q; always @ (a or b or c or select2) |
Three input multiplexer with no priority (using case) reg s; always @ (a or b or c or select2) |
上面的这些资料无意识间在一个国外的网站看到,觉得非常有用,弄出来与大家分享,不过要注意一点,FPGA内部的D触发器,带有使能端enalbe,上面的有些电路可能和实际FPGA综合后的电路有所出入,但是我相信这绝对是一份好资料。
用户377235 2014-10-20 20:23
用户1669570 2013-10-15 10:14
ash_riple_768180695 2010-3-1 09:16