基于DE2-115开发板的FPGA入门设计实验课件.docVIP

  • 74
  • 0
  • 约8.95千字
  • 约 26页
  • 2016-08-14 发布于湖北
  • 举报

基于DE2-115开发板的FPGA入门设计实验课件.doc

基于DE2-115开发板的FPGA入门设计实验 Lab1: 4位加法器、减法器的设计 1.1 摘要 在文件add_sub里面的工程文件operation_4.v为顶层文件,该顶层文件包含了三个子模块,分别为数码管显示模块,4位带进位的二进制加法器模块和4位带借位的二进制减法器模块,最后通过DE2-115开发板显示实验结果。 1.2 程序 add_4bits.v 加法器 module adder_4bits ( input clk, input rst_n, input [3:0] x, input [3:0] y, output reg [3:0] sum, output reg carry_out //溢出位 ); always@(posedge clk or negedge rst_n) begin if(!rst_n) {carry_out, sum} = 0; else {carry_out, sum} = x + y; end endmodule substractor_4bits.v减法器 module subtractor_4bits ( input clk, input rst_n, input [3:0] x, input [3:0] y, output reg [3:0] sub, outpu

文档评论(0)

1亿VIP精品文档

相关文档