OpenCores
URL https://opencores.org/ocsvn/pairing/pairing/trunk

Subversion Repositories pairing

[/] [pairing/] [trunk/] [rtl/] [fun.v] - Diff between revs 3 and 5

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 3 Rev 5
Line 1... Line 1...
 
// fun.v: Have you got fun reading the code ?
 
`include "inc.v"
 
 
 
// turn "00000001111111111111111" into "00000001000000000000000"
 
module func6(clk, in, out);
 
    input clk, in;
 
    output out;
 
    reg reg1, reg2;
 
    always @ (posedge clk)
 
      begin
 
        reg1 <= in; reg2 <= reg1;
 
      end
 
    assign out = {reg2,reg1}==2'b01 ? 1 : 0;
 
endmodule
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.