베릴로그 스니펫 Resettable D flip-flop

베릴로그 | 2010/11/14 18:50 | Posted by DMW
크리에이티브 커먼즈 라이선스
Creative Commons License
D flip-flop with asynchronous active low reset
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// async active low reset d_ff
module d_ff(
      input        wire     clock
    , input        wire     reset
    , input        wire     d
    , output       reg      q
);

    always @(posedge clock or negedge reset) begin
        if(~reset) 
            q <= 1'b0;
        else
            q <= d;
    end
endmodule

D flip-flop with synchronous active low reset
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// sync active low reset d_ff
module d_ff(
      input        wire       clock
    , input        wire       reset
    , input        wire       d
    , output       reg        q
);

    always @(posedge clock) begin
        if(~reset) 
            q <= 1'b0;
        else
            q <= d;
    end
endmodule



저작자 표시 비영리 동일 조건 변경 허락

댓글을 달아 주세요

  1. 유노 2010/11/17 17:21  댓글주소  수정/삭제  댓글쓰기

    wire? 시뮬레이터에 표시할 때 쓰는거임?
    허굽허굽~

  2. Favicon of http://montanaviyas.tistory.com BlogIcon 멋진☆윤호™ 2011/03/25 22:08  댓글주소  수정/삭제  댓글쓰기

    물리적인 상태에서 연결하는 선을 표현하는 것이로군.
    거미줄.. ㅋㅋ 이해했음. ㅋ