- UID
- 857714
|
我最近做一个PLD的实验,扫描键盘好像有问题,下面是我的程序,不知道谁可以帮忙分析下
module read(pin,pout,bcd,clk);
input [3:0]pin;
input clk;
output [2:0]pout;
output [6:0]bcd;
reg [2:0]pout;
reg [6:0]bcd;
[email=always@(posedge]always@(posedge[/email] clk)
begin
pout<=3'b100;
if(pin)
begin
bcd[6:3]=pin;
bcd[2:0]=pout;
end
pout<=3'b010;
if (pin)
begin
bcd[6:3]=pin;
bcd[2:0]=pout;
end
pout<=3'b001;
if(pin)
begin
bcd[6:3]=pin;
bcd[2:0]=pout;
end
end
endmodule |
|