This research designs an absolute-value detector with the function of threshold comparing. Specifically, it is an essential device in the spike detection of the brain-machine interface. The optimized design in the research can accomplish the main functions in spike detection and has good performance in both delay and energy consumption. It comes up with two types of design at the beginning. To make the design reliable and comprehensive, it decides to discuss both methods in this paper. The first design is using a full adder, multiplexer and comparator. The concept of its logic circuit is adding the logic one to the input when the given input data is negative, keeping the original information as the given input data is positive. To achieve the function of adding, this study chooses the full adders. The primary purpose of using multiplexers is to select from the processed input and original input, and the choice depends on the most significant bit (MSB) of the input data. To compare the absolute value of the input data with a given threshold, this research used a multi-bit comparator. The second design is based on the fundamental algorithms of calculating total numbers. It indicates that this study can operate it with the threshold value through a subtractor when the input is negative. On the contrary, an adder can be used when the information is positive. Based on the concept of logic optimization, this study chooses to use the only subtractors, and it just needs to focus on the borrow bit, which can indicate the more significant number. By connecting the MSB of the input with the subtractors through XOR gates, the selection can be achieved without using any multiplexer. In the process of removing and replacing the devices, it reached the optimization of the design. Then, this paper compared the minimum delay by calculating each stage’s size and finding that the second design is better. Finally, based on the dual design, this essay computed the energy consumption in the circuit and implement VDD
optimization to obtain the minimum energy.