这里我有一个移位器,但现在它最多只能工作 3 位。我一直在寻找,但不知道如何让它工作最多 8 位。
module shifter(a,b,out);
input [7:0] a, b;
output [7:0] out;
wire [7:0] out1, out2, out3;
mux_8b_2to1 first(a[7:0], {a[3:0],a[7:4]}, b[2], out1);
mux_8b_2to1 second(out1[7:0], {out1[5:0],out1[7:6]}, b[1], out2);
mux_8b_2to1 third(out2[7:0], {out2[6:0],out2[7]}, b[0], out);
endmodule
Run Code Online (Sandbox Code Playgroud) 我刚接受了期中考试,但无法回答这个问题.
有人可以给出一些语言的例子,并为语言构建一个语法,或者 至少告诉我如何去做它?
另外如何编写语法L:
L = {a n b m | n,m = 0,1,2,...,n <= 2m}?
提前致谢.
grammar context-free-grammar computation-theory context-sensitive-grammar