Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module pdm #(parameter BITS=8) (
- input clk,
- input [BITS-1:0] level,
- output out
- );
- reg [BITS-1:0] c;
- reg [BITS-1:0] swap;
- integer k;
- always@*
- for(k=0;k<BITS;k=k+1)
- swap[k]=c[BITS-1-k];
- always@(posedge clk)
- c<=c+1;
- assign out=swap<level;
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement