|
always @(posedge clk)
begin
d<=d+1'b1;
end
always @(d)
begin
case(d)
9'h1:dataout = 1'b0;
9'h2:dataout = 1'b0;
9'h3:dataout = 1'b0;
9'h4:dataout = 1'b0;
9'h5:dataout = 1'b0;
9'h6:dataout = 1'b0;
9'h7:dataout = 1'b1;
9'h8:dataout = 1'b0;
default:dataout = 0;
endcase
end
一个I/O口串行送数dataout (一次送一位2进制数),h1--h9 上面代码中I/O(dataout)向外送了一数 02H(0000 0010);我想知道有没有什么别的方法送,不需要用case一个一个列出来,就是写一个02H 然后通过 循环移位送出来.我这样写太烦琐了,因为要是10个8位的十六进制的数的话,就需要用case列出80行的代码,请问下有没有什么好的方法 取代我的用case 送数,谢谢了. |
阿莫论坛20周年了!感谢大家的支持与爱护!!
一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。
|