Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Write a verilog/system verilog of a normally open momentary switch toggle with delays

Status
Not open for further replies.

cesarxhc

Newbie level 1
Joined
Jan 10, 2018
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
10
How to write in verilog and/or system verilog a normally open switch with delays with the following functionality: when pressed once it outputs 1 and stays 1 when depressed, when pressed a second time it outputs 0 and stays 0 when depressed. The 1 output is instantaneous upon pressing, the 0 output only occurs if the button is pressed for a determined time. This is essentially how the power button in desktops work: if computer is off pressing the button starts the computer but, if the computer is on, the button requires to be pressed for several seconds.
 

Is it a Verilog software exercise or a hardware design? In the latter case, you need a clock to implement the delay timer and key debouncing.

A PC realizes the respective function in the BIOS firmware. You probably noticed that the off-delay becomes effective after the operation system has booted, you have a fast turn-off function during initial boot phase.
 

    V

    Points: 2
    Helpful Answer Positive Rating
How to write in verilog and/or system verilog a normally open switch with delays with the following functionality: when pressed once it outputs 1 and stays 1 when depressed, when pressed a second time it outputs 0 and stays 0 when depressed. The 1 output is instantaneous upon pressing, the 0 output only occurs if the button is pressed for a determined time. This is essentially how the power button in desktops work: if computer is off pressing the button starts the computer but, if the computer is on, the button requires to be pressed for several seconds.

Hello,

as more experienced colleague has written you need: clok, counter (timer), debouncer (for button/switch) and very simple "state machine"( the state machine is for remember the actual state of switch) components. Just find out how to implement these components in Verilog (Google) and then interconnect them all in your project.

Regards
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top