写做时间:2020-10-31异步
目录:
1.典型电路的设计与最基础知识
-1.1 全加器
-1.2 数据通路
-1.3 计数器
-1.4 算术操做
-1.5 逻辑操做
-1.6 移位操做
-1.7 时序操做
-1.8 ALU
-1.9 有限状态机
-1.10 三态总线
2.经常使用电路设计(须要彻底搞懂)
-2.1 CRC校验码产生器
-2.2 随机数产生
-2.3 双口RAM
-2.4 同步FIFO
-2.5 异步FIFO
学习
学习思路:
先学好基本的模块,理解消化后,是基础。再学习一些经常使用电路,而后慢慢的就能够进行项目设计。
spa
正文:
1.典型电路的设计与最基础知识
-1.1 全加器
设计
module FULLADDR(Cout, Sum, Ain, Bin, Cin); input Ain, Bin, Cin; output Sum, Cout; wire Sum; wire Cout; assign Sum = Ain ^ Bin ^ Cin; assign Cout = (Ain & Bin) | (Bin & Cin) | (Ain & Cin); endmodule
-1.2 数据通路
-1.2.1四选一的多路选择器
code
//Example of a mux4-1. module MUX( C,D,E,F,S,Mux_out); input C,D,E,F ; //input input [1:0] S ; //select control output Mux_out ; //result reg Mux_out ; //mux always@(C or D or E or F or S) begin case (S) 2'b00 : Mux_out = C ; 2'b01 : Mux_out = D ; 2'b10 : Mux_out = E ; default : Mux_out = F ; endcase end
-1.2.2译码器blog
//Example of a 3-8 decoder module DECODE(Ain,En,Yout); input En ; //enable input [2:0] Ain ; //input code output [7:0] Yout ; reg [7:0] Yout ; always@(En or Ain) begin if(!En) Yout = 8'b0 ; else case (Ain) 3'b000 : Yout = 8'b0000_0001 ; 3'b001 : Yout = 8'b0000_0010 ; 3'b010 : Yout = 8'b0000_0100 ; 3'b011 : Yout = 8'b0000_1000 ; 3'b100 : Yout = 8'b0001_0000 ; 3'b101 : Yout = 8'b0010_0000 ; 3'b110 : Yout = 8'b0100_0000 ; 3'b111 : Yout = 8'b1000_0000 ; default : Yout = 8'b0000_0000 ; endcase end endmodule
-1.3 计数器图片
在这里插入代码片
-1.4 算术操做
-1.5 逻辑操做
-1.6 移位操做
-1.7 时序操做
-1.8 ALU
-1.9 有限状态机
-1.10 三态总线
input
1.2数据通路同步
THE END~class