# sinahileon/stopwatch-in-verilog architecture

> Architecture diagram of the GitHub repository sinahileon/stopwatch-in-verilog, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sinahileon/stopwatch-in-verilog
- Repository: https://github.com/sinahileon/stopwatch-in-verilog

## Overview

This repository implements an FPGA stopwatch in Verilog. Its documented concepts include sequential state, counters, reset/control inputs, and clock division; the tree also names BCD counting and seven-segment conversion. No source excerpts were provided, so the exact top-level wiring and which counter/divider variants participate in the stopwatch are unverified. The testbench is excluded as non-product code.

Main entry points: [`stopwatch_top.v`](https://github.com/sinahileon/stopwatch-in-verilog/blob/main/stopwatch_top.v) (Stopwatch top), [`bcd_counter_0_9.v`](https://github.com/sinahileon/stopwatch-in-verilog/blob/main/bcd_counter_0_9.v) (BCD counter), [`simple_counter.v`](https://github.com/sinahileon/stopwatch-in-verilog/blob/main/simple_counter.v) (Simple counter), [`clock_divider_50Mhz_to_1Hz.v`](https://github.com/sinahileon/stopwatch-in-verilog/blob/main/clock_divider_50Mhz_to_1Hz.v) (1 Hz divider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_timing["Clocking"]
  node_clock_divider["1 Hz divider"]
  node_simple_divider["Simple divider<br/>[simple_divider.v]"]
end

subgraph group_state["Counting and State"]
  node_stopwatch_top["Stopwatch top<br/>[stopwatch_top.v]"]
  node_bcd_counter["BCD counter<br/>[bcd_counter_0_9.v]"]
  node_simple_counter["Simple counter<br/>[simple_counter.v]"]
  node_d_flip_flop["D flip-flop<br/>[D_flip_flop.v]"]
end

subgraph group_display["Display"]
  node_bcd_display["Seven-segment encoder<br/>[bcd_to_sev_seg.v]"]
end

node_clock(("Fast clock"))

node_clock -->|"slows"| node_clock_divider
node_stopwatch_top -.->|"may use"| node_clock_divider
node_stopwatch_top -.->|"may use"| node_simple_divider
node_stopwatch_top -.->|"may use"| node_bcd_counter
node_stopwatch_top -.->|"may use"| node_simple_counter
node_stopwatch_top -.->|"may use"| node_bcd_display
node_bcd_counter -.->|"stores state"| node_d_flip_flop
node_simple_counter -.->|"stores state"| node_d_flip_flop

click node_clock_divider "https://github.com/sinahileon/stopwatch-in-verilog/blob/main/clock_divider_50Mhz_to_1Hz.v"
click node_simple_divider "https://github.com/sinahileon/stopwatch-in-verilog/blob/main/simple_divider.v"
click node_stopwatch_top "https://github.com/sinahileon/stopwatch-in-verilog/blob/main/stopwatch_top.v"
click node_bcd_counter "https://github.com/sinahileon/stopwatch-in-verilog/blob/main/bcd_counter_0_9.v"
click node_simple_counter "https://github.com/sinahileon/stopwatch-in-verilog/blob/main/simple_counter.v"
click node_d_flip_flop "https://github.com/sinahileon/stopwatch-in-verilog/blob/main/D_flip_flop.v"
click node_bcd_display "https://github.com/sinahileon/stopwatch-in-verilog/blob/main/bcd_to_sev_seg.v"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_clock_divider,node_simple_divider toneBlue
class node_stopwatch_top,node_bcd_counter,node_simple_counter,node_d_flip_flop toneAmber
class node_bcd_display toneMint
class node_clock toneIndigo
```

## Components

### Clocking

- [1 Hz divider](https://github.com/sinahileon/stopwatch-in-verilog/blob/main/clock_divider_50Mhz_to_1Hz.v): `clock_divider_50Mhz_to_1Hz.v`
- [Simple divider](https://github.com/sinahileon/stopwatch-in-verilog/blob/main/simple_divider.v): `simple_divider.v`

### Counting and State

- [Stopwatch top](https://github.com/sinahileon/stopwatch-in-verilog/blob/main/stopwatch_top.v): `stopwatch_top.v`
- [BCD counter](https://github.com/sinahileon/stopwatch-in-verilog/blob/main/bcd_counter_0_9.v): `bcd_counter_0_9.v`
- [Simple counter](https://github.com/sinahileon/stopwatch-in-verilog/blob/main/simple_counter.v): `simple_counter.v`
- [D flip-flop](https://github.com/sinahileon/stopwatch-in-verilog/blob/main/D_flip_flop.v): `D_flip_flop.v`

### Display

- [Seven-segment encoder](https://github.com/sinahileon/stopwatch-in-verilog/blob/main/bcd_to_sev_seg.v): `bcd_to_sev_seg.v`

### Other components

- **Fast clock**

## Connections

- Fast clock → 1 Hz divider: slows (evidence: `README.md`)
- Stopwatch top → 1 Hz divider: may use
- Stopwatch top → Simple divider: may use
- Stopwatch top → BCD counter: may use
- Stopwatch top → Simple counter: may use
- Stopwatch top → Seven-segment encoder: may use
- BCD counter → D flip-flop: stores state
- Simple counter → D flip-flop: stores state
