Accuracy Analysis on Design of Stochastic Computing in Arithmetic Components and Combinational Circuit
Abstract
:1. Introduction
- We have considered two different SNGs and carried out accuracy analysis for both namely LFSR-based SNG and S-box-based SNG. LFSR-based SNG is the traditional method used for generating stochastic numbers. S-box-based SNG is the new method used to develop the stochastic system performed here.
- Stochastic computing is implemented for basic arithmetic components using SC bit streams generated using LFSR-based SNG and S-box-based SNG.
- Also, an SC-based combinational circuit is realized using an algebraic expression for the two different SNGs.
- The output computed for all of the SC circuits is analyzed for accuracy measurement in terms of MSE.
- With the help of the computational analysis, accuracy is measured for the developed stochastic arithmetic component and the stochastic combinational circuit.
2. Related Works on Stochastic Computing Elements
3. Proposed Computing Methodology
3.1. Stochastic Number Generation
3.1.1. LFSR-Based SNG—Algorithm
3.1.2. S-Box-Based SNG Algorithm
3.2. Implementation of Stochastic Computing in Arithmetic Operation
3.2.1. Stochastic Multiplication
3.2.2. Stochastic Addition
3.2.3. Stochastic Subtraction
3.2.4. Stochastic Division
3.3. Stochastic Implementation of Combinational Circuit
4. Experimental Analysis and Inference
4.1. Function Generation and Conditions
4.2. Experimental Results of Stochastic Arithmetic Components
4.2.1. Error Analysis for Stochastic Arithmetic Components
4.2.2. Accuracy Measure for Stochastic Arithmetic Components
4.3. Experimental Results of Stochastic Combinational Circuit
4.3.1. Error Analysis for Stochastic Combinational Circuit
4.3.2. Accuracy Measure for Stochastic Combinational Circuit
4.4. Difference in Performance with Respect to SNG
5. Conclusions
6. Future Scope
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Liu, Y.; Liu, S.; Wang, Y.; Lombardi, F.; Han, J. A survey of stochastic computing neural networks for machine learning applications. IEEE Trans. Neural Netw. Learn. Syst. 2020, 32, 2809–2824. [Google Scholar] [CrossRef] [PubMed]
- Gaines, B.R. Origins of stochastic computing. In Stochastic Computing: Techniques and Applications; Springer: Cham, Switzerland, 2019; pp. 13–37. [Google Scholar]
- Winstead, C. Tutorial on Stochastic Computing. In Stochastic Computing: Techniques and Applications; Springer: Cham, Switzerland, 2019; pp. 39–76. [Google Scholar]
- Krishnapriya, P.N.; Bala Tripura Sundari, B. High level synthesis for retiming stochastic VLSI signal processing architectures. Procedia Comput. Sci. 2019, 143, 10–19. [Google Scholar]
- Lee, Y.Y.; Halim, Z.A. Stochastic computing in convolutional neural network implementation: A review. PeerJ Comput. Sci. 2020, 6, e309. [Google Scholar] [CrossRef] [PubMed]
- Balasubramanian, P.; Maskell, D.L.; Prasad, K. RESAC: A redundancy strategy involving approximate computing for error-tolerant applications. Microelectron. Reliab. 2023, 150, 115198. [Google Scholar] [CrossRef]
- Neugebauer, F.; Polian, I.; Hayes, J.P. Framework for quantifying and managing accuracy in stochastic circuit design. ACM J. Emerg. Technol. Comput. Syst. 2018, 14, 1–21. [Google Scholar] [CrossRef]
- Yang, M.; Hayes, J.P.; Fan, D.; Qian, W. Design of accurate stochastic number generators with noisy emerging devices for stochastic computing. In Proceedings of the 2017 IEEE/ACM International Conference on Computer-Aided Design (ICCAD), Irvine, CA, USA, 13–16 November 2017; pp. 638–644. [Google Scholar]
- Zhakatayev, A.; Kim, K.; Choi, K.; Lee, J. An efficient and accurate stochastic number generator using even-distribution coding. IEEE Trans.-Comput. Aided Des. Integr. Circuits Syst. 2018, 37, 3056–3066. [Google Scholar] [CrossRef]
- Karadeniz, M.B.; Altun, M. Sampling based random number generator for stochastic computing. In Proceedings of the 2017 24th IEEE International Conference on Electronics, Circuits and Systems (ICECS), Batumi, Georgia, 5–8 December 2017; pp. 227–230. [Google Scholar]
- Sakamoto, Y.; Yamashita, S. Efficient Methods to Generate Constant SNs with Considering Trade-off between Error and Overhead and Its Evaluation. IEICE Trans. Inf. Syst. 2020, 103, 321–328. [Google Scholar] [CrossRef]
- Zhang, Y.; Wang, R.; Zhang, X.; Zhang, Z.; Song, J.; Zhang, Z.; Wang, Y.; Huang, R. A parallel bitstream generator for stochastic computing. In Proceedings of the 2019 Silicon Nano Electronics Workshop (SNW), Kyoto, Japan, 9–10 June 2019; pp. 1–2. [Google Scholar]
- Akhtar, R.; Khanday, F.A. Stochastic Computing: Systems, Applications, Challenges and Solutions. In Proceedings of the 2018 3rd International Conference on Communication and Electronics Systems (ICCES), Coimbatore, India, 15–16 October 2018; pp. 722–727. [Google Scholar]
- Alaghi, A.; Qian, W.; Hayes, J.P. The promise and challenge of stochastic computing. IEEE Trans. -Comput. Aided Des. Integr. Circuits Syst. 2017, 37, 1515–1531. [Google Scholar] [CrossRef]
- Chen, T.-H.; Hayes, J.P. Design of division circuits for stochastic computing. In Proceedings of the 2016 IEEE Computer Society Annual Symposium on VLSI (ISVLSI), Pittsburgh, PA, USA, 11–13 July 2016; pp. 116–121. [Google Scholar]
- Temenos, N.; Sotiriadis, P.P. A New Technique for Stochastic Division in Unipolar Format. In Proceedings of the 2019 8th International Conference on Modern Circuits and Systems Technologies (MOCAST), Thessaloniki, Greece, 13–15 May 2019; pp. 1–4. [Google Scholar]
- Wu, D.; Miguel, J.S. In-stream stochastic division and square root via correlation. In Proceedings of the 2019 56th ACM/IEEE Design Automation Conference (DAC), Las Vegas, NV, USA, 2–6 June 2019; pp. 1–6. [Google Scholar]
- Najafi, M.H.; Li, P.; Lilja, D.J.; Qian, W.; Bazargan, K.; Riedel, M. A reconfigurable architecture with sequential logic-based stochastic computing. ACM J. Emerg. Technol. Comput. Syst. 2017, 13, 1–28. [Google Scholar] [CrossRef]
- Luong, T.-K.; Nguyen, V.-T.; Nguyen, A.-T.; Popovici, E. Efficient architectures and implementation of arithmetic functions approximation based stochastic computing. In Proceedings of the 2019 IEEE 30th International Conference on Application—Specific Systems, Architectures and Processors (ASAP), New York, NY, USA, 15–17 June 2019; Volume 2160, pp. 281–287. [Google Scholar]
- Li, Z.; Chen, Z.; Zhang, Y.; Huang, Z.; Qian, W. Simultaneous Area and Latency Optimization for Stochastic Circuits by D Flip-Flop Insertion. IEEE Trans.-Comput. Aided Des. Integr. Circuits Syst. 2018, 38, 1251–1264. [Google Scholar] [CrossRef]
- Han, K.; Hu, J.; Chen, J.; Zhang, Z.; Lu, H. A fast converging normalization unit for stochastic computing. IEEE Trans. Circuits Syst. II Express Briefs 2017, 65, 501–505. [Google Scholar] [CrossRef]
- Najafi, M.H.; Lilja, D. High quality down-sampling for deterministic approaches to stochastic computing. IEEE Trans. Emerg. Top. Comput. 2018, 9, 7–14. [Google Scholar] [CrossRef]
- Ting, P.-S.; Hayes, J.P. Isolation-based decorrelation of stochastic circuits. In Proceedings of the 2016 IEEE 34th International Conference on Computer Design (ICCD), Scottsdale, AZ, USA, 2–5 October 2016; pp. 88–95. [Google Scholar]
- Frasser, C.F.; Linares-Serrano, P.; de Los Rios, I.D.; Moran, A.; Skibinsky-Gitlin, E.S.; Font-Rossello, J.; Canals, V.; Roca, M.; Serrano-Gotarredona, T.; Rossello, J.L. Fully parallel stochastic computing hardware implementation of convolutional neural networks for edge computing applications. IEEE Trans. Neural Netw. Learn. Syst. 2022. [Google Scholar] [CrossRef] [PubMed]
- Misra, S.; Bland, L.C.; Cardwell, S.G.; Incorvia, J.A.C.; James, C.D.; Kent, A.D.; Schuman, C.D.; Smith, J.D.; Aimone, J.B. Probabilistic neural computing with stochastic devices. Adv. Mater. 2022, 35, 2204569. [Google Scholar] [CrossRef] [PubMed]
- Yeo, I.; Gi, S.-G.; Lee, B.-G.; Chu, M. Stochastic implementation of the activation function for artificial neural networks. In Proceedings of the 2016 IEEE Biomedical Circuits and Systems Conference (BioCAS), Shanghai, China, 17–19 October 2016; pp. 440–443. [Google Scholar]
- Xie, Y.; Liao, S.; Yuan, B.; Wang, Y.; Wang, Z. Fully-parallel area- efficient deep neural network design using stochastic computing. IEEE Trans. Circuits Syst. II Express Briefs 2017, 64, 1382–1386. [Google Scholar] [CrossRef]
- Abdellatef, H.; Khalil-Hani, M.; Shaikh-Husin, N.; Ayat, S.O. Stochastic Computing Correlation Utilization in Convolutional Neural Network Basic Functions. Telkomnika 2018, 16, 2835–2843. [Google Scholar] [CrossRef]
- Hojabr, R.; Givaki, K.; Tayaranian, S.M.R.; Esfahanian, P.; Khonsari, A.; Rahmati, D.; Najafi, M.H. Skippynn: An embedded stochastic-computing accelerator for convolutional neural networks. In Proceedings of the 2019 56th ACM/IEEE Design Automation Conference (DAC), Las Vegas, NV, USA, 2–6 June 2019; pp. 1–6. [Google Scholar]
- Ashok, P.; Bala Tripura Sundari, B. Computational Analysis of stochastic arithmetic computing and stochastic activation function. J. Phys. Conf. Ser. 2022, 2325, 012032. [Google Scholar] [CrossRef]
- Nair, N.B.; Anita, J.P. Design of Multistage Counters Using Linear Feedback Shift Register. In Inventive Communication and Computational Technologies; Springer: Singapore, 2022; pp. 161–173. [Google Scholar]
- Mahendra, P.; Ramesh, S.R. FPGA Implementation of High Performance Precise Signed and Unsigned Multiplier using Ternary 6-LUT Architecture. In Proceedings of the 2022 International Conference on Inventive Computation Technologies (ICICT), Lalitpur, Nepal, 20–22 July 2022; pp. 202–207. [Google Scholar]
- Mousouliotis, P.G.; Petrou, L.P. Cnn-grinder: From algorithmic to high-level synthesis descriptions of cnns for low-end-low-cost fpga socs. Microprocess. Microsyst. 2020, 73, 102990. [Google Scholar] [CrossRef]
- Gay, M.; Burchard, J.; Horácek, J.; Messeng Ekossono, A.S.; Schubert, T.; Becker, B.; Kreuzer, M.; Polian, I. Small scale AES toolbox: Algebraic and propositional formulas, circuit-implementations and fault equations. In Proceedings of the 6th Conference on Trustworthy Manufacturing and Utilization of Secure Devices (TRUDEVICE 2016), Barcelona, Spain, 14–16 November 2016. [Google Scholar]
- Ashok, P.; Bala Tripura Sundari, B. Implementation of stochastic computing in activation functions using stochastic arithmetic components. In Proceedings of the 2023 IEEE 8th International Conference for Convergence in Technology (I2CT), Pune, India, 7–9 April 2023; pp. 1–5. [Google Scholar]
Stochastic Output (A) | Actual Output (B) | ERROR | Stochastic Output (A) | Actual Output (B) | ERROR |
---|---|---|---|---|---|
Stochastic Multiplication | |||||
LFSR-based stochastic multiplication—4 bit | S-Box-based stochastic multiplication—4 bit | ||||
2 | 168 | 160.09 | 2 | 110 | 106.036 |
1 | 96 | 94.010 | 2 | 77 | 73.05 |
1 | 80 | 78.01 | 0 | 48 | 48 |
1 | 64 | 62.01 | 1 | 24 | 22.04 |
2 | 35 | 31.11 | 1 | 20 | 18.05 |
1 | 20 | 18.05 | 0 | 8 | 8 |
Stochastic Addition | |||||
LFSR-based stochastic addition—4 bit | S-Box-based stochastic addition—4 bit | ||||
2 | 26 | 22.15 | 4 | 29 | 21.55 |
1 | 20 | 18.05 | 2 | 21 | 17.19 |
2 | 18 | 14.22 | 2 | 16 | 12.25 |
2 | 17 | 13.23 | 1 | 14 | 12.07 |
1 | 12 | 10.083 | 1 | 10 | 8.1 |
2 | 12 | 8.33 | 1 | 9 | 7.11 |
Stochastic Subtraction | |||||
LFSR-based stochastic subtraction—4 bit | S-Box-based stochastic subtraction—4 bit | ||||
1 | 11 | 9.09 | 1 | 10 | 8.1 |
3 | 1 | 4 | 2 | 7 | 3.57 |
1 | 4 | 2.25 | 1 | 4 | 2.25 |
4 | 2 | 2 | 2 | 1 | 1 |
2 | 10 | 1.6 | 1 | 2 | 0.5 |
2 | 4 | 1 | 2 | 3 | 0.33 |
Stochastic Division | |||||
LFSR-based stochastic division—4 bit | S-Box-based stochastic division—4 bit | ||||
2 | 0.125 | 28.125 | 1 | 0.0714 | 12.077 |
2 | 0.166 | 20.262 | 3 | 0.55 | 10.91 |
2 | 0.25 | 12.25 | 1 | 0.0833 | 10.088 |
2 | 0.333 | 8.345 | 1 | 0.1 | 8.1 |
2 | 0.375 | 7.041 | 2 | 0.636 | 2.925 |
3 | 12 | 6.75 | 2 | 0.75 | 2.083 |
Stochastic Output (A) | Actual Output (B) | ERROR | Stochastic Output (A) | Actual Output (B) | ERROR |
---|---|---|---|---|---|
Stochastic Multiplication | |||||
LFSR-based stochastic multiplication—8 bit | S-Box-based stochastic multiplication—8 bit | ||||
3 | 46,256 | 46,253 | 2 | 39,872 | 39,868 |
3 | 37,636 | 37,630 | 2 | 37,286 | 37,282 |
3 | 28,836 | 28,830 | 2 | 11,685 | 11,681 |
3 | 17,577 | 17,571 | 1 | 11,534 | 11,532 |
3 | 11,800 | 11,794 | 1 | 10,251 | 10,249 |
2 | 5313 | 5309 | 1 | 4648 | 4646 |
Stochastic Addition | |||||
LFSR-based stochastic addition—8 bit | S-Box-based stochastic addition—8 bit | ||||
4 | 432 | 424.03 | 3 | 402 | 396.02 |
3 | 388 | 382.02 | 4 | 387 | 379.04 |
4 | 340 | 332.04 | 5 | 262 | 252.09 |
4 | 298 | 290.05 | 1 | 252 | 250 |
5 | 218 | 208.11 | 4 | 207 | 199.07 |
2 | 194 | 190.02 | 4 | 194 | 186.08 |
Stochastic Subtraction | |||||
LFSR-based stochastic subtraction—8 bit | S-Box-based stochastic subtraction—8 bit | ||||
6 | 136 | 124.26 | 1 | 107 | 105 |
5 | 132 | 122.18 | 5 | 106 | 96.23 |
4 | 128 | 120.12 | 3 | 85 | 79.10 |
3 | 65 | 59.13 | 4 | 46 | 38.34 |
5 | 65 | 55.38 | 4 | 25 | 17.64 |
8 | 40 | 25.6 | 4 | 23 | 15.69 |
Stochastic Division | |||||
LFSR-based stochastic division—8 bit | S-Box-based stochastic division—8 bit | ||||
5 | 0.086 | 280.32 | 6 | 182 | 170.19 |
3 | 97 | 91.09 | 3 | 0.1686 | 47.53 |
4 | 0.2857 | 48.28 | 6 | 0.8437 | 31.5 |
5 | 0.625 | 30.625 | 5 | 0.7946 | 22.252 |
6 | 33.66 | 22.729 | 6 | 1.101 | 21.79 |
5 | 1.18 | 12.36 | 4 | 0.8786 | 11.089 |
Stochastic Output (A) | Actual Output (B) | ERROR | Stochastic Output (A) | Actual Output (B) | ERROR |
---|---|---|---|---|---|
LFSR-based stochastic combinational circuit—4 bit | S-Box-based stochastic combinational circuit 4 bit | ||||
1 | 96 | 94.0104 | 2 | 77 | 73.051 |
1 | 80 | 78.012 | 1 | 48 | 46.020 |
1 | 72 | 70.0138 | 0 | 45 | 45 |
1 | 64 | 62.0156 | 0 | 24 | 24 |
0 | 36 | 36 | 0 | 15 | 15 |
LFSR-based stochastic combinational circuit 8 bit | S-Box-based stochastic combinational circuit 8 bit | ||||
2 | 5120 | 5116 | 1 | 4648 | 4646 |
1 | 5313 | 5311 | 3 | 3456 | 3450 |
2 | 3636 | 3632 | 1 | 1043 | 1041 |
3 | 2960 | 2954 | 2 | 1035 | 1031 |
1 | 2744 | 2742 | 5 | 182 | 172.13 |
S. No | Component | LFSR Based SNG | S-Box Based SNG | Accuracy |
---|---|---|---|---|
1. | Stochastic Multiplication 4 bit | 73.88 | 45.86 | S-box stochastic multiplication Length—4 bit |
Stochastic Multiplication 8 bit | 24564.5 | 19209.66 | ||
2. | Stochastic Addition 4 bit | 14.34 | 13.045 | S-box stochastic addition Length—8 bit |
Stochastic Addition 8 bit | 304.378 | 277.05 | ||
3. | Stochastic Subtraction 4 bit | 3.323 | 2.625 | S-box stochastic subtraction Length—8 bit |
Stochastic Subtraction 8 bit | 84.445 | 58.666 | ||
4. | Stochastic Division 4 bit | 13.795 | 73697 | S-box stochastic division Length—4 bit |
Stochastic Division 8 bit | 80.9006 | 50.725 | ||
5. | Stochastic Combinational circuit 4 bit | 68.01 | 40.6142 | S-box stochastic combinational system 4 bit and 8 bit |
Stochastic Combinational circuit 8 bit | 3951 | 2068.026 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Ashok, P.; Bala Tripura Sundari, B. Accuracy Analysis on Design of Stochastic Computing in Arithmetic Components and Combinational Circuit. Computation 2023, 11, 237. https://doi.org/10.3390/computation11120237
Ashok P, Bala Tripura Sundari B. Accuracy Analysis on Design of Stochastic Computing in Arithmetic Components and Combinational Circuit. Computation. 2023; 11(12):237. https://doi.org/10.3390/computation11120237
Chicago/Turabian StyleAshok, P., and B. Bala Tripura Sundari. 2023. "Accuracy Analysis on Design of Stochastic Computing in Arithmetic Components and Combinational Circuit" Computation 11, no. 12: 237. https://doi.org/10.3390/computation11120237
APA StyleAshok, P., & Bala Tripura Sundari, B. (2023). Accuracy Analysis on Design of Stochastic Computing in Arithmetic Components and Combinational Circuit. Computation, 11(12), 237. https://doi.org/10.3390/computation11120237