⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sp.v

📁 cup 的设计源代码
💻 V
字号:
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer:
//
// Create Date:    19:54:15 10/08/08
// Design Name:    
// Module Name:    SP
// Project Name:   
// Target Device:  
// Tool versions:  
// Description:
//
// Dependencies:
// 
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
// 
////////////////////////////////////////////////////////////////////////////////
module SP(clk, rst, inc_enable, dec_enable, SP_out);
    parameter width=8;

    input clk;
    input rst;
    input inc_enable;
    input dec_enable;
    output[width-1:0] SP_out;
    
    reg[width-1:0] SP_out;

    always@(posedge clk or negedge rst)
    begin
        if(~rst)
            SP_out<='b11111111;
        else if(dec_enable)
            SP_out<=SP_out-1;
        else if(inc_enable)
            SP_out<=SP_out+1;
        else
            SP_out<=SP_out;
    end

endmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -