`timescale 1ns / 1ps
//
// Company:
// Engineer:
//
// Create Date: 2017/08/18 15:20:41
// Design Name:
// Module Name: devided
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//
module devided(
clk,
rst_n,
a,
b,
result,
remainder
);
input clk;
input rst_n;
input [15:0] a; // 被除数
input [7:0] b; //除数
output reg [15:0] result; // 商
output [7:0] remainder;//余数
reg [22:0] mid_a ;
reg [2:0] state;
reg [6:0] diff;
reg [4:0] cnt;
always@(posedge clk or negedge rst_n) begin
if(!rst_n)begin
mid_a <= {7'd0
除法器FPGA实现
最新推荐文章于 2024-06-13 18:31:14 发布
本文介绍了使用FPGA实现除法器的过程,通过资源利用表和状态机仿真图展示设计细节,最终得出正确答案result为8,余数remainder为0。
摘要由CSDN通过智能技术生成