?? sp.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 + -