s_right_shifter_16.v

来自「verilog, TMSC6415 S单元代码」· Verilog 代码 · 共 57 行

V
57
字号
`timescale 1ns/10ps/*`timescale 1ns/10psmodule S_Right_Shifter_16(src,count,unsign,result);input [15:0] src;input [4:0] count;input unsign;output [15:0] result;reg  [15:0] result;always @(unsign or src or count )begin  if(unsign) result=src>>count;  else begin    result={{16{src[15]}},src}>>count;  endendendmodule*/module S_Right_Shifter_16(src,count,unsign,result);input [15:0] src;input [4:0] count;input unsign;output [15:0] result;reg  [15:0] result;wire [4:0]count_1;assign count_1=count[4]? 5'b01111: count;always @(unsign or src or count_1 or count )begin  if(unsign) result=src>>count;  else begin    result={{16{src[15]}},src}>>count_1;       endendendmodule 

⌨️ 快捷键说明

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