////////////////////////////////////////////////////////////////////////////////// // // Wirtualny komponent sterownika wielocyfrowego 7-segmentowego wyświetlacza LED // // (C) 2009 Zbigniew Hajduk // http://zh.kia.prz.edu.pl // ////////////////////////////////////////////////////////////////////////////////// module led_display #(parameter Nd=4,N=4*Nd) (input clk, output DA,DB,DC,DD,DE,DF,DG,DH, output [Nd-1:0] COM, input [N-1:0] data, input [Nd-1:0] DOT,ON); reg [3:0] in; reg [6:0] seg; reg [Nd-1:0] _COM; reg DT; assign COM=_COM&ON; //(1) assign {DH,DG,DF,DE,DD,DC,DB,DA}={DT,seg}; always @(posedge clk) if(_COM==0) _COM<={{Nd-1{1'b0}},1'b1}; //(2) else _COM<={_COM[0],_COM[Nd-1:1]}; //(3) always @(*) begin: mux1 integer i; in=0; DT=0; //(4) for (i=0;i