随笔分类 - 数字电路
摘要:一般性的指导原则 总的来说,RTL级的评判标准有许多,从时序、面积到功耗等等,都是非常重要的指标。但是这里只介绍一般性的指导原则。 1.面积和速度的平衡互换原则,这两者的目标是对立统一的关系,相互制衡。 2.硬件原则:理解HDL语言的本质,注意与软件设计区分。 3.系统原则:从整体上、全局上优化和把
阅读全文
摘要:RTL(Register transfer Level)级和综合(Synthesize)的概念 在之前我们已经谈过,HDL语言有五个层次:系统级,行为级,RTL级,门级,晶体管级。而我们主要也是在RTL级使用Verilog语言。 RTL正如它名字说的那样,主要描述的是寄存器到寄存器之间逻辑功能的实现
阅读全文
摘要:1.sim module top_module ( input a, input b, output q );// assign q = a & b; // Fix me endmodule 2.circuit2 module top_module ( input a, input b, input
阅读全文
摘要:1.Mux module top_module ( input sel, input [7:0] a, input [7:0] b, output[7:0]out ); assign out = (sel)? a : b; endmodule 这里的bug主要有两个,一是out的位宽不匹配,第二是s
阅读全文
摘要:module top_module ( input clk, input reset, output [9:0] q); always@(posedge clk) begin if(reset) q <= 10'b0; else begin if(q == 10'd999) q <= 10'b0;
阅读全文
摘要:1.Simple FSM module top_module( input clk, input areset, // Asynchronous reset to state B input in, output out);// parameter A=1'b0, B=1'b1; reg state
阅读全文
摘要:1.Shift4 module top_module( input clk, input areset, // async active-high reset to zero input load, input ena, input [3:0] data, output reg [3:0] q);
阅读全文
摘要:1.Count15 module top_module ( input clk, input reset, // Synchronous active-high reset output [3:0] q); always@(posedge clk) begin if(reset) q <= 4'b0
阅读全文
摘要:1.DFF module top_module ( input clk, // Clocks are used in sequential circuits input d, output reg q );// // Use a clocked always block // copy d to q
阅读全文
摘要:1.Kmap1 module top_module( input a, input b, input c, output out ); assign out = ~((~a)&(~b)&(~c)); endmodule 2.Kmap2 依然是卡诺图化简,观察零少还是一少去化简可能方便一些。 modu
阅读全文
摘要:从adder2开始更新 1.adder2 本题中题目已经写好adder16,切勿再写 module top_module ( input [31:0] a, input [31:0] b, output [31:0] sum );//top module contains two 16bit add
阅读全文
摘要:1.Hadd module top_module( input a, b, output cout, sum ); assign cout = a&b; assign sum = a^b; endmodule 2.Fadd module top_module( input a, b, cin, ou
阅读全文
摘要:1.Mux2to1 module top_module( input a, b, sel, output out ); assign out = (sel)? b : a; endmodule 2.Mux2to1V module top_module( input [99:0] a, b, inpu
阅读全文
摘要:1.wire module top_module ( input in, output out); assign out = in; endmodule 2.GND module top_module ( output out); assign out = 1'b0; endmodule 3.NOR
阅读全文
摘要:1.Conditional 注意:"<"是比较无符号数的大小。 module top_module ( input [7:0] a, b, c, d, output [7:0] min);// // assign intermediate_result1 = compare? true: false
阅读全文
摘要:1.Alwaysblock2 module top_module( input clk, input a, input b, output wire out_assign, output reg out_always_comb, output reg out_always_ff ); assign
阅读全文
摘要:Verilog描述方法与层次 Verilog语言有多种描述方法,这些方法也可以在多个层次上来描述硬件。 描述方式 在上一篇当中已经引入过数据流描述、行为描述、结构化描述这三种描述的方式的概念,本篇将继续深入说明这三种描述方式。 数据流描述 1.数据流 :组合逻辑电路的信号传输其实就类似于数据的流动,
阅读全文
摘要:Verilog 语言基础 三种描述方式 1.数据流描述 通常指采用assign语句进行连续赋值(continous assignment),连续赋值意味着输入的变化会立即导致输出的变化,这正是组合逻辑电路的特点。注意:assgin是不能用在always或者initial语句块中的,且通常搭配wire
阅读全文

浙公网安备 33010602011771号