DB06 Code Conversion Binary to Gray Gray to Binary Operating Manual Ver.1.1 An ISO 9001 : 2000 company 94-101, Electronic Complex Pardesipura, Indore- 452010, India Tel : 91-731- 2570301/02, 4211100 Fax: 91- 731- 2555643 e mail : info@scientech.bz Website : www.scientech.bz Toll free : 1800-103-5050 DB06 Scientech Technologies Pvt. Ltd. 2 DB06 Code Conversion Binary to gray Gray to Binary DB06 Table of Contents 1. Introduction 4 2. Theory 5 3. Experiment To study and verify the code conversion circuits. Binary to Gray Code Gray to Binary Code 7 4. Data Sheet 10 5. Warranty 11 6. List of Accessories 11 RoHS Compliance Scientech Products are RoHS Complied. RoHS Directive concerns with the restrictive use of Hazardous substances (Pb, Cd, Cr, Hg, Br compounds) in electric and electronic equipments. Scientech products are “Lead Free” and “Environment Friendly”. It is mandatory that service engineers use lead free solder wire and use the soldering irons upto (25 W) that reach a temperature of 450°C at the tip as the melting temperature of the unleaded solder is higher than the leaded solder. Scientech Technologies Pvt. Ltd. 3 DB06 Introduction DB06 is a compact, ready to use Code Conversion (binary to gray & gray to Binary) experiment board. This experiment board has been designed to study code converters used for translating from code to code. It can be used as stand alone unit with external power supply or can be used with Scientech Digital Lab ST2611 which has built in power supply, pulse generator, pulser switches, 8 bits data switches, logic probe, digital display, 8 bits LED display. List of boards : Model Name DB01 Logic Gates DB02 Universal Gate- NAND/NOR DB03 EX-OR Gate Implementation DB04 Demorgan's Theorem DB05 EX-OR Gate Application DB07 Code Conversion (BCD to Excess-3 code) DB08 Binary Adder -Subtractor DB09 Encoder – Decoder DB10 Multiplexer – Demultiplexer DB11 Flip-Flops (R-S, D, J-K, T) DB12 Shift Register (4 bit SIPO) DB13 4 Bit Synchronous Binary Counter DB16 Digital to Analog Converter (R-2R ladder) DB15 BCD to 7- Segment Decoder DB17 3 Digit Event Counter DB21 Fiber Optic Digital Link DB22 Analog to digital converter (Counter Type) DB27 Digital to Analog Converter (R-2R ladder) DB28 Monostable Multivibrator DB29 CMOS and Crystal Oscillator DB30 Adder/ Subtracter (4-Bit/8-Bit) DB31 Decoder/Demultiplexer DB32 Modulo-N programmable counter DB35 4 BIT Shift Register ………and many more Scientech Technologies Pvt. Ltd. 4 DB06 Theory The availability of a large variety of codes for the same discrete elements of information results in the use of different codes by different digital system. It is sometimes necessary to use the output of one system as the input to another. A conversion circuit must be inserted between the two systems if each uses different codes for the same information. Thus, a code converter is a circuit that makes the two systems compatible even though each uses a different binary code. The binary number system is a system that uses only the digits 0 & 1 as codes. To represent a group of 2 n distinct element in a binary code requires a minimum of n bits. This is because it is possible to arrange n bits in 2n distinct ways. Although the minimum number of bits required to code 2n distinct quantities is n, there is no maximum number of bits that may be used for binary code. For example, a group of four distinct quantities can be represented by a two bit code, with each quantity assigned one of the following bit combinations: 00, 01, 10, and 11. A group of eight elements requires a three bit code, with each element assigned to one and only one of the following 000, 001, 010, 011, 100, 101, 110, and 111. (Refer table 1). Gray code (reflected code) is shown in Table 1. Number in the gray code changes by only one bit as it proceeds from one number to the next. For example in going from decimal 7 to 8, the gray code number changes from 0100 to 1100; these number differ only in MSB. So it is with the entire gray code; every number differs by only one bit from the preceding number. The logic diagram for binary code to gray code converter and gray code to binary code converter is shown in fig. 1 and fig. 2. Scientech Technologies Pvt. Ltd. 5 DB06 Decimal 0 1 2 3 4 5 6 7 8 9 Gray Code 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 Binary 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 Table. 1 The logic equations for Binary to gray code conversion G0 = B0 ⊕ B1 G1 = B1 ⊕ B2 G2 = B2 ⊕ B3 G3 = B3 Gray to binary code conversion B0 = G3 ⊕ G2 ⊕ G1 ⊕ G0 B1 = G3 ⊕ G2 ⊕ G1 B2 = G3 ⊕ G2 B3 = G3 Scientech Technologies Pvt. Ltd. 6 DB06 Experiment Objective : To study and verify the code conversion circuits. 1. Binary to Gray Code 2. Gray to Binary Code Apparatus required : 1. Digital board DB06. 2. DC Power Supply +5 V from external source or ST2611 Digital lab. 3. Digital Multimeter or Digital Lab ST2611. Logic diagram & Truth Table : (Logic 1 = +5V & Logic 0= GND) Binary to Gray Code Gray to Binary Code Fig. 1&2 Scientech Technologies Pvt. Ltd. 7 DB06 Decimal B3 B2 B1 B0 Decimal G3 G2 G1 G1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 1 2 0 0 1 0 2 0 0 1 1 3 0 0 1 1 3 0 0 1 0 4 0 1 0 0 4 0 1 1 0 5 0 1 0 1 5 0 1 1 1 6 0 1 1 0 6 0 1 0 1 7 0 1 1 1 7 0 1 0 0 8 1 0 0 0 8 1 1 0 0 9 1 0 0 1 9 1 1 0 1 10 1 0 1 0 10 1 1 1 1 11 1 0 1 1 11 1 1 1 0 12 1 1 0 0 12 1 0 1 0 13 1 1 0 1 13 1 0 1 1 14 1 1 1 0 14 1 0 0 1 15 1 1 1 1 15 1 0 0 0 Binary Code Gray Code Table. 1&2 Scientech Technologies Pvt. Ltd. 8 DB06 Procedure : 1. Connect +5 V and ground to their indicated position on DB06 experiment board from external DC power supply or from DC power block of Digital Lab ST2611. 2. Connect inputs B0, B1, B2, B3 as per truth table 2 to binary to gray code converter as shown in fig.1. 3. Switch ON the power supply. 4. Observe output G0, G1, G2, G3 on multimeter or on LED Display of Digital Lab ST2611. 5. Repeat above step for remaining inputs and prove truth table. 6. Repeat above steps for gray to binary code converter and prove truth table.(Refer fig. 2 & table 3) Scientech Technologies Pvt. Ltd. 9 DB06 Datasheet Quad 2- Input Exclusive-OR Gate 54LS/74S136 Pinout diagram (Pin 14 = Vcc = + 5 V) Function Table H = High voltage level L = Low voltage level Note : Pull up resistance of 1 k is required in open collector ICs to get output. Scientech Technologies Pvt. Ltd. 10 DB06 Warranty 1. We guarantee the product against all manufacturing defects for 24 months from the date of sale by us or through our dealers. Consumables like dry cell etc. are not covered under warranty. 2. The guarantee will become void, if a) The product is not operated as per the instruction given in the operating manual. b) The agreed payment terms and other conditions of sale are not followed. c) The customer resells the instrument to another party. d) Any attempt is made to service and modify the instrument. 3. The non-working of the product is to be communicated to us immediately giving full details of the complaints and defects noticed specifically mentioning the type, serial number of the product and date of purchase etc. 4. The repair work will be carried out, provided the product is dispatched securely packed and insured. The transportation charges shall be borne by the customer. For any Technical Problem Please Contact us at service@scientech.bz List of Accessories 1. 2mm patch cord. (Red) 16” ......................................1 No. 2. 2mm patch cord (Black) 16” ....................................1 No. 3. 2mm patch cord (Blue) 16”.................................... 8 Nos. 4. e-Manual .................................................................1 No. Updated 18-05-2009 Scientech Technologies Pvt. Ltd. 11