Skip to content Skip to sidebar Skip to footer

Design a Bcd to 7 Segment Decoder Using Gates

Lab Report on Binary Coded Decimal (BCD) to a 7-Segment Decoder

DIGITAL LAB 4 – BCD TO 7 SEGMENT DECODER

1       OBJECT:

  • To simulate a BCD to 7-segment decoder using Multisim
  • To implement a BCD to 7-segment decoder on a Nexys4-DDR FPGA board

2        BRIEF INTRODUCTION AND THEORETICAL BACKGROUND:

  • What is 7-segment display?
  • A seven-segment display (SSD) is an electronic display device for displaying numbers from (0 – 9). Additionally, 7-segment LED to allow the display of letters (A – F) and some alphanumerical 7-segment decoders consist of 7 rectangular LEDs (segments) arranged together in shape of "8". In order to produce the required number or character, a specific combination of LED segments needs to be illuminated.
  • SSD takes generally a 5 V DC power supply and has 7 digital pins named after the first 7 letters of the alphabet (A to G). The segments are lit on by applying an 'LOW' logic level to the cathode. As this device is made out of LEDs, it requires resistors order to limit the current supply.

Figure 1 7-segment LED display

  • What is a BCD decoder and why do we need it to display a number?
  • In digital electronics, numbers are generally represented by their binary values. The BCD or Binary Coded Decimal (BCD) decoder is a device that converts a digital format of a value into a format that displays devices such as the 7-segment display can interpret into a human-readable For instance, we need to use a BCD to 7-segment decoder in order to display a four-bit binary number from 0000 (0 in base 10) to 1001 (9 in base 10 ) on a 7-segment display
  • How does a BDC to 7-segment display decoder work?

A BDC to 7-segment display decoder is a combinational logic circuit that takes as inputs four bits of a  binary number and produces seven digital outputs to turn on the appropriate segments of the display.  Put simply, a BCD 7-segment display decoder is a set of logical structures that takes 4 logic input and output 7 digital signals. (1 for each LED segment). This allows a 4-bit binary number to be used to display all the numbers from 0 to 9.

Figure 2 Using a BCD to 7-segment decoder to drive a display

3      EXPERIMENT PROCEDURE AND RESULTS:

3.1     Materials and equipment used

The equipment and material used included:

-Nexys4-DDR FPGA board

-Multisim software

3.2     Simulation of 7-Segment Display

  • We used Multisim to create the circuit shown in Figure 3. The circuit is made out of 8 simple switches connected to a 7-segment LED display called SEVEN_SEG_DECIMAL_COM_A passing through a 150 Ω pack resistor.
  • Digital probes were placed on each of wires connecting the resistors to the switches
  • An interactive simulation was run and the numbers from '0' to '9' were formed on the display by using the switches to apply a LOW logic level (indicated on the digital probes) to the appropriate segments.

3.3     Simulation of BCD to 7-Segment Decoder

  • We used Multisim to create the circuit shown in Figure 5. The circuit was made out of a DSWPK_4 DIP switch connected to a SEVEN_SEG_DECIMAL_COM_A display through a 150 Ω pack resistor and a DCD_7SEG decoder.
  • Digital probes were placed on each of the 7 wires connecting to the decoder and the resistor pack.
  • An interactive simulation was run and the binary numbers from '0000' to '1001' were applied to the decoder inputs using the DIP switch.
  • The effect to the decoder output and the 7-segment display were observed for each test case input.
  • The logic converter was used to show the truth table and the logic expression

3.4     HARDWARE IMPLEMENTATION OF BDC TO 7-SEGMENT DECODER

  • We used Multisim to create the PLD design as shown in Figure 8. The PLD design was made out 4 switches, a DEC_BCD_7 decoder, 7 segments
  • The PLD design was then exported to the Nexys4 -DDR board
  • The binary numbers from '0000' to '1001' were applied to the decoder inputs using the 4 rightmost switches.
  • The effect to the 7-segment display was observed for each test case input.

4       SIMULATION AND RESULTS:

4.1      Multisim Simulations:

4.1.1      Simulation of 7-segment display:

  1. Circuit Example:

Figure 3 Circuit for simulating a 7-segment display showing the digit 0 and 9

Figure 4  Circuit for simulating a 7-segment display showing a non-understandable shape

  1. Observations:
  • By testing different combination of switches, the display is able to show all the numbers from 0 to 9 by switching the input on and off.
  • Every combination of input switch outputs a unique
  • We can even display the letters from A to F according to the truth table shown in Table 1. This table shows all possible combinations that can be displayed on the LCD.

Table 1: Display Table for a 7-segment display

