• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. VerilogA SR Latch with digital output

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 126
  • Views 9998
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

VerilogA SR Latch with digital output

delgsy
delgsy over 3 years ago

Hello,

I am trying to create SR Latch with digital output with VerilogA.
Below is my code.
I wonder if someone can point me where I made mistake.

I modified always statement with above or only always without @(), still it does not work.

module verA_latch(S, R, Q, Qbar);
    input S, R;
    electrical S, R;
    output Q, Qbar;
    logic Q, Qbar;
    reg  Q, Qbar;

always @(cross(V(R)-0.6) or cross(V(S)-0.6))
    begin
        if (V(R)>0.6)
            begin
            Q = 0;
            Qbar = 1;
            end
        else        
            if (V(S)>0.6)
                begin
                Q = 1;
                Qbar = 0;
                end
            else
                begin
                Q = 0;
                Qbar = 1;
                end
    end
endmodule


***********************************************************************************************************************************
EDIT:
I check myself by trying to write verilogA code for DFF. It works.


`include "constants.vams"
`include "disciplines.vams"

module verAMS_dff (D, CLOCK, Q, Qbar );
    input D, CLOCK;
    electrical D, CLOCK;
    
    output Q, Qbar;
    logic Q, Qbar;
    reg Q, Qbar;

always @(cross(V(CLOCK)-0.6))
    begin
        if (V(D)>0.6)
            begin
                Q = 1;
                Qbar = 0;
                end
            else
                begin
                Q = 0;
                Qbar = 1;
                end
    end
endmodule

  • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information