DELAY CALCULATIONS FOR VARIOUS CODE CONVERTERS Rita Mahajan 1, Gourav Saini 2, Deepak Bagai 3 1 Assistant Professor, 2 ME student, 3 Professor, Department of Electronics and Communication Engineering, PEC University of Technology, Chandigarh, India. Abstract Code specific high speed ALU is the one in which output can be taken out in any code of our choice. Moreover input can be given in any code. In high speed operations in such ALUs, speed of the code converters also matters. So calculation of speed of various code converters is important. In this paper, speed of various code converters has been measured in terms of delay and compared. The results have been taken out. Keywords- Arithmetic logic unit, Binary Coded Decimal, Hardware Descriptive Language, Seven Segment Display, Basic Input/Output System. I. Introduction Code converters are an integral part of any digital circuit. In normal operations a number is often converted from one code to another. Different codes have different applications depending upon their various properties. For instance, a number 5 in bcd in coded as 0101 in binary. Sometimes a situation may arise where some process cannot completed without converting a code to another code. Moreover power requirement and switching delay may be different for different codes. Some techniques have been developed to increase the speed of the code converters like using csmt gates[5], weighted code approach to generate gray codes[6], some other methods to generate gray codes[7], code converters using reversible gates[10]. A non conventional approach to generate gray codes[4] has also been discussed. Some basic operations like addition of BCD numbers using non standard codes[3] can also be done.but in this paper only conventional methods of code converter has been taken into account and their speed comparison has been done.xilinx is a software used to analyse the HDLS. It plays an important role in synthesis and simulation of the desired code. System level testing can also be done using Xilinx ISE. Logical, functional as well as behavioral verification can be done using Xilinx. I. Basic Codes and their applications Binary Code When the value of all entries is represented by using only 1 and 0 the code so formed is called binary code. Any input given to a computer is first converted to binary before any machine operations are performed on the number. Few applications of binary code are: 1. In computing and telecommunication, binary code is used to encode data in various types[1]. 2. From binary code it is easier to get octal, hexadecimal and other codes rather than direct conversion. Binary Coded Decimal It is a 4-bit code that represents all the values from 0 to 9. After this, 10 is represented by a 5 bin BCD code. All the works and values used by human beings are in BCD code. While working on a computer, the input that we give to the computer and the output that we get from computer is in BCD form. 96
Some applications of BCD code are: 1. Since it is a human readable code, the complexity in understanding and doing various calculations is reduced to a great extent. 2. The BIOS in computers usually store the data like date and time in BCD format. 3. Floating point algorithms used in Atari 8-bit family is in the form of BCD. Gray Code It has an important property that there is only one bit change whenever the number is incremented by 1. It is a non-weighted code. The reflected binary code was originally designed to prevent spurious output from electromechanical switches. Some applications of Gray Code 1. It is used to find the position in rotary encoders. 2. It is used to design a no glitch encoder circuit. 3. It helps to reduce noise in digital counters. Excess 3 Code It is self-complementary and non-weighted code. It is obtained by 0011 to a given binary number. Since simple conversion of binary to excess 3 and excess 3 to binary stands a great advantage. Some applications of Excess 3 code are: In case we need to find the complement of a given number, simply invert all the digits. BCD to Gray Conversion II. Code Converters Table 1:Truth Table for BCD to Gray Conversion 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 1 0 0 1 1 0 0 1 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 0 1 1 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 1 0 1 0 X X X X 1 0 1 1 X X X X 1 1 0 0 X X X X 1 1 0 1 X X X X 1 1 1 0 X X X X 1 1 1 1 X X X X Here ABCD are in BCD whereas WXYZ are the corresponding gray codes. W=A+BC+BD X=BC Y=B+C Z=A B C D+BCD+AD +B CD 97
Gray to BCD Conversion Table 2:Truth Table for Gray to BCD Conversion 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 0 1 1 0 1 1 0 0 1 0 0 0 1 1 1 0 1 0 1 0 1 0 1 0 1 1 0 0 1 0 0 0 1 1 1 1 1 0 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 1 1 X X X X 1 1 1 0 X X X X 1 0 1 0 X X X X 1 0 1 1 X X X X 1 0 0 1 X X X X 1 0 0 0 X X X X Here ABCD are the gray codes and WXYZ are the respective BCD codes. W = A X = A B Y = A BC + B C Z = A BC D + B C D + AD + BCD + B CD BCD to Excess-3 Table 3:Truth Table for BCD to Excess-3 Conversion 0 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 0 1 0 0 1 0 1 1 1 1 0 1 0 1 0 0 0 1 0 1 1 1 0 0 1 1 1 0 0 Here ABCD are the BCD codes whereas WXYZ are the respective Excess-3 codes. Z = D Y = CD+C D =CD(C+D) X= B C+B D+BC D = B (C+D) +BC D W= A+BC+BD=A+B(C+D) 98
Excess-3 to BCD Table 4:Truth Table for Excess-3 to BCD Conversion 0 0 0 0 X X X X 0 0 0 1 X X X X 0 0 1 0 X X X X 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 0 1 0 0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 0 1 0 0 0 0 1 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 1 1 0 1 1 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 X X X X 1 1 1 0 X X X X 1 1 1 1 X X X X Here ABCD are the Excess-3 codes whereas WXYZ are the respective BCD codes. W=AB+ACD X=B C +BCD+D Y=C D+CD Z=D Binary to BCD Converter Table 5:Truth Table for Binary to BCD Conversion A B C D V W X Y Z 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0 1 1 0 1 0 0 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 0 1 1 1 0 0 1 1 1 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 1 1 0 1 0 1 0 0 0 0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 0 1 0 1 1 0 1 1 0 0 1 1 1 1 1 0 1 0 1 0 0 1 1 1 1 1 0 1 0 1 Here ABCD are the Binary codes whereas VWXYZ are the respective BCD codes. V=AB+BC W=AB C 99
X=A B+BC Y=ABC +A C Z=D BCD to Seven Segment Display Table 6:Truth Table for BCD to Seven Segment Display Conversion A B C D a b c d e f g 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0 1 0 1 1 0 1 1 0 1 0 0 1 1 1 1 1 1 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 Here ABCD are the BCD codes whereas abcdefg are the respective Seven Segment Codes. a=a+c+bd+b D b=b +C D +CD c=b+c +D d=a+b C+BC D+CD +B D e=b D +CD f=a+c D +BC +BD g=a+b C+CD +BC III. Speed and Delay Speed of a given logic circuit is inversely proportional to total delay of the circuit. Total delay of various code converters has been calculated which gives an exact idea of how fast a given code converter is. Table 7:Delay Calculation for various codes. Code Converter Net Delay(ns) BCD to Gray 0.761 Gray to BCD 0.934 BCD to Excess 3 0.952 Excess 3 to BCD 0.934 Binary to BCD 1.663 BCD to Seven Segment Display 0.690 100
Delay 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 Delay BCD To Gray Gray to BCD BCD to Excess 3 Excess 3 to BCD Binary to BCD BCD to seven segment display Figure 1:Bar Graph for delay of various Code Convertors The delay for BCD to Gray code is 0.761 ns. For Gray to BCD it is calculated to be0.934 ns, 0.952 ns for BCD to Excess-3, 0.934 for for Excess-3 to BCD, 1.663 ns for Binary to BCD and 0.690 ns for BCD to SSD. IV. Conclusions As per the results, it has been found that Binary to BCD converter is the slowest with a delay of 1.663ns, since 4 bit binary gets converted into 5-bit BCD. BCD to seven segment display is the fastest with a delay of 0.690 ns.the delay for BCD to Gray conversion has also been recorded to be low i.e 0.790 ns. So it can also be used for high speed applications. Athough these codes can be made faster using some other techniques like binary reflected code[2], yet the speed performance of the basic code converters without interfering with the basic transistor structure has been calculated. So we can convert one code to another with the help of code converters as required by the application we are using. For instance, if we need to find the complement of a given number. Simply by using BCD to Excess-3 code the self complementing feature can brought into light.in case we need to use a code in digital counter or to find the position in rotary encoder, we can convert given BCD to gray codes. Moreover, we can know the speed of operation of the conversion. References [1]Petrova, P.D. and Karapenev, B.D., 2003, October. Synthesis and simulation of binary code converters. In Telecommunications in Modern Satellite, Cable and Broadcasting Service, 2003. TELSIKS 2003. 6th International Conference on (Vol. 2, pp. 773-776). IEEE. [2] Agrell, E., Lassing, J., Strom, E.G. and Ottosson, T., 2004. On the optimality of the binary reflected Gray code. IEEE Transactions on Information Theory, 50(12), pp.3170-3182. 101
[3] Coulston, C. and Dave, V., 2012, February. Addition of BCD digits using non-standard codes. In Electrical Communications and Computers (CONIELECOMP), 2012 22nd International Conference on (pp. 148-152). IEEE. [4] Ahmad, A. and Bait-Shiginah, F., 2012. A nonconventional approach to generating efficient binary Gray code sequences. IEEE Potentials, 31(3), pp.16-19. [5] Shukla, V., Singh, O.P., Mishra, G.R. and Tiwari, R.K., 2015, December. Application of CSMT gate for efficient reversible realization of binary to gray code converter circuit. In 2015 IEEE UP Section Conference on Electrical Computer and Electronics (UPCON) (pp. 1-6). IEEE. [6] Grover, L., 2015. Weighted Code Approach to Generate Gray Code. IEEE Potentials, 34(3), pp.39-40. [7] Bitner, J.R., Ehrlich, G. and Reingold, E.M., 1976. Efficient generation of the binary reflected Gray code and its applications. Communications of the ACM, 19(9), pp.517-521. [8] Mehta, H., Owens, R.M. and Irwin, M.J., 1996, March. Some issues in gray code addressing. In VLSI, 1996. Proceedings., Sixth Great Lakes Symposium on (pp. 178-181). IEEE. [9] Marschall, P., 1972. Code converters. U.S. Patent 3,691,554. [10] Saravanan, M. and Manic, K.S., 2013, March. Energy efficient code converters using reversible logic gates. In Green High Performance Computing (ICGHPC), 2013 IEEE International Conference on (pp. 1-6). IEEE. 102