📄 booth.v
字号:
module booth (x,y,out,signal);input [15:0] x;input [2:0] y;output [16:0] out;output signal;wire [15:0] x;wire [2:0] y;reg [16:0] out;reg signal;reg [16:0] temp_out;integer i;always @(x or y ) begin case(y) 3'b000: begin out[16:0] = 0; signal=0; end 3'b001: begin out[15:0]=x; out[16] = x[15]; signal=0; end 3'b010: begin out[15:0]=x; out[16] = x[15]; signal=0; end 3'b011:begin out[0]=0; for (i=0;i<15;i=i+1) out[i+1]=x[i]; out[16] = x[15]; signal=0; end 3'b100:begin temp_out[0]=0; for (i=0;i<16;i=i+1) temp_out[i+1]=x[i]; out=~temp_out; signal=1; end 3'b101:begin temp_out[15:0]=x; out[15:0]=~temp_out[15:0]; out[16]=~x[15]; signal=1; end 3'b110:begin temp_out[15:0]=x; out[15:0]=~temp_out[15:0]; out[16]=~x[15]; signal=1; end 3'b111: begin out[16:0] = 17'b11111111111111111; signal=1; end endcase end endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -