Verilog binary to decimal

broken image

We can use the 8 input switches to encode 2 BCD numbers of 4 bits each. We will be designing for the Basys 2 FPGA board which has 8 input switches. We will consider two algorithms to perform the conversion, the first being a direct arithmetic approach, and the second an iterative algorithm using a finite state machine with data path (FSMD).

broken image

I chose to detail this direction of conversion as binary to BCD conversion circuits are easily be found by a quick web search. We will focus on designing a conversion circuit that converts a BCD formatted number to to a binary formatted number. The BCD format is common in electronic systems where numeric digits are displayed, as well as in systems where the rounding and conversion errors introduced by binary floating point representation and arithmetic are undesirable.

broken image

For example, 42 is represented in BCD format by the binary representations of 4 and 2, as shown above. Binary Coded Decimal format is a binary encoding of decimal numbers that represents each decimal digit by a fixed binary number.

broken image