Entity: oh_debouncer

Diagram

BOUNCE FREQUENCY SYN TYPE integer COUNTER_WIDTH clk nreset noisy_in clean_out

Description

#############################################################################

Function: A digital debouncer circuit

#############################################################################

Author: Andreas Olofsson

License: MIT (see LICENSE file in OH! repository)

#############################################################################

Generics

Generic name Type Value Description
BOUNCE 100 bounce time (s)
FREQUENCY 1000000 clock frequency (1Mhz)
SYN "TRUE" synthesizable (or not)
TYPE "DEFAULT" scell type/size
COUNTER_WIDTH integer $clog2(BOUNCE*FREQUENCY)

Ports

Port name Direction Type Description
clk input clock to synchronize to
nreset input syncronous active high reset
noisy_in input noisy input signal to filter
clean_out output clean signal to logic

Signals

Name Type Description
noisy_reg reg regs
clean_reg reg

Processes

Type: always

Description
detecting change in state on input

Type: always

Description
sample noisy signal safely

Instantiations

Description
synchronize incoming signal

Description
synchronize reset to clk

Description
synchronous counter "filter"