下面是一个8-3编码器的程序,请将程序补充完整。module code83(in,out);input [7:0] in;output [2:0] out;function [2:0] code;input [7:0] din;(1)8’b1xxx_xxxx:code=3’h7;8’b01xx_xxxx:code=3’h6;8’b001x_xxxx:code=3’h5;8’b0001_xxxx:code=3’h4;8’b0000_1xxx:code=3’h3;8’b0000_01xx:code=3’h2;8’b0000_001x:code=3’h1;8’b0000_000x:code=3’h0;endcase(2)assign (3)endmodule
下面是一个8位向左移的移位寄存器的程序,具有同步清零,低电平有效,请将程序补充完整。module shift8(input din, clk, clr,output [7:0] dout);(1)always @(posedge clk)begin(2)dout <= 8'b0;elsebegindout <= dout<<1;(3)endendendmodule