文档详情

电子信息工程专业基础课.ppt

发布:2018-08-23约2.25万字共104页下载文档
文本预览下载声明
EDA 技术 唐英杰 module ADDER4BIT ( Ain, Bin, SUM, OVF); input [3:0] Ain, Bin; output [3:0] SUM; output OVF; assign {OVF, SUM} = Ain +Bin; Endmodule 这种描述方法比较直观,可以直接用综合器转换为门级组合逻辑互相连接的描述。仍然用同样的测试模块测试。这种描述使得逻辑关系更容易明白。 module mult_8 ( x, y, product); input [7:0] x, y; output [15:0] product; assign product =x*y; Endmodule module compare ( x, y, xgy,xsy,xey); input [width-1:0] x, y; output [15:0] xgy,xsy,xey; reg xgy,xsy,xey Parameter width = 8; always @(x or y) begin if (x==y) xey = 1; else xey = 0; if (xy) xgy = 1; else xgy = 0; if (xy) xsy = 1; else xsy = 0; end endmodule module mux_8 ( addr,in1,in2,in3,in4,in5,in6,in7,in8,mout,ncs); input [2:0] addr; input[width-1:0] in1,in2,in3,in4,in5,in6,in7,in8; input ncs; ouput [width-1:0] mout; parameter width = 8; always @(addr or in1 or in2 or in3 or in4 or in5 or in6 or in7 or in8 or ncs) begin if (!ncs) case (addr) 3’b000 mout = in1; 3’b001 mout = in2; 3’b010 mout = in3; 3’b011 mout = in4; 3’b100 mout = in5; 3’b101 mout = in6; 3’b110 mout = in7; 3’b111 mout = in8; endcase else mout = 0; 第五章 Verilog HDL 语言(二) 比赛结束 FinalResult B的1分 Bscore A得1分 Ascore 球从B向 A移动 B to A 球从A向B移动 A to B 等待状态,等待A或B方的开球 WaitState 含义 状态 第五章 Verilog HDL 语言(二) FinalResult WaitState A to B BScore AScore B to A Reset=1 一方达到21分 A击球 B击球 B接到球 A接到球 B提前击球 未接到球 A提前击球 未接到球 第五章 Verilog HDL 语言(二) 第五章 Verilog HDL 语言(二) 第五章 Verilog HDL 语言(二) 第五章 Verilog HDL 语言(二) 第五章 Verilog HDL 语言(二) 第五章 Verilog HDL 语言(二) 第五章 Verilog HDL 语言(二) 第五章 Verilog HDL 语言(二) 第五章 Verilog HDL 语言(二) 2、状态化简: 如果在状态转换图中出现了这样两个状态:它们在相同的输入下转换到同一状态去,并得到相同的输出,则称它们为等价状态。显然等价状态是重复的,可以合并为一个。电路的状态数越少,存储电路也就越简单。状态化简的目的就在于将等价状态尽可能地合并,以得到最简的状态转换图。 3、状态分配: 状态分配有称状态编码。通常有很多编码方法,编码方案选择得当,设计的电路可以简单;反之,选得不好,则设计的电路就会复杂许多。在实际设计时,
显示全部
相似文档