Digital

Code Converter Using VHDL

code_Converter

Title: To Study the Code Converter Using VHDL

Aim: To design and verify the truth table of a BCD to Seven Segment Display and Binary to Gray

code

 

Objectives:

 

  1. To study the VHDL programming language.
  2. To study the BCD Code.
  3. To study the binary code and gray code.
  4. To draw the flow chart.
  5. To verify the truth table.

Software & Hardware Requirement:

  1. Minimum Pentium 4, 512 MB RAM & 40 HDD.
  2. Xilinx software version 9.1v.

Code: A code is a rule for converting a piece of information (for example, a letter, word, phrase, or gesture) into another form or representation (one sign into another sign), not necessarily of the same type.

Theory of BCD code: In computing and electronic systems, binary-coded decimal (BCD) is a digital encoding method for numbers using decimal notation, with each decimal digit represented by its own binary sequence. In BCD, a numeral is usually represented by four bits which, in general, represent the decimal range 0 through 9. Other bit patterns are sometimes used for a sign or for other indications (e.g., error or overflow). Uncompressed (or zoned) BCD consumes a byte for each represented numeral, whereas compressed (or packed) BCD typically carries two numerals in a single byte by taking advantage of the fact that four bits will represent the full numeral range.

 

Theory of Seven Segment Display: A seven-segment display (SSD), or seven-segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot-matrix displays. Seven-segment displays are widely used in digital clocks, electronic meters, and other electronic devices for displaying numerical information. Seven-segment displays may use a liquid crystal display (LCD), arrays of light-emitting diodes (LEDs), or other light-generating or controlling techniques such as cold cathode gas discharge, vacuum fluorescent, incandescent filaments, and others. For gasoline price totems and other large signs, vane displays made up of electromagnetically flipped light-reflecting segments (or “vanes”) is still commonly used. An alternative to the 7-segment display in the 1950s through the 1970s was the cold-cathode, neon-lamp-like nixie tube.

Common anode (CA): The difference between the two displays is the common cathode has all the cathodes of the 7-segments connected directly together and the common anode has all the anodes of the 7-segments connected together. Shown below is a common anode seven segment. As shown in figure below all the anode segments are connected together. When working with a CA seven segment displays, power must be applied externally to the anode connection that is common to all the segments. Then by applying a ground to a particular segment connection (a-g), the appropriate segment will light up. An additional resistor must be added to the circuit to limit the amount of current flowing thru each LED segment. For zero to glow LED

Common cathode (CC): A common cathode seven segment is different from a common anode segment in that the cathodes of all the LEDs are connected together. For the use of this seven segment the common cathode connection must be grounded and power must be applied to appropriate segment in order to illuminate that segment. For one to glow LED.

 

Truth Table for BCD to Seven Segment Display Common Anod:

Decimal No BCD  Input Seven Segment output
A B C D a b c d e f g
0 0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 1 1 0 0 1 1 1 1
2 0 0 1 0 0 0 1 0 0 1 0
3 0 0 1 1 0 0 0 0 1 1 0
4 0 1 0 0 1 0 0 1 1 0 0
5 0 1 0 1 0 1 0 0 1 0 0
6 0 1 1 0 0 1 0 0 0 0 0
7 0 1 1 1 0 0 0 1 1 1 1
8 1 0 0 0 0 0 0 0 0 0 0
9 1 0 0 1 0 0 0 1 1 0 0

 

Truth Table for BCD to Seven Segment Display Common Cathod:

Decimal No BCD  Input Seven Segment output
A B C D a b c d e f G
0 0 0 0 0 1 1 1 1 1 1 0
1 0 0 0 1 0 1 1 0 0 0 0
2 0 0 1 0 1 1 0 1 1 0 1
3 0 0 1 1 1 1 1 1 0 0 1
4 0 1 0 0 0 1 1 0 0 1 1
5 0 1 0 1 1 0 1 1 0 1 1
6 0 1 1 0 1 0 1 1 1 1 1
7 0 1 1 1 1 1 1 0 0 0 0
8 1 0 0 0 1 1 1 1 1 1 1
9 1 0 0 1 1 1 1 0 0 1 1

 

Theory for Gray Code: The gray code is unweighted and is not an arithmetic code: that is there are no specific weights assigned to the bit positions. The important feature of the gray is that exhibits only a single bit change from one code word to the next in sequence. The gray code is a useful code used in digital system. It is used for indicating the angular position of a shaft on rotating machinery such as automated latches and drill presses. This code is like binary in that it can have as many bits as necessary and the more bits, the more possible combinations of output codes are also available.

Application:

  1. It is used in Shaft position encoders.
  2. It is used in rotating machinery.
  3. In modern digital communications, Gray codes play an important role in error correction.

 

 

 

 

 

 

Truth Table for Binary to Gray Converter:

Decimal Number Binary Equivalent Gray Equivalent
B3 B2 B1 B0 G3 G2 G1 G0
0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

 

0

0

0

0

0

0

0

0

1

1

1

1

1

1

1

1

 

0

0

0

0

1

1

1

1

0

0

0

0

1

1

1

1

 

0

0

1

1

0

0

1

1

0

0

1

1

0

0

1

1

 

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

 

0

0

0

0

0

0

0

0

1

1

1

1

1

1

1

1

 

0

0

0

0

1

1

1

1

1

1

1

1

0

0

0

0

 

0

0

1

1

1

1

0

0

0

0

1

0

1

1

0

0

0

1

1

0

0

1

1

0

0

1

1

0

0

1

1

0

 

 

 

 

 

 

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *