Page 78 - Computer science 868 Class 12
P. 78

Working Principle of Decimal to Binary Encoder:
              Let us consider that switch 9 is pressed. The OR gates connected to 9 namely B  and B  receive a high input signal (1)
                                                                                     3
                                                                                           0
              while the other two gates remain default low (0).
              Hence, we get B =1 B =0 B =0 and B =1 or 1 0 0 1 which is the binary value of 9.
                                              0
                                 2
                                      1
                             3
              Similarly, we can design an encoder circuit that converts any hexadecimal number having digits 0 to 9 and A to F to its
                               4
              binary form using 2 , i.e., 16 input lines and 4 output lines.
              Uses of Encoders
              1.  Encoders  are  used  to  convert  any  octal,  decimal  or  hexadecimal  digits  to  binary  form  to  perform  the  binary
                 operations like addition, subtraction, and multiplication internally.

              2.  It is also used to detect interrupts in microprocessor

              Drawbacks of Encoders
              1.  There is an ambiguity when all outputs of the encoder are equal to zero.
              2.  If multiple inputs  are high, then the output generated may be ambiguous.


                  2.5 DECODER
              We have discussed Encoder in the previous section. The operation of the decoder is just the opposite of the encoder.
              This circuit converts any binary number to its corresponding Octal, Decimal or Hexadecimal form.

                         Decoder is a combinational circuit that converts any binary number to its equivalent Octal,
                         Decimal or Hexadecimal form. It has ‘n’ input lines and maximum 2  output lines.
                                                                                     n

              A decoder can be of the following types:
              1.  Binary to Octal Decoder or 3 to 8 Decoder
              2.  Binary to Decimal Decoder
              3.  Binary to Hexadecimal Decoder or 4 to 16 Decoder

              2.5.1 Binary to Octal Decoder
              An octal number can be represented by 3 bits. So, this encoder has 3 input lines. There are 8 output lines from 0 to 7
              to represent the Octal digits.
              The block diagram of a Binary to Decimal encoder is given below:


                                                                                        D
                                                                                         0
                                           A
                                            0                                           D
                                                                                         1
                                                               3 to 8                   D 2
                                           A                  Decoder                   D
                                            1                                            3
                                                                                        D
                                                                                         4
                                                                                        D
                                           A                                             5
                                            2
                                                                                        D
                                                                                         6
              The truth table is demonstrated below:

                         A 2     A 1     A 0     D 0     D 1     D 2      D 3     D 4     D 5     D 6     D 7

                         0       0        0       1       0       0       0       0       0       0       0
                         0       0        1       0       1       0       0       0       0       0       0



                7676  Touchpad Computer Science-XII
   73   74   75   76   77   78   79   80   81   82   83