Input Output
A B C D E F G Display
1 1 1 1 1 1 0 0
0 1 1 0 0 0 0 1
1 1 0 1 1 0 1 2
1 1 1 1 0 0 1 3
0 1 1 0 0 1 1 4
1 0 1 1 0 1 1 5
1 0 1 1 1 1 1 6
1 1 1 0 0 0 0 7
1 1 1 1 1 1 1 8
1 1 1 0 1 1 1 A
0 0 1 1 1 1 1 b
1 0 0 1 1 1 0 C
0 1 1 1 1 0 1 d
1 0 0 1 1 1 1 E
1 0 0 0 1 1 1 F

Any other combination displays an unrecognized shape. For instance, the display in figure 3 is the result of the following combination:

Table 2 Combination of input outputting an unrecognized shape on the display

a b c d e f g Output Display
1 1 1 0 0 0 1 Unrecognized shape

4.1.2      Simulation of the 7-segment display with a decoder:

  1. Circuit Example:

Figure 5: Circuit for simulating a 7-segment decoder displaying the digit 8 from a binary input of '1000' Figure 6: Circuit for simulating a 7-segment decoder a non-recognizable shape from a binary input of '1010'
  1. Observations and analysis:

Table 3 BCD decoder truth table

Decimal Binary Pattern BCD
8 4 2 1
0 0 0 0 0 0
1 0 0 0 1 1
2 0 0 1 0 2
3 0 0 1 1 3
4 0 1 0 0 4
5 0 1 0 1 5
6 0 1 1 0 6
7 0 1 1 1 7
8 1 0 0 0 8
9 1 0 0 1 9
10 1 0 1 0 Invalid
11 1 0 1 1 Invalid
12 1 1 0 0 Invalid
13 1 1 0 1 Invalid
14 1 1 1 0 Invalid
15 1 1 1 1 Invalid
  • We observed that the decoder is converting the 4 bits input into seven digital outputs to turn on the appropriate segments of the display, according to the binary number represented by the input.
  • When a binary number more than 1001 (equivalent to 9 in base 10) is input in the decoder, the display starts showing shapes that are not recognizable as number or letter. That is because the 7-segment display can only display 9 numbers ( from 0 to 9 ). Any numbers above 9 will require more than 7 segments (or additional 7-segments). Therefore, BCD decoder will output an unrecognized shape if the binary number represented by the input data is more than 1001 since it is not designed to handle more than 9 display. For instance, the binary number patterns of 1010 through 1111 (A to F) are invalid inputs and provide unrecognized shapes similar to what is shown in figure 6.
  • Current limiting resistors of 150 ohms are connected in series between the decoder and each of the LED display segment. They serve to limit the maximum current flow and have no impact on the LCD display.

Figure 7: Using the logic converter to show the truth table and logic expression of the segments

  • From the truth table obtained by the logic converter on the segment A (output) and the 4 bits data (input), we can deduce that the decoder is made out of 7 different gates structure outputting each one digital output ( a different structure for each segment)

4.2     HARDWARE IMPLEMENTATION:

4.2.1      Hardware Introduction:

Nexys-4-DDR has 8 7-segment displays. For every display, the common-anode pin is driven indirectly through a transistor. To activate a display, we need to apply LOW logic to the transistor. The transistor will invert it and output a positive voltage to the common anode pin.

4.2.2      Circuit:

Figure 8: PLD design for the hardware implementation of a BCD to 7-segment decoder

4.2.3      Observations:

Controlled with the 4 switches SW0 to SW3, Nexys4-DDR has exactly the same behavior as the previous simulation according to table 3. This is due to the fact that Nexys4-DDR also uses a BDC decoder. Thus, when a binary number more than 1001 equivalent to 9 decimals, the display starts showing shapes that have no meaning.

Figure 9 Unrecognized output display on the 7-segment LED on the Nexys4 DDR board

5       Conclusion:

  • It is possible to display any single digit number on a 7-segment display by sending a high digital signal to the specific segments that make up the number. However, this method requires us to encode the letters manually. It is not the best solution to output changing numbers for application such as counters.
  • It is possible to display the decimal value of a binary number on a 7-segment display using a BCD decoder.
  • However, this method will allow displaying only digits from 0 to 9 and letters A to F.
  • The only way to display number more than 9 is to use a display that has more than 7 segments or just using multiple 7-segment displays at once with the corresponding BCD decoder.
  • In the case of the decoder circuit, any binary number between 1010 through 1111 (A to F) is an invalid input and would provide distorted shapes on the LCD display.
  • Current limiting resistors of 150 ohms are connected in series between the decoder and each of the LED display segment. They serve to limit the maximum current flow and have no impact on the LCD display.
  • The usage of a 7-segment display paired with a BCD decoder is opening the door for an application using digital computation requiring a human-readable That application can be for instance: "a clock, a timer, a calculator, counter…"

Design a Bcd to 7 Segment Decoder Using Gates

Source: https://tolotra.com/2018/04/11/lab-report-on-binary-coded-decimal-bcd-to-a-7-segment-decoder/

Postar um comentário for "Design a Bcd to 7 Segment Decoder Using Gates"