?? sbox66.v
字號:
module sbox66(sin,sout);
input [0:5] sin;
output [0:3] sout;
reg [0:3] sout;
always @(sin)
begin
case ({sin[0],sin[5]})
2'b00:
case (sin[1:4])
4'h0: sout=4'hc;
4'h1: sout=4'h1;
4'h2: sout=4'ha;
4'h3: sout=4'hf;
4'h4: sout=4'h9;
4'h5: sout=4'h2;
4'h6: sout=4'h6;
4'h7: sout=4'h8;
4'h8: sout=4'h0;
4'h9: sout=4'hd;
4'ha: sout=4'h3;
4'hb: sout=4'h4;
4'hc: sout=4'he;
4'hd: sout=4'h7;
4'he: sout=4'h5;
4'hf: sout=4'hb;
endcase
2'b01:
case (sin[1:4])
4'h0: sout=4'ha;
4'h1: sout=4'hf;
4'h2: sout=4'h4;
4'h3: sout=4'h2;
4'h4: sout=4'h7;
4'h5: sout=4'hc;
4'h6: sout=4'h9;
4'h7: sout=4'h5;
4'h8: sout=4'h6;
4'h9: sout=4'h1;
4'ha: sout=4'hd;
4'hb: sout=4'he;
4'hc: sout=4'h0;
4'hd: sout=4'hb;
4'he: sout=4'h3;
4'hf: sout=4'h8;
endcase
2'b10:
case (sin[1:4])
4'h0: sout=4'h9;
4'h1: sout=4'he;
4'h2: sout=4'hf;
4'h3: sout=4'h5;
4'h4: sout=4'h2;
4'h5: sout=4'h8;
4'h6: sout=4'hc;
4'h7: sout=4'h3;
4'h8: sout=4'h7;
4'h9: sout=4'h0;
4'ha: sout=4'h4;
4'hb: sout=4'ha;
4'hc: sout=4'h1;
4'hd: sout=4'hd;
4'he: sout=4'hb;
4'hf: sout=4'h6;
endcase
2'b11:
case (sin[1:4])
4'h0: sout=4'h4;
4'h1: sout=4'h3;
4'h2: sout=4'h2;
4'h3: sout=4'hc;
4'h4: sout=4'h9;
4'h5: sout=4'h5;
4'h6: sout=4'hf;
4'h7: sout=4'ha;
4'h8: sout=4'hb;
4'h9: sout=4'he;
4'ha: sout=4'h1;
4'hb: sout=4'h7;
4'hc: sout=4'h6;
4'hd: sout=4'h0;
4'he: sout=4'h8;
4'hf: sout=4'hd;
endcase
endcase
end
endmodule
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -