Reader small image

You're reading from  The FPGA Programming Handbook - Second Edition

Product typeBook
Published inApr 2024
PublisherPackt
ISBN-139781805125594
Edition2nd Edition
Tools
Right arrow
Authors (2):
Frank Bruno
Frank Bruno
author image
Frank Bruno

Frank Bruno is an experienced high-performance design engineer specializing in FPGAs with some ASIC experience. He has experience working for companies like SpaceX, GM Cruise, Belvedere Trading, Allston Trading, and Number Nine. He is currently working as an FPGA engineer for Belvedere Trading.
Read more about Frank Bruno

Guy Eschemann
Guy Eschemann
author image
Guy Eschemann

Guy Eschemann was an Electrical Engineer with over twenty years of experience designing FPGA-based embedded systems for automotive, industrial, medical, aerospace, military, and telecom applications. He was working as an FPGA engineer at plc2 Design GmbH.
Read more about Guy Eschemann

View More author details
Right arrow

Project 4 – Building a Simple Calculator

Now that we’ve gone over state machine basics and shown the core of our calculator, we need to look at how we’ll actually implement the calculator. The first issue that will come up is how we store our data in the design. Previously, we used Binary Coded Decimal (BCD) when we were incrementing our values. There was a simple solution presented for the BCD incrementor.

If we wanted to keep the internal data as BCD, we would need to develop a custom BCD adder in the hardware, subtractor, and multiplier. This is a more complicated option than a simple incrementor. Alternatively, we can explore the possibility of keeping our internal representation as binary data, but convert it to decimal to display it. This has the added advantage that we can use the SystemVerilog add, subtract, and multiply operators as is on binary representation and then create a conversion function.

The project files can be found in the following...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
The FPGA Programming Handbook - Second Edition
Published in: Apr 2024Publisher: PacktISBN-13: 9781805125594

Authors (2)

author image
Frank Bruno

Frank Bruno is an experienced high-performance design engineer specializing in FPGAs with some ASIC experience. He has experience working for companies like SpaceX, GM Cruise, Belvedere Trading, Allston Trading, and Number Nine. He is currently working as an FPGA engineer for Belvedere Trading.
Read more about Frank Bruno

author image
Guy Eschemann

Guy Eschemann was an Electrical Engineer with over twenty years of experience designing FPGA-based embedded systems for automotive, industrial, medical, aerospace, military, and telecom applications. He was working as an FPGA engineer at plc2 Design GmbH.
Read more about Guy Eschemann