Digital hardware design that reads up to 7 coordinate points from ROM, stores them in registers, selects point pairs using counters and multiplexers, computes distance and a custom metric, and continuously updates the minimum value using comparator-controlled registers.'
This project implements a hardware-based coordinate processing system using discrete digital logic components. The design reads up to seven coordinate points (xi, yi) from ROM, stores them in registers, and systematically evaluates all valid pairs of points. For each pair, the circuit computes mathematical expressions such as Euclidean distance squared and a custom metric function, while continuously tracking the minimum result using comparator-based logic.
The goal of this project is to demonstrate how algorithmic computation typically performed in software can be implemented using pure hardware datapath and control logic.
The system consists of several functional blocks working together: ROM ↓ Decoder ↓ Register Bank (Store X and Y coordinates) ↓ Multiplexer Network ↓ Arithmetic Processing Unit ↓ Comparator ↓ Minimum Value Register Each block performs a specific task in the coordinate processing pipeline.
1.Supports up to 7 coordinate points 2.Stores coordinate data using dedicated X and Y registers 3.Uses hardware counters to generate valid point pairs 4.Implements multiplexer-based point selection 5.Computes: Euclidean distance squared Custom metric function 6.Tracks the minimum value automatically 7.Fully clock-synchronized digital system
The design uses commonly available digital ICs such as: 1.ROM – Stores coordinate values 2.74LS139 – Address decoder for register selection 3.74179 Registers – Coordinate storage 4.74151 Multiplexers – Select coordinates 5.74161 Counters – Generate point indices 6.74283 Adders – Arithmetic operations 7.4585 Comparator – Minimum value detection These components collectively implement the system's datapath and control logic.
Coordinate values are stored in ROM. A decoder enables specific registers to load the data, allowing the system to store multiple coordinate pairs simultaneously.
Two hardware counters generate indices i and j, representing the selected points. These indices drive multiplexers that choose the corresponding xi, yi, xj, yj values from the register bank
The counters operate similarly to a nested loop structure, ensuring that all valid pairs of points are processed without redundancy.
For each selected pair, the system computes:
Distance:
Metric:
Each computed result is compared with the current minimum value stored in a register. If the new value is smaller, a comparator triggers the load signal to update the minimum register
All registers, counters, and control logic operate using a single system clock. This ensures synchronized updates and prevents timing mismatches between arithmetic computations and register updates.
Although implemented as a learning project, the architecture demonstrates concepts used in:
- Hardware accelerators
- Signal processing circuits
- Embedded datapath design
- FPGA and ASIC digital systems
- Algorithm implementation in hardware
Through this project, the following digital design concepts are explored:
- Datapath and control architecture
- Hardware implementation of nested loops
- Multiplexer-based data selection
- Register-based storage systems
- Comparator-driven decision logic
- Clock-synchronized digital systems
Future improvements could include:
- Implementing the design on an FPGA
- Increasing the number of supported points
- Adding a hardware square-root unit for actual Euclidean distance
- Optimizing the metric computation unit
- Introducing a finite state machine (FSM) for better control logic