*3.4.1 Binary to gray code converters*

**Table 7** shoes the conversion of 4-bit binary code to its equivalent gray code values. The 4 bit binary code input is defined as B0, B1, B2, B3 and corresponding


*Digital System Design DOI: http://dx.doi.org/10.5772/intechopen.97611*

**Table 7.** *Truth Table – Binary to Gray Converter.*

output 4-bit gray is defined as G0, G2, G3, and G4 as shown in **Figure 8**. The corresponding boolean expression for binary to gray code conversion is given below

$$G\_0 = B\_0 \tag{18}$$

$$G\_1 = B\_0 \bigoplus B\_1 \tag{19}$$

$$G\_2 = B\_2 \bigoplus B\_1 \tag{20}$$

$$G\_3 = B\_3 \bigoplus B\_2 \tag{21}$$

## *3.4.2 Gray to binary code converters*

Gray code is also called as Reflected Binary Code (RBC), Reflected Binary (RB) or Gray code, Cyclic Code, is defined as an ordering of the binary number system

*Y*5 ¼ *S*2*S*1*S*0*I* (15) *Y*6 ¼ *S*2*S*1*S*0*I* (16) *Y*7 ¼ *S*2*S*1*S*0*I* (17)

For the same discrete elements of information, there are several different codes available, resulting in the use of different codes for different digital systems. It's sometimes necessary to connect two digital blocks that use different coding systems. Hence a conversion digital circuit is designed and implemented between two digital systems to use information of one digital system to another. The input lines must provide the bit combinations of elements as designed by binary code A and the output is generated by the bit combinations of code B. This code converters circuit consisting of logic gates to perform this transformation operations. Some of the few

**Table 7** shoes the conversion of 4-bit binary code to its equivalent gray code values. The 4 bit binary code input is defined as B0, B1, B2, B3 and corresponding

**3.4 Code converters**

*Logic Diagram – 1\*8 Demultiplexer.*

*Truth Table – 1\*8 Demultiplexer.*

**Figure 7.**

**164**

**Table 6.**

code conversion techniques are discussed below.

*Selection Inputs Output Channels*

*LabVIEW - A Flexible Environment for Modeling and Daily Laboratory Use*

*S2 S1 S0 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7* 0 0 0 Y0 = I 0 0 0 0 0 0 0 0 0 1 0 Y1 = I 0 0 0 0 0 0 0 1 0 0 0 Y2 = I 0 0 0 0 0 0 1 1 0 0 0 Y3 = I 0 0 0 0 1 0 0 0 0 0 0 Y4 = I 0 0 0 1 0 1 0 0 0 0 0 Y5 = I 0 0 1 1 0 0 0 0 0 0 0 Y6 = I 0 1 1 1 0 0 0 0 0 0 0 Y7 = I

*3.4.1 Binary to gray code converters*

such that each incremental value can only differ by one bit. The main objective in this code converter is that while traversing from one step to another step, one bit in the code group changes as in **Figure 9**. This gray code is not applicable for arithmetic operations, but it is applicable in analog to digital converters, as well as error correction techniques in digital communications (**Table 8**).

$$B\_3 = G\_3 \tag{22}$$

$$B\_2 = G\_2 \oplus G\_3 \tag{23}$$

$$B\_1 = G\_1 \oplus G\_2 \oplus G\_3 \tag{24}$$

$$B\_0 = G\_1 \oplus G\_2 \oplus G\_3 \oplus G\_0 \tag{25}$$

**Figure 9.**

*Logic Diagram – Gray to Binary Code Converter.*


**Figure 10.**

*Digital System Design*

*DOI: http://dx.doi.org/10.5772/intechopen.97611*

**167**

*Logic Diagram – Seven Segment Decoder.*
