-
Computer arithmetic
08/02/2025 at 13:04 • 0 commentsThe Hardware Calculator From Scratch is a minimalistic project that utilizes only binary floating-point arithmetic for doing math. It does not support function evaluation.
However, for the sake of completeness, I've implemented a few side projects, that cover these additional topics separately. These are written in C++ instead of assembly, as we already know how to implement software floating-point emulation in assembly — so using assembly here would bring no additional educational value.
- Fixed-point arithmetic (binary, decimal): https://github.com/igor-240340/FixedPointArithmetic.
- Binary-coded decimal arithmetic (BCD): https://github.com/igor-240340/BCDArithmetic.
- Random number generation: https://github.com/igor-240340/RandomNumberGeneration.
- Elementary functions approximation (sin/cos/sqrt): https://github.com/igor-240340/FunctionApproximation.
So, if you understand binary floating point and the above topics, you’ll be able to implement an industrial-grade hardware calculator that uses BCD floating-point and can evaluate elementary functions — all on your own, without looking anything up.
You'll be able to implement even a graphing calculator! By the way, I've also written a simple software rasterizer which you can find and study here: https://github.com/igor-240340/SoftwareRenderer.
If you know how to juggle numbers and draw graphics on the low level, you can do some fun stuff.