SlideShare ist ein Scribd-Unternehmen logo
1 von 158
Downloaden Sie, um offline zu lesen
Courses In
                    Electrical
                   Engineering

                                      Volume II


                                LESSONS IN
                           DIGITAL ELECTRONICS



                                          By

                                 Jean-Paul NGOUNE

                 DIPET I (Electrotechnics), DIPET II (Electrotechnics)
                              DEA (Electrical Engineering)
            Teacher in the Electrical Department, GTHS KUMBO, Cameroon.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.              1
FOREWORD

       The need of pedagogical resources in the domain of the teaching of
Engineering Sciences is a great challenge in Cameroon. Many efforts have been
made through the contribution of teachers, and also through the policy of promotion
of technical education led by the government. However, much work is still to be done
in order to build a real culture of Engineering in our country. This document is a
contribution for the achievement of that goal.
       The course in digital electronics presented in this document is made up of nine
chapters prepared following the official program in digital circuits of class six F3 and
F2 series in Cameroon. However some extra material is added in order to open the
mind of students to the world of digital electronics and computer science. This course
is being taught by me (Mr. NGOUNE Jean-Paul) in the Government Technical High
School, KUMBO, Republic of Cameroon. Some amelioration may be brought to it
along the years, according to the suggestions of readers and users of this course.
       ‘Courses In Electrical Engineering’ is a series of courses in various subjects
of electronics and electrotechnics. This is the volume II of the series; the volume I
treating the matter of the Analysis of electrical circuits (Class five F3 and F2 syllabus)
is to be published very soon. This course and many other pedagogical documents
produced by me are available and freely downloadable at the following address:
www.scibd.com/jngoune.


                                              Jean-Paul NGOUNE (12 Sep. 11, 03:45).




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                            2
CONTENTS




Topic                                                          Page


Chapter One: Numeration systems and codes                      4


Chapter Two: Logic gates                                       25


Chapter Three: Boolean algebra                                 44


Chapter Four: Karnaugh mapping                                 58


Chapter Five: Digital arithmetic                               69


Chapter Six: Combinatory logic                                 82


Chapter Seven: Multivibrators                                  111


Chapter Eight: Counters                                        133


Chapter Nine: Digital storage                                  148


About the Author                                               158




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.          3
Courses In
                    Electrical
                   Engineering

                                      Volume II

                           DIGITAL ELECTRONICS

        CHAPTER ONE: NUMERATION SYSTEMS AND CODES



                                          By

                                    J-P. NGOUNE

                 DIPET I ( Electrotechnics), DIPET II (Electrotechnics)
                              DEA ( Electrical Engineering)
            Teacher in the Electrical Department, GTHS KUMBO, Cameroon.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.              4
Chapter One
    NUMERATION SYSTEMS
                                                 AND CODES
1.0 Specific objectives:
   At the end of this chapter, the student will be able to:
   -   know binary, hexadecimal and octal numeration systems;
   -   Know Gray, BCD and ASCII codes;
   -   Master the principle of conversion from each numeration system to another.


1.1 Introduction:
       Numbers are used to express quantities. There are many numerations
systems used in the field of digital electronics, one of the most important being the
binary system of numeration on which is based the computer science. Each of the
various numerations systems and codes has its advantages but also inconvenient.
The aim of this chapter is to present and explain the most common numeration
systems and codes used in the conception of digital circuits.


1.2 Digital versus Analogue representation:
       There are two basic ways we can represent quantities: Analogue
representation and digital representation. With analogue representation, the quantity
is symbolised in a way that is infinitely divisible. With digital representation, the
quantity is symbolised in a way that is discretely packaged.


Example 1.1:
   •   The height of the red column which indicates the temperature measured by a
       thermometer is an analogue representation.
   •   An electronic watch whose digits changes second after second, minute after
       minute, shows a digital representation.
Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                        5
The comparison between digital and analogue representations can be given as in the
following chart:


                 Analogue representation         Digital representation
                      Infinitely divisible       Discrete (Step by step)
               Prone to errors of precision        Absolute precision


1.3 Systems of numeration:
        To represent quantities in the different systems of numeration, specific
symbols are used, which are also called ciphers.


1.3.1 Decimal numeration system:
        Decimal system is the most common numeration system for daily uses. It is
constituted by 10 symbols or ciphers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Each cipher
represents an integer quantity and each place from right to left in a decimal notation
represents a weight for each integer quantity.


Example 1.2:
        Let’s consider the decimal notation 1253. This number can be broken into its
constituent weight-products as such:
1253 = 1000 + 200 + 50 + 3
1253 = 1 × 1000 + 2 × 100 + 5 × 10 + 3 × 1
1253 = 1 × 103 + 2 × 10 2 + 5 × 101 + 3 × 100
        We can easily notice that the cipher 1 is more weighted than the cipher 2
which in his turn is more weighted than the cipher 5. The cipher 3 is the less
weighted.


        In the decimal numeration system, each cipher is called a digit. Each weight or
place value is ten that of the one to the immediate right. The less weighted cipher
carries the One place, the cipher at the immediate left carries the Tens place, the
follower carries the Hundreds place, thousands place, and so on…




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         6
1.3.2 Binary numeration system:
        The binary numeration system uses only two ciphers instead of ten as the
decimal numeration system. Those two ciphers are “0” and “1”. In binary system of
numeration, ciphers are called bit (Binary Digit). Cipher are arranged right to left in
doubling values of weight ( instead of multiplying the weight by 10 as in the case of
decimal system).


Example 1.3:
Let’s consider the following binary number
                            Weights
    543210
A = 1 0 1 1 0 12
                            Base 2


A = 1 × 25 + 0 × 2 4 + 1 × 23 + 1 × 2 2 + 0 × 21 + 1 × 20
A = 32 + 0 + 8 + 4 + 1
A = 4510


        Each weight is 2 that of the one in the immediate right. The less weighted
cipher carries the Ones place (20), the cipher at the immediate left carries the twos
place (21), the following cipher carries the fourth place (22)…


Exercise 1.1:
Convert the following binary numbers to decimal numbers:
A = 110101                        C = 11110111101
B = 100110101                     D = 101100001111




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         7
1.3.3 Binary versus decimal numeration system:
         Let us count from 0 to 15 using binary and decimal systems of numeration
                                     Binary
                         D(MSB)     C      B     A(LSB)     Decimal
                            0       0       0       0           0
                            0       0       0       1           1
                            0       0       1       0           2
                            0       0       1       1           3
                            0       1       0       0           4
                            0       1       0       1           5
                            0       1       1       0           6
                            0       1       1       1           7
                            1       0       0       0           8
                            1       0       0       1           9
                            1       0       1       0          10
                            1       0       1       1          11
                            1       1       0       0          12
                            1       1       0       1          13
                            1       1       1       0          14
                            1       1       1       1          15


         It is obvious that the representation of a quantity in binary numeration system
takes mores ciphers than in decimal system. We can therefore ask ourselves why the
binary system is preferred to decimal system in computer sciences. The reason is
that in electronics, it is easier to materialise two quantities-“0” and “1”-(by two
different voltages for example) than to materialises 10 different quantities – “0” ,”1”
,”2”,”3”,”4”,”5”,”6”,”7”,”8”, and”9”- (by 10 different voltages). In fact, in digital circuits, 0
and 1 are materialised by specific ranges of voltages or current; this will be discussed
later.
Remark 1.1:
With n bits we can represent 2 n different binary numbers. The higher H number is
given using the following formula.
H = 2n − 1                                                                                (1)

Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                                    8
Example 1.4:
With 4 bits we can represent 24 = 16 different binary numbers (from 0 to 15), and the
higher number is H = 24 – 1 = 15.


Remark 1.2: Conversion from binary to decimal
        To convert a number written in binary numeration system to its equivalent in
decimal, we just have to calculate the products of the bits with their respective
weights, as in example 1.3 above.
        For binary numbers with “binary point” (equivalent of decimal point for decimal
numbers), the conversion is done as follow.

    2 1 0 -1 -2 -3
A = 1 0 1. 1 0 1
A = 1 × 2 2 + 0 × 21 + 1 × 20 + 1 × 2 −1 + 0 × 2 −2 + 1 × 2 −3
                  1 0     1
A = 4 + 0 +1+      1
                     + 2+ 3
                  2 2    2
A = 5.62510


Exercise 1.2:
Convert from binary to decimal:
A = 10110.01                       C = 11110111.1011
B = 111.111                        D = 10110101101.111101


1.3.4 Octal numeration system:
        The octal numeration system is a place weighted system with a base of eight.
Valid ciphers include the symbols “0”,”1”,”2”,”3”,”4”,”5”,”6”, andf”7”.
        To convert from binary to octal numeration system, we just have to divide the
number into groups of binary numbers having 3 bits each. And each group of 3 bits is
replaced by its equivalent in octal.


Example 1.5:
Let’s convert the following binary numbers in octal:
A = 10110101
B = 11010111.01



Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         9
A = 010 110 101                      101101012 = 2658

     2       6    58

         The bits are grouped from the right to the left. A zero has been added to the
two firs bits to form a group of 3 bits. That zero is called an implied zero.


B = 011 010 111 . 010                11010111.012 = 327.28

     3       2    7 . 28

         Two implied zeros have been added to the number to form groups of 3 bits.


1.3.5 Hexadecimal numeration system:
         The hexadecimal numeration system is a place weighted system with a base
of    sixteen.     Valid   ciphers      include    the    normal      decimal    symbols
“0”,”1”,”2”,”3”,”4”,”5”,”6”,”7”;”8”;9” plus six alphabetical characters A, B, C, D, E, and
F. The following table summarises the equivalence between decimal, binary, octal
and hexadecimal systems.


     Decimal                 Binary                  Octal              Hexadecimal
        0                     0000                     0                     0
        1                     0001                     1                     1
        2                     0010                     2                     2
        3                     0011                     3                     3
        4                     0100                     4                     4
        5                     0101                     5                     5
        6                     0110                     6                     6
        7                     0111                     7                     7
        8                     1000                    10                     8
        9                     1001                    11                     9
       10                     1010                    12                     A
       11                     1011                    13                     B
       12                     1100                    14                     C
       13                     1101                    15                     D
       14                     1110                    16                     E
       15                     1111                    17                     F

         To convert from binary to hexadecimal numeration, we group bits in fours.
Each group of four bit is replaced by its hexadecimal equivalent.



Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                           10
Example 1.6:
Convert the following binary numbers in hexadecimal.
A = 1101011101
B = 11101011101.11
As explained above, we just have to group the binary number in groups of four bits
each:
A =0011 0101 1101                    11010111012 = 35D16

     3        5    D16

The binary number has been grouped is groups of four bits each, from the right to the
left two implied zeros have been added at the extreme left. In the same way the
number B can also be converted.
B =0111 0101 1101 . 1100
                                            11101011101.112 = 75DC16

     7        5     D      C16



1.4 Changing of base:
         We have already seen in the previous section how to change from binary to
decimal, octal or hexadecimal systems of numeration. The present section is
intended to show how to move from a given system of numeration to any other
system.


1.4.1 From octal and hexadecimal to binary and decimal:
         The octal and hexadecimal systems are actually used by computer engineer
just to obtain a “shorthand” representation of binary numbers (because octal and
hexadecimal representations take a few numbers of ciphers or symbols as compared
to binary system). It should therefore be understood that only binary system is
implemented in the electronic circuits of digital systems (through two levels of
voltages or currents: high (1) and low (0)), the others systems being used by
engineers just for simplification issues.
         However, we sometimes have the need to convert either of those systems to
binary or decimal forms.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                      11
1.4.1.1 Octal and hexadecimal to binary:
       It is obvious that, to convert from octal to binary, we just have to convert each
octal cipher to its binary equivalent in 3 bits. In the same way, to convert from
hexadecimal to binary, we should convert each hexadecimal symbol into its binary
equivalent in 4 bits.


Example 1.7:
a) Convert the following octal number to digital 5238.
b) Convert the following hexadecimal number to binary 4DC216.


5238 = 101 010 0112                    5238 = 1010100112

          5       2    3
4DC216 = 0100 1101 1100 00102                      4DC216 = 1001101110000102

              4        D       C        2

1.4.1.2 Octal to decimal:
       Because octal is a base of eight numeration system, each place weight value
differs from either adjacent place by factor of eight.


Example 1.8:
       Let us convert the following octal number to decimal: A = 264.748

     2 1 0 -1 -2
A = 2 6 4. 7 48
A = 2 × 82 + 6 × 81 + 4 × 80 + 7 × 8−1 + 4 × 8−2
                                 1        1
A = 2 × 64 + 6 × 8 + 4 × 1 + 7 × + 4 ×
                                 8       64
A = 180.937510


Exercise 1.3:
Convert the following octal number to decimal:
A = 4562.368                             C = 264.3658
B = 523411.2328                          D = 4516328
Is the number 12586 an octal number?

Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         12
1.4.1.3 Hexadecimal to decimal:
       The technique for converting hexadecimal notation to decimal is the same as
the one used above, except that each successive place weight changes by a factor
of sixteen.
Example 1.9:
Let us convert the following hexadecimal number to decimal: A = 34DF.AC216
     3 2 1 0 -1-2-3

A = 3 4 D F.A C 216
A = 3 × 163 + 4 × 16 2 + 13 × 161 + 15 × 160 + 10 × 16 −1 + 12 × 16−2 + 2 × 16 −3
A = 12288 + 1024 + 208 + 15 + 0.625 + 0.046875 + 0.000488281
A = 13535.6723610


Exercise 1.4:
Convert from hexadecimal to decimal.
X = A23C.DF16
Y = 7D3E16
Z = D96EC.FA16


1.4.2 Conversion from decimal numeration system to others systems:
       The conversion from decimal numeration system to others systems of
numeration is an important task for everyone dealing with computer science, because
it permits to move from daily world to digital world.
1.4.2.1 General method:
       To convert a number from decimal numeration system to binary, octal or
hexadecimal, we use repeated cycles of divisions to break the decimal numeration
down into multiples of binary, octal or hexadecimal place weight values.
       In the first cycle of division, we take the original decimal number and divide it
by the base of the numeration system that we are converting to: It meant that for
binary, we should divide by 2, for octal we should divide by 8, for hexadecimal we
should divide by 16. Then we take the whole number portion of the division result and
divide it by the result again, and so on, until we end up with a quotient of less than
the base value.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         13
1.4.2.1 Decimal to binary conversion:
       Let us convert the decimal number 8710 to binary, using the principle
described above. It meant that the decimal number should be repeatedly divided by
2.
                       87       2
                       43       2     1
                       21       2     1
                       10       2     1
                       5        2     0
                       2        2     1
                       1              0


       The coloured ciphers are the reminders of repeated division of the decimal
number by 2. To obtain the binary number, we just have to take those reminders,
beginning with the last one, as indicated by the arrow. Then we have:
8710 = 10101112

       In short, the binary bits are assembled from the reminders of the successive
division steps, beginning with the LSB (Least Significant Bit) and proceeding to the
MSB (Most significant Bit).
Exercise 1.5:
Convert the following decimal numbers to binary
A = 15310                     C = 4610
B = 25510                     D = 3810


1.4.2.2 Conversion of decimal numbers less than 1 to binary:
       For converting a decimal number less than 1 to binary, we use repeated
multiplication by 2, taking the integer portion of the product in each step as the next
digit of our converted number. Let us convert the decimal number 0.37510 to binary:
 0.375x2 = 0.75                  Integer portion of the product = 0
 0.75x2 = 1.5                    Integer portion of the product = 1
 0.5x2 = 1                       Integer portion of the product = 1
                                 (we stop when the product is a pure integer)



Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                        14
Each step gives us the next bit further away from the binary point, so the
binary number is obtained taking the bits from up to down.
0.37510 = 0.0112
Remark 1.3:
       With integer division, worked from the LSB to the MSB (down to up), but with
repeated multiplication, we worked from up to down.
Exercise 1.6:
       Convert from decimal to binary:
A = 0.812510                C = 0.87510
B = 0.62510                 D = 0.4062510


Remark 1.4:
       To convert a decimal number greater than 1 with a less than 1 component, we
should use both techniques, one at time. Let us convert the decimal number 23.12510
to binary.
Step one: repeated division for the integer portion 2310.
                       23     2
                       11     2     1
                       5      2     1
                       2      2     1
                       1            0


Partial answer:
2310 = 101112
Step two: repeated multiplication for the less than 1 portion 0.12510.
0.125x2 = 0.25                               Integer portion of the product = 0
0.25x2 = 0.5                                 Integer portion of the product = 0
0.5x2 = 1                                    Integer portion of the product = 1


Partial answer:
0.12510 = 0.0012
Complete answer:
101112 + 0.0012 = 10111.0012


Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                      15
Exercise 1.7:
       Convert from decimal to binary
A = 17.37510                       C = 27.87510
B = 43.62510                       D = 49.4062510


1.4.2.3 Decimal to octal conversion:
       Let us convert the number 12310 from decimal to octal numeration system. As
explained before, we just have to divide the decimal number successively by 8.
                       123 8
                       15     8     3
                       1            7


12310 = 1738
       The octal digits are determined by the reminders left over by each division
step. These reminders are between 0 and 7.
Exercise 1.7:
       Convert the following numbers from decimal to octal:
A = 32310                   C = 12810
B = 45210                   D = 9910


1.4.2.4 Decimal to hexadecimal conversion:
       Let us convert the number 45616 from decimal to hexadecimal. This
conversion is obtained by repeated division of the decimal number by 16.
                       456 16
                       28     16    8
                       1            12
                                    (C16)




45616 = 1C816




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                     16
Exercise 1.8:
Convert from decimal to hexadecimal:
A = 452310                              C = 99710
B = 86710                               D = 123810


1.5 Codes:
         A code is a system of letters, numbers or symbols that represent information.
We have seen in previous sections that every decimal number can be converted in
binary; by so doing, we can say that we are achieving a pure binary codification.
There are many codes used in computer science to facilitate the operation of certain
digital circuits. Some of those codes are: BCD code, Gray code, and alphanumerical
codes.
1.5.1 Binary coded decimal (BCB) code:
         The BCD code of a decimal number is obtained by replacing each digit of the
number by its equivalent in four bits, within the interval 0000 to 1001. Because of the
fact that the maximal digit of the decimal numeration system is 9, the allowable codes
goes from 0 (0000) to 9 (1001). So, the BCD code does not use the codes 1010,
1011, 1100, 1101, and 1111.
         Let us convert the number A = 45610 to BCD.
A=       4   5        6           Decimal


     0100 0101 0110               BCD


A = 010001010110BCD
Example 1.10:
Convert the following BCD number in decimal: X = 0110100000111001. Can the
following series of bits be the BCD code of a decimal number? Y = 011111000001.
X = 0110      1000 0011 1001

         6        8           3    9

X = 683910
Y =0111 1100 0001

     7        ?           1


Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                        17
The second group of bit (1100) is not allowable in the BCD code, so the number Y
cannot be the BCD code of a decimal number.


Exercise 1.9:
Determine the equivalent BCD code of the following decimal numbers:
A = 153610                  C = 5698910
B = 8975610                 D = 23569810
Determine if possible the decimal numbers corresponding to the following BCD
numbers:
A = 100101110110
B = 110111100111


Remark 1.5: Difference between BCD code and binary number
       It is important to realise that the BCD code is not a numeration system as
binary, octal or hexadecimal numerations systems. In fact, it is just a decimal system
whose digits have been replaced by their binary equivalent in four bits. On the other
hand it should be noticed that a BCD number is not a binary number. When we are to
convert a decimal number to binary, the whole number is taken into consideration
meanwhile to convert from decimal to BCD, each individual digit is replaced by its
binary equivalent in four bits.
       For example, let us convert 1910 to binary and to BCD:
3510 = 1000112
3510 = 0011 0101 (BCD).
       It is obvious that the conversion from binary to BCD takes more bits than the
conversion from decimal to binary. So the BCD code is not as efficient as the binary
system. The advantage of the BCD code is just the fact that it is very easy to convert
from decimal to BCD and vice versa.
       The BCD code is found in digital systems using 7 segments displays like
digital voltmeters, digital watch…


1.5.2 Gray code:
       The Gray code is a non weighted code in which each coded representation
differs from the previous representation only by one bit. It is not the case for binary
system where many bits can change when we move from a number to the following

Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                        18
number. For example, when we move from 0111 (710) to 1000 (810), all the four bits of
the representation are changed. The Gray code is not suitable for arithmetical
calculations (because it is not weighted); it is used in the determination of outputs
equations of digital circuits (Karnaugh mapping) and in the design of Analog – Digital
Converters.
       The following table gives us the equivalence between binary representation
and Gray code.
         Decimal                        Binary                          Gray
              0                          0000                           0000
              1                          0001                           0001
              2                          0010                           0011
              3                          0011                           0010
              4                          0100                           0110
              5                          0101                           0111
              6                          0110                           0101
              7                          0111                           0100
              8                          1000                           1100
              9                          1001                           1101
              10                         1010                           1111
              11                         1011                           1110
              12                         1100                           1010
              13                         1101                           1011
              14                         1110                           1001
              15                         1111                           1000


Remark 1.6: How to generate a Gray sequence
       If you observe attentively the Gray sequence above, you will notice that:
   •   For the first column of ciphers (coming from the right to the left), the first zero
       is followed by two ones, which are followed by two zeros, two ones, two
       zeros…
   •   For the next column of ciphers you can notice that the two first zeros are
       followed by four ones, which are followed by four zeros, four ones…



Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                           19
•    For the third column of ciphers, the four first zeros are followed by eight ones,
        which are followed by eight zeros, eight ones…
   This is the principle to be used in order to generate a Gray sequence.


1.5.3 Alphanumerical codes
        A computer would have been useless if it wasn’t able to treat non numerical
information. In fact, a computer should be able to recognize codes corresponding to
numbers, letters or some special characters. Such codes are called alphanumerical
codes. Generally the keyboard of a computer should contain the following symbols:
   •    The 26 letters of the alphabet (capital and small letters);
   •    The 10 ciphers of the decimal numeration system,
   •    Almost 25 special characters like +, /,>, <, @, %...
        There are almost 87 characters and to represent those characters, we need at
least 7 bits because with 7 bit, we can have up to 27 = 128 different binary numbers.
So, we use 87 of those binary numbers to codify the 87 characters.
        The most known alphanumerical code is called American Standard code for
Information Interchange (ASCII). This code is used by almost all the computer
constructors.
        The following table gives the ASCII code corresponding to some of the
characters.


       Character           ASCII code                 Octal           Hexadecimal
          A                  100 0001                  101                  41
          B                  100 0010                  102                  42
          C                  100 0011                  103                  43
          D                  100 0100                  104                  44
          E                  100 0101                  105                  45
          F                  100 0110                  106                  46
          G                  100 0111                  107                  47
          H                  100 1000                  110                  48
           I                 100 1001
           J                 100 1010
          K                  100 1011


Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                          20
L                 100 1100
         M                 100 1101
         N                 100 1110
         O                 100 1111
         P                 101 0000
         Q                 101 0001
         R                 101 0010
         S                 101 0011
         T                 101 0100
         U                 101 0101
         V                 101 0110
         W                 101 0111
         X                 101 1000
         Y                 101 1001
         Z                 101 1010
         0                 011 0000
         1                 011 0001
         2                 011 0010
         3                 011 0011
         4                 011 0100
         5                 011 0101
         6                 011 0110
         7                 011 0111
         8                 011 1000
         9                 011 1001
       Blank               010 0000
         .                 010 1110
         (                 010 1000
         +                 010 1011
         $                 010 0100
         *                 010 1010
         )                 010 1001
         -                 010 1101

Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.   21
/                    010 1111
           ,                    010 1100
          =                     011 1101


Exercise 1.10:
    •   Give the octal and hexadecimal equivalent for all the ASCII codes given
        above.
    •   The following instruction coded in ASCII is composed on the keyboard of a
        computer. Give its signification: 101 0011, 101 0100, 100 1111, 101 0000.
Answer: Using the table above we find that the instruction is STOP.



1.6 Conclusion
        This chapter has permitted us to study and to master (I hope so) the most
common numeration systems and codes. We have also studied methods of
conversion from each numeration system to another. In the next chapter, we will
study the behaviour of logic gates, which can be considered as elementary ‘bricks’
used in the construction of any digital circuit.


                              REVIEW QUESTIONS

    1. Give the difference between analogue and digital representations.


    2. Convert from binary to decimal:
    A = 110112                         D = 10010.0112
    B = 10111012                       E = 101001111112
    C = 10111112                       F = 1110111.00012


    3. Convert from binary to octal:
    A = 111011.011012                  D = 111011111012
    B = 101101112                      E = 10011101.1102
    C = 11011110.01012                 F = 100111101011112




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                        22
4. Convert from binary to hexadecimal.
   A = 1111010.11102              C = 111010111.112
   B = 101111101111012            D = 10110110.1111012


   5 Convert from octal to binary:
   A = 1238                       C = 3578
   B = 6538                       D = 5478


   6 Convert from hexadecimal to binary.
   X = F47B16                     Z = 8CE016
   Y = 5FD316                     P = FFFC16


   7 Convert from octal to decimal :
   A = 1258                       C = 5638
   B = 2568                       D = 4538


   8. Convert from hexadecimal to decimal:
   X = F47B16                     Z = 8CE016
   Y = 5FD.316                    P = FFF.C16


   9. Convert from decimal to binary:
   A = 2310                       C = 5310
   B = 25.37510                   D = 101.2510


   10. Convert from decimal to octal:
   A = 42310                      C = 43810
   B = 126410                     D = 342310


   11. Convert from decimal to hexadecimal:
   A = 126210                     C = 256310
   B = 356210                     D = 56423610


   12. Convert from octal to hexadecimal:
   A = 123.628                    B = 432.58

Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.   23
13 Determine the highest decimal number that can be represented using 8bits, 16
       bits.


   14 In most of the computers, the addresses of memory locations are expressed in
       hexadecimal. Those addresses are sequential numbers that identify each
       memory location.
           a) A computer can store data of 8 bits (1byte) in each of his memory
               location. If the addresses of the memory locations run from 000016 to
               FFFF16, then give the number of memory locations of that computer.
               Deduce the capacity of its memory.
           b) Another computer has 4096 memory locations. Give the interval of their
               addresses starting from 000016.


   15 Determine the number of bits to be used to represent the decimal numbers
       from 00010 to 99910: a) using pure binary code b) using BCD code.


   16 Express in ASCII the following instruction: “X = 25/Y”


   17 Convert from BCD to binary: A = 01110100 (BCD).




References:
   1. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition,
       Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985.
   2. Lessons In Electric Circuits Volume IV – Digital, Tony R. Kuphaldt, Fourth
       Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         24
Courses In
                    Electrical
                   Engineering

                                      Volume II

                           DIGITAL ELECTRONICS

                       CHAPTER TWO : LOGIC GATES



                                          By

                                    J-P. NGOUNE

                 DIPET I (Electrotechnics), DIPET II (Electrotechnics)
                              DEA (Electrical Engineering)
            Teacher in the Electrical Department, GTHS KUMBO, Cameroon.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.              25
Chapter Two
                                        LOGIC GATES
2.0 Specific objectives:
       At the end of this chapter, the student will be able to:
   -   Understand the functioning of the logic gates;
   -   Draw the truth table of simple logic circuits;
   -   Know logic voltage levels for TTL and CMOS technologies;
   -   Design a simple logic circuit using logic gates.


2.1 Introduction:
       Logic gates are “elementary bricks” used in the construction of digital circuits.
While the binary numeration system studied in the precedent chapter was an
interesting mathematical abstraction, we have not yet seen its practical application to
electronics. This chapter is devoted to practically apply the concept of binary digits to
circuits. A logic gate is a special type of circuit designed to accept (inputs) and
generate (outputs) voltages signals corresponding to binary digits (1 and 0).


2.2 Digital signals and gates:
       Let us consider the following circuit:
                              Vcc




                                  1                     LED
                                    S
                                                R


                                  0



                                Figure 2.1: Logic circuit.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                          26
When the switch is connected to the ground (0V), the light emitting diode
(LED) does not shine. If we were using this circuit to represent binary digits, we
would say that the input signal is a binary “0” and that the output is a binary “0” or that
the output is at the low logic level. Moving the switch to the other position (Vcc), we
apply a binary “1” to the input and receive a binary “1” at the output. The output is
also said to be at the high logic level.
        The gate shown by this simple circuit is a “buffer” or “yes” gate, because the
logic state of its input is identical to that of its output. Many types of gates are used in
digital electronics: single input gates like the buffer and the NOT gates; multiple
inputs gates like AND, NAND, OR, NOR, and XOR gates. The aim of this chapter is
to study the functioning of each of those logic gates and also how they can be
combined to design a simple logic function.


2.3 The NOT gate:
        The NOT gate or Inverter is a logic gate which functions in such a way that the
logic state of the output is exactly the opposite of that of the input.
Remark 2.1: The truth table
        A truth table is a standard way of representing the Inputs/outputs relationships
of a digital circuit, listing all the possible input logic level combinations with their
respective output logic levels.
   •    The NOT gate truth table:
                                      Input    Output
                                           0     1
                                           1     0


   •    Symbol


Input            Output


Remark 2.2: the buffer gate
        If we were to connect two inverter gates together so that the output of one fed
into the input of another, the two inversion functions would “cancel” each other out so
that there would be no inversion from input to final output.

Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                             27
1
                               0                                 0



                             Figure 2.2: Principle of the buffer gate


        A buffer is a special logic gate manufactured to perform the same function as
two inverters connected together. Buffer gates serve to amplify signals, taking a weak
signal source that is not capable of providing much current, and boosting the current
capacity of the signal so as to be able to drive a load.
   •    Symbol of a buffer gate:

Input             Output

   •    Truth table of the buffer gate:
                                       Input    Output
                                        0         0
                                        1         1


2.4 Multiple input gates:
        With a single input gate such as the inverter or buffer, there can only be two
possible input states: either 1 or 0. With multiple input gates, many possibilities are
available for input states. The number of possible input states is equal to two to the
power of the number of inputs. So, if a gate has n inputs, therefore there are 2n
possible input combinations.
2.4.1 The AND gate:
        The output of the AND gate is high if and only if all inputs are high. If any input
is low, the output is guaranteed to be in a low state as well.
   •    Truth table:
   Let us draw the truth table of a two inputs AND gate.
                        A        B       A.B
                        0          0        0
                        0          1        0
                        1          0        0
                        1          1        1



Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                            28
As you can notice on the truth table above, the output is high only when all the
two inputs are high.
    •   Symbol
A
                 Output
B

Exercise 2.1:
        Draw the truth table of a three inputs AND gate.
Exercise 2.2:
        Complete the chronogram of the output Q of a two inputs AND gate.


                          A




                          B                                    t




                                                               t
                          Q




                                                               t

        The following solution can be given for the exercise 2.2 above:
                          A
                          1


                          0
                          B                                        t
                          1


                          0
                                                                   t
                          Q
                          1


                          0
                                                                   t

2.4.2 The NAND gate:
        The word NAND is a verbal contraction of the words NOT and AND.
Essentially, a NAND gate behaves the same as an AND gate with a not gate
connected to the output terminal.
    •   Symbol
A
                Output
B




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         29
•   Truth table:
    Let us draw the truth table of a two inputs NAND gate.
                       A         B          A.B
                       0         0           1
                       0         1           1
                       1         0           1
                       1         1           0


    As with AND gates, NAND gates can be made with more than two inputs.


Exercise 2.3:
        Complete the chronogram of the output Q of a two inputs NAND gate.
                           A




                           B                                   t




                                                               t
                           Q




                                                               t

2.4.3 The OR gate:
        The output of the OR gate is high if any of the inputs is high. The output of an
OR gate goes low if and only if all inputs are low.
    •   Truth table:
                           A         B      A+B
                           0         0           0
                           0         1           1
                           1         0           1
                           1         1           1


    •   Symbol:
A
              Output
B




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         30
Exercise 2.4:
       Draw the truth table of a three inputs OR gate.
Exercise 2.5:
       Complete the chronogram of the output Q of a two inputs OR gate.
                          A




                          B                                     t




                                                                t
                          Q




                                                                t

Exercise 2.6:
       Let us consider the following digital circuit:

A


B

C

                                                                                          X
E
    a. Give the expression of the output X.
    b. Draw the truth table of the digital circuit.


Exercise 2.7:
       Draw the truth table of the digital circuit described by the following equation:
X = AB + ABC + AC
Exercise 2.8:
       Let us consider the following digital circuit:
A

B
                  C
                                                 D
                                                                                          X
                                                                E

    a. Give the expression of the output X.

Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                              31
b. Draw the truth table of the circuit.
    c. Answer the two previous questions considering the following digital circuit:
           A

           B                                                                 X




           C

2.4.4 The NOR gate:
        The NOR gate is an OR gate with its output inverted.
    •   Truth table:
                            A       B            A+ B
                            0       0             1
                            0       1             0
                            1       0             0
                            1       1             0
    •   Symbol:
A
                   Output
B




        The NOR gate can also be manufactured with more than two inputs.


Exercise 2.9:
Let us consider the following digital circuit:
               A
               B


               C
               D
                                                                         X
               E
    a. Give the expression of the output X.
    b. Draw the truth table of the circuit.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                          32
Remark 2.3: The negative AND gate, the negative OR gate.
       Let us consider the following digital circuit:

                        A
                                                               X
                        B

    a. Draw the truth table of this circuit.
    b. Show that this circuit is equivalent to a NOR gate.


       The expression of the output X can be written as follow: X = A.B . Therefore,
the truth table of the circuit can be easily deduced:
                         A          B          X
                         0          0           1
                         0          1           0
                         1          0           0
                         1          1           0


       We can notice that the truth table of this circuit is identical to that of a NOR
gate. The gate described in this exercise is called the negative AND gate and its
symbol is given as follow:
A
                   Output
B
       Let us consider the following gate circuit:

                         A

                                                               X

                         B
    a. Draw the truth table of the circuit.
    b. Show that the circuit is equivalent to a NAND gate.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                        33
The expression of the output X can be written as follow: X = A. + B . Therefore,
the truth table of the circuit can be easily deduced:
                         A         B           X
                         0         0           1
                         0         1           1
                         1         0           1
                         1         1           0


        We can notice that the truth table of this circuit is identical to that of a NAND
gate. The circuit described in this exercise is called the negative OR gate. Its symbol
is given as follow:
    1
A               3
    2               Output
B


Remark 2.4:
        The previous remark leads us to two important theorems of the Boolean
algebra (the Boolean algebra will be studied in detail in the next chapter). Those
theorems are called De Morgan’s theorems:

        A + B = A..B
        A.B = A + B
        Where A and B are two Boolean variables (A Boolean variable is that which
can only take values 0 and 1).


2.4.5 The exclusive-OR gate:
        The exclusive-OR gate outputs a high level only if the inputs are at different
logic levels, either 0 and 1 or 1 and 0. Conversely, its output is low if the inputs are at
the same logic levels. The exclusive-OR gate is sometimes called XOR gate.
    •   Truth table:
                         A         B         A⊕ B
                         0         0           0
                         0         1           1
                         1         0           1
                         1         1           0

Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                            34
•   Symbol:
A
                 Output
B


Exercise 2.10:
        Let us consider following gate circuit:




                       A                                       Y

                       B


    a. Determine the expression of the output.
    b. Deduce the truth table.
    c. Conclude.
Remark 2.5:
        From the exercise above the following property can be deduced:
A.B + A.B = A ⊕ B


2.4.6 The exclusive-NOR gate:
        The exclusive-NOR gate is equivalent to an exclusive OR gate with an
inverted output. The truth table is exactly opposite as for the exclusive-OR gate. The
exclusive-NOR gate also known as the XNOR gate.


    •   Truth table:
                           A        B        A⊕ B
                           0        0             1
                           0        1             0
                           1        0             0
                           1        1             1


Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                       35
•   Symbol:
    1
A                  3
    2                  Output
B



Exercise 2.11:
        Let us consider the following gate circuit:




                       A                                          X
                       B



    a. Determine the expression of the output.
    b. Deduce the truth table.
    c. Conclude.


Remark 2.6:
        From the previous exercise, the following property can be deduced:
A..B + A.B = A ⊕ B
        The exclusive-OR and exclusive-NOR gates are very useful for circuits where
two or more binary numbers are to be compared bit-for-bit, and also for error
detection (parity check).


2.5 Gate universality:
        NAND and NOR gates posses a special property: they are universal. That is,
given enough gates, either type of gate is able to mimic the operation of any other
gate type. This ability for a single gate type to be able to mimic any other gate type is
enjoyed only by the NAND and the NOR gate.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                          36
2.5.1 Constructing the NOT function:
                                                            Vcc


Input
                                 Output
                                                                                       Output
                                                    Input



                                                    Input
Input                                                                                  Output
                                 Output




2.5.2 Constructing the buffer function:
                          Vcc               Vcc



                                                                              Output
          Input



          Input
                                                                              Output




2.5.3 Constructing the AND function:


                          A                                       Output
                          B




                      A



                                                                  Output

                      B




2.5.4 Constructing the NAND function:
                  A




                                                                     Output

                  B




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                              37
2.5.5 constructing the OR function:
                             Vcc




                     A



                             Vcc                               Output




                     B




                         A
                         B                                     Output




2.5.6 Constructing the NOR function:
                     Vcc



                                                       Vcc
                 A


                                                                        Output
                     Vcc




                 B




2.6 Voltages for logic states:
       Logic gate circuits are designed to input and output only two types of signals;
‘high’ (1) and ‘low’ (0), as represented by a variable voltage: Full power supply
voltage for a high state and zero voltage for a low state. However, in reality, logic
state voltage levels rarely attain these perfect limits.
       TTL gates (Transistor Transistor Logic) operate on a nominal power supply
voltage of 5 volts+/- 0.25 volts. Acceptable input signal voltages range from 0 volt to
0.8 volt for low logic state, and 2 volts to 5 volts for high logic state. Acceptable
output signal voltages range from 0 volt to 0.5 volt for low logic state and 2.7 volts to
5 volts for high logic state.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                          38
High
            High                           High level noise margin




            Low
                                           Low level noise margin     low


                         Figure 2.3: Voltage levels for TTL gates


       The noise margin of a gate is the difference between the tolerable output and
input ranges.
       For CMOS gates (Complementary Metal Oxide Semiconductor) operating at a
power supply of 5 volts, the acceptable input signal voltages range from 0 volt to 1.5
volts for low logic state, and 3.5 volts to 5 volts for a high logic state. Acceptable
output signal voltages range from 0 volt to 0.05 volt for a low logic state and 4.95
volts to 5 volts for a high logic state.
Exercise 2.12:
       Calculate the high level noise margin and the low level noise margin for CMOS
circuits operating at a power supply of 5 volts. Compare that noise margin with that of
a TTL circuit.
Remark 2.7:
       Unlike TTL, which is restricted to a power supply voltage of 5 V, CMOS may
be powered by voltages as high as 15 volts or 18 volts.


2.7 DIP gate packaging:
       Digital logic gates are manufactured as integrated circuits: all the constituent
transistors and resistor built on a single piece of semiconductor material. The
technicians and engineers find logic gates enclosed in DIP (Dual Inline Package)
housing.
       Part numbers given to these DIP packages specify what type of gates are
enclosed, and how many. These part numbers are industry standards.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                        39
A ‘74LS02’ manufactured by Motorola will be identical in function to a ‘74LS02’
manufactured by Fairchild or by other manufacturers. Letter codes added to the part
number are unique to the manufacturer and are not industry standard codes. For
instance, a ‘SN74LS02’ is a quad-2 inputs TTL NOR gate manufactured by Motorola
while a ‘DM74LS02’ is the exact same circuit manufactured by Fairchild.
       Logic circuit part numbers beginning with ‘74’ are commercial-grad TTL. If the
part number begins with the number ‘54’, the chip is a military grad unit having a
greater operating temperature range, and typically more robust in regard to allowable
power supply and signal voltage levels.
       The letters ‘LS’ immediately following the 74 or 54 prefix indicate low power
shottky circuitry.




                     Figure 2.4: Examples of TTL DIP circuit packages:




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                       40
Figure 2.5: Examples of CMOS DIP circuit package


2.8 Conclusion:
       In this chapter, we have studied the functioning of logic gates which are basic
tools used in the design of any logic circuit. An introduction has also been made
concerning the input and output voltage levels for TTL and CMOS circuits. The aim of
the next chapter is the study of the Boolean algebra. It is a set of mathematical
properties and identities governing the functioning of logic circuits.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                       41
REVIEW QUESTIONS

   1. Consider the following gate circuit:

               A                                                        X


               B
               C




               D

   a. Give the expression of the output X.
   b. Draw the truth table of the circuit.


   2. Draw the gate circuits corresponding to the following expressions:
       X = A.B(C + D)

       Y =  A + B + C D E  + BC D
                          
                          
           (              )
       Z = A + B + PQ ⊕ C D
   3. For each of the following circuits, give the expression of the output and draw
       the truth table.
                   A



                   B


                                                                    X
                   C




                   A
                   B                                                Y




                   C




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                     42
A


      B


      C


                                                                                     Z




      D




References:
   3. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition,
       Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985.
   4. Lessons In Electric Circuits Volume IV – Digital, Tony R. Kuphaldt, Fourth
       Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         43
Courses In
                    Electrical
                   Engineering

                                      Volume II

                           DIGITAL ELECTRONICS

                 CHAPTER THREE : BOOLEAN ALGEBRA



                                          By

                                    J-P. NGOUNE

                 DIPET I (Electrotechnics), DIPET II (Electrotechnics)
                              DEA (Electrical Engineering)
            Teacher in the Electrical Department, GTHS KUMBO, Cameroon.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.              44
Chapter Three
                 BOOLEAN ALGEBRA
3.0 Specific objectives:
       At the end of this chapter, the student will be able to:
   -   Master the rules of Boolean arithmetic;
   -   Master Boolean algebraic identities and properties;
   -   Convert truth tables of logic circuits into Boolean expressions.


3.1 Introduction:
       The Boolean algebra was created by the English mathematician George Boole
(1815-1864). The      Boolean      algebra   codifies   rules   of   relationship   between
mathematical quantities to one of two possible values: true or false, 1 or 0. So, all
arithmetic operations performed with Boolean quantities have but one of two possible
outcomes: either 1 or 0. There are three basic Boolean arithmetic operations:
   •   Boolean addition which is equivalent to the OR logic function, as well as
       parallel switch contacts;
   •   Boolean multiplication, which is equivalent to the AND function as well as
       series switch contacts;
   •   Boolean complementation which is equivalent to the NOT logic function.


3.2 Boolean arithmetic:
       This section presents the basic relationship concerning the three basic
Boolean arithmetic operations.
3.2.1 Boolean addition:
       As we have already said, Boolean addition is equivalent to the OR logic
function. Therefore, we have the following relationships:
0+0=0
0+1=1
1+0=1
1+1=1
Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                             45
0+0=0                                   0
                           0
0
               0           0
0



0+1=1                                   1
                           0
    U1
0
               1           1
1




1+0=1                                   1
                           1
    U2
1
               1           0
0




1+1=1                                   1
                           1
    U3
1
               1           1
1



Remark 3.1:
         There is a difference between Boolean addition and binary addition; for binary
addition we have the following relationships.
0+0=0
0+1=1
1+0=1
1 + 1 = 10 (1 + 1 = 0 + report of 1).


3.2.2 Boolean multiplication:
         The Boolean multiplication is equivalent to the AND logic function:
0x0=0
0x1=0
1x0=0
1x1=1




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         46
0x0=0
                                              0
0                            0     0
              0
0



0x1=0                                         0
                                              1
0                            0     1
              0
1


1x0=0
                                              0
1                            1     0
              0
0


1x1=1
                                              1
1                            1     1
              1
1


3.2.3 Boolean complementation:
         The Boolean complementation is equivalent to the NOT logic function.
/0 = 1       0               1



/1 = 0       1               0



3.3 Boolean algebraic identities:
         An identity is a statement that is true for all possible values of its variables.
There are two groups of Boolean algebraic identities: additive identities and
multiplicative identities.
3.3.1 Additive identities
         If A is a Boolean variable, then the following statements are always true.
A+0=A
A+1=1
A+A=A
A + /A = 1
                             A
A+0=A                                     A
A
              A
0                            0




                             A
    A+1=1                                 1
A
              1
1                            1




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                           47
A
 A+A=A                                     A
A
              A
A                           A



                            A
A + /A = 1                                 1
A
              1
/A                          /A



3.3.2 Multiplicative identities:
         A being a Boolean variable, the following statements are always true.
0xA=0
1xA=A
AxA=A
A x/A = 0
0xA=0
                        0        A    0
0
               0
A




1xA=0
                        1        A    A
1
               A
A




AxA=A
                        A        A    A
A
               A
A




A x /A = 0
                        A        /A   0
A
               0
/A


Remark 3.2: Double complementation
         Complementing a variable twice results in the original Boolean value.
                   /A
A                                //A = A




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                     48
3.4 Boolean algebraic properties:
       Let us consider three Boolean variables A, B and C. The following properties
are true.
   •   Commutative property:
   -   Addition:
A+B=B+A
   -   Multiplication:
AxB=BxA
   •   Associative property:
   -   Addition:
A + (B + C) = (A + B) + C
   -   Multiplication:
A(B.C) = (A.B)C
   •   Distributive property:
A(B + C) = A.B + A.C


3.5 Boolean rules for simplification:
       There are several rules for Boolean algebra intended to be used in reducing
complex Boolean expressions to their simplest forms. The simplification of the
Boolean expressions of logic circuits brings many advantages:
   -   Higher operating speed (less delay time from input signal transition to output
       signal transition).
   -   Less power consumption (few IC used).
   -   Less cost.
   -   Greater reliability.


3.5.1 Rule n° A + AB = A
            1:
A + AB = A (1 + B)
        = A (1)
       =A
3.5.2 Rule n° A + AB = A + B
            2:
A + AB = A + AB + AB (Apply the previous rule to expand A term to A + AB)
                  (      )
        = A + B A + A (Factorising B)

Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                      49
= A + B(1) (Applying identity A + A = 1 )
         = A+ B
3.5.3 Rule n°
            3:     ( A + B )( A + C ) = A + BC
( A + B )( A + C ) = A. A + A.C + A.B + B.C   (Distributing terms)
                 = A + AC + AB + BC (Applying identity AA = A)
                 = A + AB + BC (Applying A + AC = A)
                 = A + BC (Applying A + AB = A)


3.6 Circuit simplification example:
        Let us consider the following logic circuit.
A
B                                                           Q




C




    1. Write the Boolean expression of the output Q:
Q = AB + BC (B + C ) )
    2. Reduce this expression to its simplest form using the rules of Boolean algebra.
Q = AB + BCB + BCC
    = AB + BC + BC (Using the identity A.A =A)
    = AB + BC (Identity A.A = A)
Q = B( A + C )
    3. Generate the schematic diagram of the simplest expression
B
                                                 Q


A
C

Remark 3.3
        To convert Boolean expression to a gate circuit, you should evaluate the
expression using standard order of operation:
    -   Multiplication before addition,
    -   Operation within parenthesis before anything else.

Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                       50
Exercise 3.1:
        Simplify the following expressions using Boolean algebra and generate the
schematic diagrams of the simplest expressions.
X = A.B.C + A.BC + ABC + AB.C + A.B.C
    ( )( )
Y = B+C B+C + A+ B+C
Z = (C + D ) + AC D + AB.C + A..BCD + A.C.D
3.7 The exclusive-OR function
A
                         A⊕ B
B


A ⊕ B = A.B + A.B


3.8 DeMorgan’s theorem

AB = A + B
A + B = A..B
        DeMorgan’s theorem may be thought in terms of breaking a long bar symbol.
When a long bar is broken, the operation directly imply the changes from addition to
multiplication or vice versa, and the broken bar pieces remains over the individual
variables.
Remark 3.4:
        When multiple layers of bar exists in an expression, you may only break one
bar at a time.
Example 3.1:
        Let us simplify the following expressions:

A + BC = A.BC (The superior bar broken)
          = A.BC

    A + B + C = A.B.C

               = A.BC




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                     51
3.9 Converting truth table into Boolean expression:
       We can convert truth table into Boolean expression using one of the following
methods:
   -   Sum of products (SOP)
   -   Product of sums (POS)
3.9.1 Sum of products:
       Boolean expressions may be generated from truth table quite easily using the
following steps:
   -   Determine which rows of the table have an output of 1;
   -   Write one product for each raw;
   -   Sum all the product terms.
This creates a Boolean expression representing the truth table as a whole.
Example 3.2:
       Let’s consider a logic circuit having the following truth table:
  A        B       C        Q
  0        0        0        0      Row 1
  0        0        1        0      Row 2
  0        1        0        0      Row 3
  0        1        1        1      Row 4
  1        0        0        0      Row 5
  1        0        1        1      Row 6
  1        1        0        1      Row 7
  1        1        1        1      Row 8


       The rows 4, 6, 7 and 8 have an output of 1, each raw gives us a product. By
summing those products, we obtain the following Boolean expression which is that of
the output Q.
Q = ABC + A BC + ABC + ABC
Exercise 3.2:
       Simplify the expression of the output Q treated in the example above using
Boolean algebra and generate the schematic diagram of the simplest expression.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                     52
3.9.2 Product of sums:
       Boolean expression may be also generated from truth table quite easily by
determining which rows of the table have an output of 0, writing one sum term for
each row and finally multiplying all the terms.
Example 3.3:
       Let us consider a logic circuit having the following truth table.
  A        B       C       Q
  0        0       0       0      Row 1
  0        0       1       1      Row 2
  0        1       0       1      Row 3
  0        1       1       1      Row 4
  1        0       0       1      Row 5
  1        0       1       1      Row 6
  1        1       0       1      Row 7
  1        1       1       0      Row 8


       The rows 1 and 8 have an output of 0; each row gives us a sum. The product
of those sums gives us a Boolean expression which is that of the output of the logic
circuit. In fact, we have:
Q = A.B.C + ABC

Q=Q

     (         )
   = A..B..C + ABC
   = (A..B..C ). A.B.C

   =  A + B + C (A + B + C )
                  
                  
   = ( A + B + C )(A + B + C )

Q = ( A + B + C ).( A + B + C )
       In reality for each row having an output of 0, we should notice that we have but

the inverted output product ( Q ). By inverting that output ( Q ), we obtain a sum using
DeMorgan’s theorem. Finally, the product of all those sums gives us the output of the
logic circuit.



Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         53
Remark:
         Generally, the sum of products is more used than the product of sums to
convert a truth table into Boolean expression. However, when a few number of rows
have an output of 0, it is preferable to use the POS than to use the SOP.
Exercise 3.3:
         Generate the logic diagram of the circuit treated the example 3.3.
Exercise 3.4:
         Assuming that A ⊕ B = A.B + A.B , proof that A ⊕ B = A.B + A..B


3.10 Conclusion:
         This chapter has permitted us to study the identities and the properties of the
Boolean algebra. Those are tools used for the simplification of the Boolean
expressions. However, this simplification is sometime very difficult to carry out,
especially for logic circuit having complex Boolean expression. To solve this problem,
another method of simplification has been proposed: that is Karnaugh mapping. It is
the topic of the next chapter.


                            REVIEW QUESTIONS
      1. Simplify the following expressions using Boolean algebra:
    X = ABCD + A..B.C.D + A.B.C D + A.B.C.D + A.BCD + ABC.D + ABC D + ABC D + ABCD
Y = ABC + ABC + ABC + ABC


      2. Simplify the following circuit using the Boolean algebra.
A
B
C




                                                                                      X




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         54
3. Conceive de logic circuit corresponding to the following truth table.
   A              B         C         X
   0              0         0         1
   0              0         1         0
   0              1         0         1
   0              1         1         1
   1              0         0         1
   1              0         1         0
   1              1         0         0
   1              1         1         1


   4. Logic gates can be realised using diodes and resistors. Consider the following
           circuits:
                                Vcc




      Va                                             Va
                                          S                                        S
            Vb                                            Vb




a. Analyse the functioning of each circuit by filling the following truth table.
 Va          Vb        Vs
  0           0
  0           1
  1           0
  1           1


b. Deduce the logic gate described by those circuits


Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                       55
5. Logic gates can also be realised using resistor and transistor: That is resistor
        transistor logic (RTL). Consider the following circuits:
                            Vcc                                          Vcc




                                                                                    Vout

Va                                               Va
                                         Vout




                                                 Vb
Vb




                                         Vcc




                                                      Vout

                           Vin




Study the functioning of each of those circuits and determine the logic gate described
by each of them.


     6. Logic gates can also be realised using diodes and transistors.
                 Vcc




Va                                Vout


Vb




Study the functioning of the circuit and deduce the logic gate that it describes.



Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         56
7. A3A2A1A0 is a binary number having four bits. A3 is the MSB and A0 is the LSB.
       Conceive a logic circuit that produces an output of 1 when the binary number
       is superior to 0010 and inferior to 1000.
   8. A logic circuit has 4 inputs A, B, C and D, and one output X. The output X is
       high only if C and D are low while A or B or both (A and B) are high. Conceive
       the logic circuit so described.


   NB: The conception of a logic circuit requires the following steps:
   -   Truth table;
   -   Determination of the simplified expression of the output;
   -   Logic diagram of the circuit using logic gates.




References:
   5. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition,
       Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985.
   6. Lessons In Electric Circuits Volume IV – Digital, Tony R. Kuphaldt, Fourth
       Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         57
Courses In
                    Electrical
                   Engineering

                                      Volume II

                           DIGITAL ELECTRONICS

                 CHAPTER FOUR: KARNAUGH MAPPING



                                          By

                                    J-P. NGOUNE

                 DIPET I (Electrotechnics), DIPET II (Electrotechnics)
                              DEA (Electrical Engineering)
            Teacher in the Electrical Department, GTHS KUMBO, Cameroon.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.              58
Chapter Four
            KARNAUGH MAPPING
4.0 Specific objectives:
       At the end of this chapter, the student will be able to simplify Boolean
expressions using Karnaugh mapping.


4.1 Introduction:
       Karnaugh map, like Boolean algebra is a simplification tool applicable to digital
logic. Maurice Karnaugh, a telecommunication engineer developed the k-map at Bell
labs in 1953 while designing digital logic based telephone switching circuits. K-map
reduces logic functions more quickly and easily compared to Boolean algebra. By
reduce we mean simplify, reducing the number of gates and inputs. K-map works
well for up to six input variables (in this course we will study up to 4 input variables).
For more than six variables, simplification should be done by CAD (Computer
Automated Design).
4.2 Karnaugh maps, truth tables and Boolean expression:
       Karnaugh map is filled using Gray code. As we have already seen in the first
chapter, Gray code is a numeration code which is such that, in a given Gray
sequence, each number differs from the next or the previous number only with one
bit. In order to know how to generate a Gray sequence of number, please go back to
the first chapter which treated the matter of numeration systems and codes.


4.2.1 Transferring the content of a truth table into a k-map:
       Let us consider the following truth table:
A       B        X
0       0        0
0       1        1
1       0        0
1       1        1


Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                           59
The content of the truth table can be transferred to the truth table as follow:
X
        B       0       1
    A                                  Top
        0       0       1
        1       0       1


     Side

            The logic states of the output are written in the table according to the
    combination of the input variable A and B. Each location of the table corresponds to
    one logic state of the output. So we have four locations here because we have four
    output combinations according to our truth table. The logic states of the inputs A and
    B are filled using Gray code.
            To determine the simplified Boolean expression of the output, we should follow
    the following steps:
        •   Look for adjacent cells; that is above or to the side of a cell. Diagonal cells are
            not adjacent.
        •   Circle the two adjacent ones.
        •   Find the variables top and/or side which are the same for the group. It is the
            variable B in our case. It means that, as we can notice, for the group of ones,
            the variables B remains unchanged and equal to 1. Write this as the Boolean
            result.
        •   Ignore variables which are not the same for the cell group. In our case, A
            varies. It is both 1 and 0. So A should be ignored; it cannot be written as
            Boolean result.
        •   Ignore any variable not associated with cells containing ones.
        •   Then the Boolean expression of the output is: X = B




    Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                              60
Exercise 4.1:
    Consider the following logic diagram:


    A        B




                                                          X




    a. Establish the truth table of the circuit.
    b. Give the Boolean expression of the output using SOP (Sum of products)
        method.
    c. Give the simplified Boolean expression of the output using K-map.


Exercise 4.2:
        For each of the following truth table, write the Boolean expression of the
output using k-maps.
A        B        X                           A    B           X
0        0        1                           0    0           0
0        1        1                           0    1           1
1        0        0                           1    0           1
1        1        0                           1    1           1


A        B        X                           A    B           X
0        0        1                           0    0           1
0        1        0                           0    1           1
1        0        1                           1    0           0
1        1        1                           1    1           1




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                   61
Remark 4.1: How to determine the Boolean expression of a gate circuit.
        •     Write the Boolean expression of the output using SOP method;
        •     Transfer the product terms to the k-map;
        •     Form groups of adjacent cells;
        •     Deduce simplified Boolean expression of the output.
        •      Draw the simplified logic circuit.
    Example 4.1:
    Let us determine the simplified Boolean expression of the following circuit using k-
    map.
    A             B




                                                                X




        •     Using the SOP method the Boolean expression of the output can be written as
              follow:
    X = A B + AB
        •     The expression can then be transfer in a k-map:
X
        B         0        1
    A
        0         0        1
        1         1        0


        •     It is not possible to form groups of adjacent ones. The two ones of the k-map
              are isolated.
        •     No simplification is therefore possible. The Boolean expression should be left
              as it is.
            X = AB + AB = A ⊕ B




    Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         62
This is not a simplified expression. This ‘simplification’ is just intended to make
    a schematic diagram look nicer. In fact exclusive-or function is a combination of other
    functions.
    4.2.2 Logic simplification with Karnaugh map:
             Boolean simplification that we have done above could be achieved with
    Boolean algebra quickly. Real world logic simplification problems call for larger k-
    maps so that we may do serious work. We will now develop tools that we need for
    more complex application in combinatory logic.
    4.2.2.1 General method
             These are the steps which should be followed for the simplification of a
    Boolean expression using Karnaugh mapping.
        •    Draw the k-map filling the ones and the zeros in the corresponding cells;
        •    Observe with attention the k-map and detect the ones which are isolated:
             those are the ones that are not adjacent to another one. Circle them.
        •    Find the ones which are adjacent only to one another one. Circle them to form
             groups of two ones.
        •    Find groups one eight ones which are adjacent and circle them, even if among
             them there are ones belonging already to a group of two ones.
        •    Find groups of four adjacent ones and circle them. Among the four ones there
             should be at least one one which has not yet been grouped.
        •    Then deduce the simplified Boolean expression.
    The following sizes of k-map will be used


                                                       X
                                                                CD
                                                           AB         00      01     11     10
X                                                          00
        BC
    A
               00     01     11     10                     01
    0                                                      11
    1                                                      10


    K-map for 3 Boolean input variables              K-map for four Boolean input variables



    Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                             63
As we have already said, the input logic states are filled using Gray code, so
    for instance, if we have two variables A and B, the Gray sequence will be:
    00,01,11,10 (a binary sequence would have been 00,01,10,11!).


    4.2.2.2 K-map for three input Boolean variables:
             Let us consider the following three variables Boolean expression.
    X = A.B.C + A.B.C


             This expression can be transferred in a k-map as follow:
X
        BC
    A
               00     01    11     10
    0          1      1      0      0
    1          0      0      0      0


             The simplified Boolean expression of the output can therefore be determined.
    X = A.B
    Exercise4.3:
             Simplify the following Boolean expressions using k-maps:

    X = A.B.C + A.B.C + A.BC + A.B.C
    Y = A.B.C + A.BC + ABC + ABC
    Z = A.B.C + A.B.C + ABC + A.BC + ABC + ABC
    Example 4.2:
             Let us simplify the following Boolean expression using k-map.
    X = A.B.C + A.B.C + A.BC + A.B.C + A.B.C + ABC
    The first step consists of filling the k-map.
X
        BC
    A          00     01    11     10
    0          1      1      1      1
    1          1      0      0      1


             After grouping the ones, we can now deduce the simplified expression of the
    output:
    X = A+C

    Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                        64
4.2.2.3 K-map for four input Boolean variables:
      Let us consider the following Boolean expression:
X = A.BCD + A.BCD + ABCD + ABCD + ABC.D + ABC D + ABC D
      This expression can be transferred in the k-map as follows:
  X
            CD
      AB         00      01     11     10
      00           0      0      1      0
      01           0      0      1      0
      11           1      1      1      1
      10           0      0      1      0


      The simplified Boolean expression of the output can therefore be deduced:
X = AB + CD
Example 4.3:
      Consider the k-map bellow and give the simplified Boolean expression the
output X:

  X
            CD
      AB         00      01     11     10
      00           1      1      1      1
      01           1      0      0      1
      11           1      0      0      1
      10           1      1      1      1

      The simplified Boolean expression of the output is therefore determined:
X = B+D
Exercise 4.4:
      Simplify the following Boolean expression using k-map:

X = A.B.C.D + A..B.C.D + AB.C.D + A.B.C.D
Y = A.B.C.D + A.B.C.D + A.B.CD + A.B.C.D + A.B..C.D + A.B.C.D + AB.CD + A.B.C.D




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                      65
Remark 4.2: Condition of indifference
       Some logic circuits are conceived in such a way that for certain combination of
input variables, the output is neither high nor low. In fact, those input combinations
should never occur. In the k-maps, the cells representing those combinations are
filled with a X. Let us consider for instance the following truth table:


  X
            BC
                   00     01      11     10
       A                                              We deduce that
        0           0      0      1      X            X=B
        1           0      X      1       1




4.3 Conclusion:
       This chapter has permitted us to study Karnaugh mapping which is used for an
easier simplification of Boolean expression. It is one of the most important tools that
should be deeply understood in order to succeed in the study of combinatory logic
circuit. The next chapter will be focused on the study of digital arithmetic. That is, on
how digital systems perform arithmetical operations such as addition, subtraction,
multiplication and division.




                           REVIEW QUESTIONS

   1. Simplify the following Boolean expressions using k-maps:
X = A.B.C + A.BC + ABC + AB.C + A.B.C
    ( )( )
Y = B+C B+C + A+ B+C
Z = (C + D ) + AC D + AB.C + A..BCD + A.C.D

S = ABCD + A..B.C.D + A.B.C D + A.B.C.D + A.BCD + ABC.D + ABC D + ABC D + ABCD
T = ABC + ABC + ABC + ABC




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                          66
2. For each of the following k-maps, determine the Boolean expression of the
       output X.


  X                                                X
           CD                                               CD
      AB           00    01     11     10              AB        00   01    11         10
      00            1     1      0      1              00        1    1      1         1
      01            0     1      1      0              01        1    1      0         1
      11            0     1      1      0              11        1    1      0         1
      10            0     0      0      1              10        1    1      0         1




  X                                                X
           CD                                               CD
      AB           00    01     11     10              AB        00   01    11         10
      00            0     0      1      0              00        1    1      1         1
      01            0     0      0      0              01        0    1      1         0
      11            1     1      1      1              11        0    0      0         0
      10            0     1      1      0              10        1    0      0         1




  X                                                X
           BC                                               BC
                   00    01     11     10                        00   01    11         10
       A                                                A

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




  X                                                X
           BC                                               BC
                   00    01     11     10                        00   01    11         10
       A                                                A

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



Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                      67
References:
   7. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition,
       Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985.
   8. Lessons In Electric Circuits Volume IV – Digital, Tony R. Kuphaldt, Fourth
       Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits.
   9. Cours de systèmes logiques, Notes de cours, Première année du génie
       électrique, ENSET de Douala, J.C Tsokezo, 2004-2005.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                         68
Courses In
                    Electrical
                   Engineering

                                      Volume II

                           DIGITAL ELECTRONICS

                 CHAPTER FIVE: DIGITAL ARITHMETIC



                                          By

                                    J-P. NGOUNE

                 DIPET I (Electrotechnics), DIPET II (Electrotechnics)
                              DEA (Electrical Engineering)
            Teacher in the Electrical Department, GTHS KUMBO, Cameroon.




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.              69
Chapter Five
         DIGITAL ARITHMETIC
5.0 Specific objectives:
       At the end of this chapter, the student will be able to perform arithmetical
operations such as addition, subtraction, and multiplication using binary numbers


5.1 Introduction:
       Many arithmetical operations are carried out in digital systems like computers
and calculators. The most common of these operations are addition, subtraction and
multiplication. The aim of this chapter is to understand the principle used by digital
systems to perform those operations.


5.2 Binary addition:
       The addition of two binary numbers is similar to that of two decimal numbers.
Let us consider the following case:
 354
+663
10 1 7
       This operation is performed using the following steps:
   •   We begin by adding the two less significant digits of the two decimal numbers:
       3 + 4 =7. There is no carry out.
   •   Then we proceed by adding the two digits situated directly at the left:
       5 + 6 = 11. We write 1 and the carry out is 1.
   •   We add the two next digits: 3 + 6 = 9; the carry out is added: 9 + 1 = 10. So
       the result of the addition is 1017.
       For binary number, the principle is the same. However, only four cases can be
met while adding binary numbers:
0+0=0
1+0=1


Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                        70
1 + 1 = 0 + a carry out of 1
1 + 1 + 1 = 1 + a carry out of 1.


Example 5.1:
Let us add the following binary numbers: A = 1001 (910), B = 1111 (1510).
 1001
+1111
11000


   •    We begin by adding the two LSB (Least Significant Bit): 1 + 1 = 0 + carry out
        of 1.
   •    Then we add that carry to the two bits situated directly at the left:
        0 + 1 + 1(Carry) = 0 + carry out of 1.
   •    The same operation is performed for the next rank.
   •    Then          for       the         most       significant   bits,   we   have:
        1 +1 + 1(Carry from the previous rank) = 11.
   •    Finally, the result of the operation gives us 11000 (2410).


Exercise 5.1:
For each of the following cases, add the binary numbers A and B.
   a) A = 11101; B = 1001.
   b) A = 101111; B = 11111.
   c) A = 11101; B = 11111.
5.3 Signed numbers:
        In order to differentiate positive numbers to negative numbers, a specific bit
can be added in front of the binary number. That bit is called bit of sign. The bit of
sign is 0 for positive numbers and 1 for negative numbers.
Example 5.2:


+9 = 01001
-24 = 111000




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                        71
For negative binary numbers, there are two other types of notation:
    •   The one’s complement notation;
    •   The two’s complement notation.
5.3.1 The one’s complement notation:
        The one’s complement notation of a binary number is simply obtained by
complementing each bit of the number. Let us write for example the one’s
complement of the following binary number: 10010110
10010110      Exact notation
01101001      One’s complement notation


Remark 5.1:
        For negative binary numbers, we should not forget the bit of sign:
11101       Exact notation
10010       One’s complement notation.


Notice that the bit of sign is not complemented.
Exercise 5.2:
Give the one’s complement of the following binary numbers.
    a) 101101; b) 1101101 (signed number); c) 011101011 (signed number).


5.3.2 The two’s complement notation
        The two’s complement notation of a binary number is obtained by adding 1 to
the one’s complement notation of that number.
110110      Exact notation
001001      One’s complement notation
+       1
001010      Two’s complement notation


For signed number, remember that the bit of sign remain unchanged.
Exercise 5.3:
Give the two’s complement of the following binary numbers.
    b) 101101; b) 1101101 (signed number); c) 011101011 (signed number).




Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                    72
We can recapitulate all what we have studied concerning one’s and two’s
complementation in the following table:
Decimal            Exact notation          One’s complement        Two’s complement
    +24               011000                    011000                  011000
    -24               111000                    100111                  101000


Notice that for positive numbers, exact notation does not differ from one’s
complement and two’s complement notation.
5.3.3 Conversion from one’s complement and two’s complement notation to
          exact notation:
          To convert from the one’s complement notation to the exact notation, each bit
of the one’s complement notation should just be complemented back.
111000        Exact notation.
100111        One’s complement notation.
111000        Exact notation.


Notice that the bit of sign does not change.
          To convert from two’s complement notation to the exact notation, the two’s
complemented number should just be two’s complemented back.
1001       Exact notation
0110
+    1
0111       Two’s complement notation
1000
+    1
1001       Exact notation


5.4 Addition of two signed numbers:
          Depending on the sign of the two numbers to be added, many cases can be
studied.
Case 1: Two positive numbers:
          Let us add +4 to +9.
+9 = 01001
+4 = 00100
Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune.                        73
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total
Digital elect total

Weitere ähnliche Inhalte

Andere mochten auch

Intro_Programmation_Informatique
Intro_Programmation_InformatiqueIntro_Programmation_Informatique
Intro_Programmation_Informatique
Emeric Tapachès
 
Algorithmic Forex Trading
Algorithmic Forex TradingAlgorithmic Forex Trading
Algorithmic Forex Trading
InvestingTips
 
JASPARD, M. LOGIC un service GeoWeb d’aide à la décision et à la coopération...
JASPARD, M. LOGIC  un service GeoWeb d’aide à la décision et à la coopération...JASPARD, M. LOGIC  un service GeoWeb d’aide à la décision et à la coopération...
JASPARD, M. LOGIC un service GeoWeb d’aide à la décision et à la coopération...
IT-Gatineau2011
 
Chapitre 1 (algorithme)
Chapitre 1 (algorithme)Chapitre 1 (algorithme)
Chapitre 1 (algorithme)
mahbouba
 
combinational_circuits
combinational_circuitscombinational_circuits
combinational_circuits
Bindu Madhavi
 
COMBINATIONAL CIRCUITS & FLIP FLOPS
COMBINATIONAL CIRCUITS & FLIP FLOPSCOMBINATIONAL CIRCUITS & FLIP FLOPS
COMBINATIONAL CIRCUITS & FLIP FLOPS
Starlee Lathong
 
COMPUTER ORGANIZATION -Multiplexer,Demultiplexer, Encoder
COMPUTER ORGANIZATION -Multiplexer,Demultiplexer, EncoderCOMPUTER ORGANIZATION -Multiplexer,Demultiplexer, Encoder
COMPUTER ORGANIZATION -Multiplexer,Demultiplexer, Encoder
Vanitha Chandru
 

Andere mochten auch (20)

Intro_Programmation_Informatique
Intro_Programmation_InformatiqueIntro_Programmation_Informatique
Intro_Programmation_Informatique
 
Algorithmic Forex Trading
Algorithmic Forex TradingAlgorithmic Forex Trading
Algorithmic Forex Trading
 
JASPARD, M. LOGIC un service GeoWeb d’aide à la décision et à la coopération...
JASPARD, M. LOGIC  un service GeoWeb d’aide à la décision et à la coopération...JASPARD, M. LOGIC  un service GeoWeb d’aide à la décision et à la coopération...
JASPARD, M. LOGIC un service GeoWeb d’aide à la décision et à la coopération...
 
Combinators - Lightning Talk
Combinators - Lightning TalkCombinators - Lightning Talk
Combinators - Lightning Talk
 
Bca i sem de lab
Bca i sem  de labBca i sem  de lab
Bca i sem de lab
 
Combinational logic
Combinational logicCombinational logic
Combinational logic
 
exercice_réseau
exercice_réseauexercice_réseau
exercice_réseau
 
Combinational circuit (7-Segment display)
Combinational circuit (7-Segment display)Combinational circuit (7-Segment display)
Combinational circuit (7-Segment display)
 
58210401202 งาน 1 ss
58210401202 งาน 1 ss58210401202 งาน 1 ss
58210401202 งาน 1 ss
 
Assurance Qualité logicielle
Assurance Qualité logicielleAssurance Qualité logicielle
Assurance Qualité logicielle
 
Structure de données en PHP
Structure de données en PHPStructure de données en PHP
Structure de données en PHP
 
Chapitre 1 (algorithme)
Chapitre 1 (algorithme)Chapitre 1 (algorithme)
Chapitre 1 (algorithme)
 
combinational_circuits
combinational_circuitscombinational_circuits
combinational_circuits
 
Canaux logiques et codage dans le gsm
Canaux logiques et codage dans le gsmCanaux logiques et codage dans le gsm
Canaux logiques et codage dans le gsm
 
COMBINATIONAL CIRCUITS & FLIP FLOPS
COMBINATIONAL CIRCUITS & FLIP FLOPSCOMBINATIONAL CIRCUITS & FLIP FLOPS
COMBINATIONAL CIRCUITS & FLIP FLOPS
 
Lecture3 combinational blocks
Lecture3 combinational blocksLecture3 combinational blocks
Lecture3 combinational blocks
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Exos de logique séquentielle
Exos de logique séquentielleExos de logique séquentielle
Exos de logique séquentielle
 
Combinational circuit
Combinational circuitCombinational circuit
Combinational circuit
 
COMPUTER ORGANIZATION -Multiplexer,Demultiplexer, Encoder
COMPUTER ORGANIZATION -Multiplexer,Demultiplexer, EncoderCOMPUTER ORGANIZATION -Multiplexer,Demultiplexer, Encoder
COMPUTER ORGANIZATION -Multiplexer,Demultiplexer, Encoder
 

Ähnlich wie Digital elect total

Physics investigatory project for class 12 logic gates
Physics investigatory project for class 12 logic gatesPhysics investigatory project for class 12 logic gates
Physics investigatory project for class 12 logic gates
biswanath dehuri
 
Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system
CT Sabariah Salihin
 

Ähnlich wie Digital elect total (20)

Digi ana total 2012
Digi ana total 2012Digi ana total 2012
Digi ana total 2012
 
Chapter 1 number and code system sss
Chapter 1 number and code system sssChapter 1 number and code system sss
Chapter 1 number and code system sss
 
[01] Exit Exam Preparation 2023 DLD.pptx
[01] Exit Exam Preparation 2023 DLD.pptx[01] Exit Exam Preparation 2023 DLD.pptx
[01] Exit Exam Preparation 2023 DLD.pptx
 
Physics investigatory project for class 12 logic gates
Physics investigatory project for class 12 logic gatesPhysics investigatory project for class 12 logic gates
Physics investigatory project for class 12 logic gates
 
Digital Electronics Notes
Digital Electronics Notes Digital Electronics Notes
Digital Electronics Notes
 
Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)
 
Number system
Number systemNumber system
Number system
 
3110016_BE_GTU_Study_Material_e-Notes_6_02052020063009AM.pdf
3110016_BE_GTU_Study_Material_e-Notes_6_02052020063009AM.pdf3110016_BE_GTU_Study_Material_e-Notes_6_02052020063009AM.pdf
3110016_BE_GTU_Study_Material_e-Notes_6_02052020063009AM.pdf
 
digital logic design number system
digital logic design number systemdigital logic design number system
digital logic design number system
 
Stld
StldStld
Stld
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
1 Unit-1 DEC B.Tech ECE III Sem Syllabus & Intro.pptx
1 Unit-1 DEC B.Tech ECE III Sem Syllabus & Intro.pptx1 Unit-1 DEC B.Tech ECE III Sem Syllabus & Intro.pptx
1 Unit-1 DEC B.Tech ECE III Sem Syllabus & Intro.pptx
 
Lecture 1& 2.pptx
Lecture 1& 2.pptxLecture 1& 2.pptx
Lecture 1& 2.pptx
 
Digital Electronics Notes
Digital Electronics NotesDigital Electronics Notes
Digital Electronics Notes
 
Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system
 
DLD-Introduction.pptx
DLD-Introduction.pptxDLD-Introduction.pptx
DLD-Introduction.pptx
 
basic electronics MODULE_1_Ch4_AH_01082014.pptx
basic electronics MODULE_1_Ch4_AH_01082014.pptxbasic electronics MODULE_1_Ch4_AH_01082014.pptx
basic electronics MODULE_1_Ch4_AH_01082014.pptx
 
DSD NOTES.pptx
DSD NOTES.pptxDSD NOTES.pptx
DSD NOTES.pptx
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx
 
Dpsd lecture-notes
Dpsd lecture-notesDpsd lecture-notes
Dpsd lecture-notes
 

Kürzlich hochgeladen

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Kürzlich hochgeladen (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 

Digital elect total

  • 1. Courses In Electrical Engineering Volume II LESSONS IN DIGITAL ELECTRONICS By Jean-Paul NGOUNE DIPET I (Electrotechnics), DIPET II (Electrotechnics) DEA (Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 1
  • 2. FOREWORD The need of pedagogical resources in the domain of the teaching of Engineering Sciences is a great challenge in Cameroon. Many efforts have been made through the contribution of teachers, and also through the policy of promotion of technical education led by the government. However, much work is still to be done in order to build a real culture of Engineering in our country. This document is a contribution for the achievement of that goal. The course in digital electronics presented in this document is made up of nine chapters prepared following the official program in digital circuits of class six F3 and F2 series in Cameroon. However some extra material is added in order to open the mind of students to the world of digital electronics and computer science. This course is being taught by me (Mr. NGOUNE Jean-Paul) in the Government Technical High School, KUMBO, Republic of Cameroon. Some amelioration may be brought to it along the years, according to the suggestions of readers and users of this course. ‘Courses In Electrical Engineering’ is a series of courses in various subjects of electronics and electrotechnics. This is the volume II of the series; the volume I treating the matter of the Analysis of electrical circuits (Class five F3 and F2 syllabus) is to be published very soon. This course and many other pedagogical documents produced by me are available and freely downloadable at the following address: www.scibd.com/jngoune. Jean-Paul NGOUNE (12 Sep. 11, 03:45). Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 2
  • 3. CONTENTS Topic Page Chapter One: Numeration systems and codes 4 Chapter Two: Logic gates 25 Chapter Three: Boolean algebra 44 Chapter Four: Karnaugh mapping 58 Chapter Five: Digital arithmetic 69 Chapter Six: Combinatory logic 82 Chapter Seven: Multivibrators 111 Chapter Eight: Counters 133 Chapter Nine: Digital storage 148 About the Author 158 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 3
  • 4. Courses In Electrical Engineering Volume II DIGITAL ELECTRONICS CHAPTER ONE: NUMERATION SYSTEMS AND CODES By J-P. NGOUNE DIPET I ( Electrotechnics), DIPET II (Electrotechnics) DEA ( Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 4
  • 5. Chapter One NUMERATION SYSTEMS AND CODES 1.0 Specific objectives: At the end of this chapter, the student will be able to: - know binary, hexadecimal and octal numeration systems; - Know Gray, BCD and ASCII codes; - Master the principle of conversion from each numeration system to another. 1.1 Introduction: Numbers are used to express quantities. There are many numerations systems used in the field of digital electronics, one of the most important being the binary system of numeration on which is based the computer science. Each of the various numerations systems and codes has its advantages but also inconvenient. The aim of this chapter is to present and explain the most common numeration systems and codes used in the conception of digital circuits. 1.2 Digital versus Analogue representation: There are two basic ways we can represent quantities: Analogue representation and digital representation. With analogue representation, the quantity is symbolised in a way that is infinitely divisible. With digital representation, the quantity is symbolised in a way that is discretely packaged. Example 1.1: • The height of the red column which indicates the temperature measured by a thermometer is an analogue representation. • An electronic watch whose digits changes second after second, minute after minute, shows a digital representation. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 5
  • 6. The comparison between digital and analogue representations can be given as in the following chart: Analogue representation Digital representation Infinitely divisible Discrete (Step by step) Prone to errors of precision Absolute precision 1.3 Systems of numeration: To represent quantities in the different systems of numeration, specific symbols are used, which are also called ciphers. 1.3.1 Decimal numeration system: Decimal system is the most common numeration system for daily uses. It is constituted by 10 symbols or ciphers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Each cipher represents an integer quantity and each place from right to left in a decimal notation represents a weight for each integer quantity. Example 1.2: Let’s consider the decimal notation 1253. This number can be broken into its constituent weight-products as such: 1253 = 1000 + 200 + 50 + 3 1253 = 1 × 1000 + 2 × 100 + 5 × 10 + 3 × 1 1253 = 1 × 103 + 2 × 10 2 + 5 × 101 + 3 × 100 We can easily notice that the cipher 1 is more weighted than the cipher 2 which in his turn is more weighted than the cipher 5. The cipher 3 is the less weighted. In the decimal numeration system, each cipher is called a digit. Each weight or place value is ten that of the one to the immediate right. The less weighted cipher carries the One place, the cipher at the immediate left carries the Tens place, the follower carries the Hundreds place, thousands place, and so on… Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 6
  • 7. 1.3.2 Binary numeration system: The binary numeration system uses only two ciphers instead of ten as the decimal numeration system. Those two ciphers are “0” and “1”. In binary system of numeration, ciphers are called bit (Binary Digit). Cipher are arranged right to left in doubling values of weight ( instead of multiplying the weight by 10 as in the case of decimal system). Example 1.3: Let’s consider the following binary number Weights 543210 A = 1 0 1 1 0 12 Base 2 A = 1 × 25 + 0 × 2 4 + 1 × 23 + 1 × 2 2 + 0 × 21 + 1 × 20 A = 32 + 0 + 8 + 4 + 1 A = 4510 Each weight is 2 that of the one in the immediate right. The less weighted cipher carries the Ones place (20), the cipher at the immediate left carries the twos place (21), the following cipher carries the fourth place (22)… Exercise 1.1: Convert the following binary numbers to decimal numbers: A = 110101 C = 11110111101 B = 100110101 D = 101100001111 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 7
  • 8. 1.3.3 Binary versus decimal numeration system: Let us count from 0 to 15 using binary and decimal systems of numeration Binary D(MSB) C B A(LSB) Decimal 0 0 0 0 0 0 0 0 1 1 0 0 1 0 2 0 0 1 1 3 0 1 0 0 4 0 1 0 1 5 0 1 1 0 6 0 1 1 1 7 1 0 0 0 8 1 0 0 1 9 1 0 1 0 10 1 0 1 1 11 1 1 0 0 12 1 1 0 1 13 1 1 1 0 14 1 1 1 1 15 It is obvious that the representation of a quantity in binary numeration system takes mores ciphers than in decimal system. We can therefore ask ourselves why the binary system is preferred to decimal system in computer sciences. The reason is that in electronics, it is easier to materialise two quantities-“0” and “1”-(by two different voltages for example) than to materialises 10 different quantities – “0” ,”1” ,”2”,”3”,”4”,”5”,”6”,”7”,”8”, and”9”- (by 10 different voltages). In fact, in digital circuits, 0 and 1 are materialised by specific ranges of voltages or current; this will be discussed later. Remark 1.1: With n bits we can represent 2 n different binary numbers. The higher H number is given using the following formula. H = 2n − 1 (1) Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 8
  • 9. Example 1.4: With 4 bits we can represent 24 = 16 different binary numbers (from 0 to 15), and the higher number is H = 24 – 1 = 15. Remark 1.2: Conversion from binary to decimal To convert a number written in binary numeration system to its equivalent in decimal, we just have to calculate the products of the bits with their respective weights, as in example 1.3 above. For binary numbers with “binary point” (equivalent of decimal point for decimal numbers), the conversion is done as follow. 2 1 0 -1 -2 -3 A = 1 0 1. 1 0 1 A = 1 × 2 2 + 0 × 21 + 1 × 20 + 1 × 2 −1 + 0 × 2 −2 + 1 × 2 −3 1 0 1 A = 4 + 0 +1+ 1 + 2+ 3 2 2 2 A = 5.62510 Exercise 1.2: Convert from binary to decimal: A = 10110.01 C = 11110111.1011 B = 111.111 D = 10110101101.111101 1.3.4 Octal numeration system: The octal numeration system is a place weighted system with a base of eight. Valid ciphers include the symbols “0”,”1”,”2”,”3”,”4”,”5”,”6”, andf”7”. To convert from binary to octal numeration system, we just have to divide the number into groups of binary numbers having 3 bits each. And each group of 3 bits is replaced by its equivalent in octal. Example 1.5: Let’s convert the following binary numbers in octal: A = 10110101 B = 11010111.01 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 9
  • 10. A = 010 110 101 101101012 = 2658 2 6 58 The bits are grouped from the right to the left. A zero has been added to the two firs bits to form a group of 3 bits. That zero is called an implied zero. B = 011 010 111 . 010 11010111.012 = 327.28 3 2 7 . 28 Two implied zeros have been added to the number to form groups of 3 bits. 1.3.5 Hexadecimal numeration system: The hexadecimal numeration system is a place weighted system with a base of sixteen. Valid ciphers include the normal decimal symbols “0”,”1”,”2”,”3”,”4”,”5”,”6”,”7”;”8”;9” plus six alphabetical characters A, B, C, D, E, and F. The following table summarises the equivalence between decimal, binary, octal and hexadecimal systems. Decimal Binary Octal Hexadecimal 0 0000 0 0 1 0001 1 1 2 0010 2 2 3 0011 3 3 4 0100 4 4 5 0101 5 5 6 0110 6 6 7 0111 7 7 8 1000 10 8 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F To convert from binary to hexadecimal numeration, we group bits in fours. Each group of four bit is replaced by its hexadecimal equivalent. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 10
  • 11. Example 1.6: Convert the following binary numbers in hexadecimal. A = 1101011101 B = 11101011101.11 As explained above, we just have to group the binary number in groups of four bits each: A =0011 0101 1101 11010111012 = 35D16 3 5 D16 The binary number has been grouped is groups of four bits each, from the right to the left two implied zeros have been added at the extreme left. In the same way the number B can also be converted. B =0111 0101 1101 . 1100 11101011101.112 = 75DC16 7 5 D C16 1.4 Changing of base: We have already seen in the previous section how to change from binary to decimal, octal or hexadecimal systems of numeration. The present section is intended to show how to move from a given system of numeration to any other system. 1.4.1 From octal and hexadecimal to binary and decimal: The octal and hexadecimal systems are actually used by computer engineer just to obtain a “shorthand” representation of binary numbers (because octal and hexadecimal representations take a few numbers of ciphers or symbols as compared to binary system). It should therefore be understood that only binary system is implemented in the electronic circuits of digital systems (through two levels of voltages or currents: high (1) and low (0)), the others systems being used by engineers just for simplification issues. However, we sometimes have the need to convert either of those systems to binary or decimal forms. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 11
  • 12. 1.4.1.1 Octal and hexadecimal to binary: It is obvious that, to convert from octal to binary, we just have to convert each octal cipher to its binary equivalent in 3 bits. In the same way, to convert from hexadecimal to binary, we should convert each hexadecimal symbol into its binary equivalent in 4 bits. Example 1.7: a) Convert the following octal number to digital 5238. b) Convert the following hexadecimal number to binary 4DC216. 5238 = 101 010 0112 5238 = 1010100112 5 2 3 4DC216 = 0100 1101 1100 00102 4DC216 = 1001101110000102 4 D C 2 1.4.1.2 Octal to decimal: Because octal is a base of eight numeration system, each place weight value differs from either adjacent place by factor of eight. Example 1.8: Let us convert the following octal number to decimal: A = 264.748 2 1 0 -1 -2 A = 2 6 4. 7 48 A = 2 × 82 + 6 × 81 + 4 × 80 + 7 × 8−1 + 4 × 8−2 1 1 A = 2 × 64 + 6 × 8 + 4 × 1 + 7 × + 4 × 8 64 A = 180.937510 Exercise 1.3: Convert the following octal number to decimal: A = 4562.368 C = 264.3658 B = 523411.2328 D = 4516328 Is the number 12586 an octal number? Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 12
  • 13. 1.4.1.3 Hexadecimal to decimal: The technique for converting hexadecimal notation to decimal is the same as the one used above, except that each successive place weight changes by a factor of sixteen. Example 1.9: Let us convert the following hexadecimal number to decimal: A = 34DF.AC216 3 2 1 0 -1-2-3 A = 3 4 D F.A C 216 A = 3 × 163 + 4 × 16 2 + 13 × 161 + 15 × 160 + 10 × 16 −1 + 12 × 16−2 + 2 × 16 −3 A = 12288 + 1024 + 208 + 15 + 0.625 + 0.046875 + 0.000488281 A = 13535.6723610 Exercise 1.4: Convert from hexadecimal to decimal. X = A23C.DF16 Y = 7D3E16 Z = D96EC.FA16 1.4.2 Conversion from decimal numeration system to others systems: The conversion from decimal numeration system to others systems of numeration is an important task for everyone dealing with computer science, because it permits to move from daily world to digital world. 1.4.2.1 General method: To convert a number from decimal numeration system to binary, octal or hexadecimal, we use repeated cycles of divisions to break the decimal numeration down into multiples of binary, octal or hexadecimal place weight values. In the first cycle of division, we take the original decimal number and divide it by the base of the numeration system that we are converting to: It meant that for binary, we should divide by 2, for octal we should divide by 8, for hexadecimal we should divide by 16. Then we take the whole number portion of the division result and divide it by the result again, and so on, until we end up with a quotient of less than the base value. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 13
  • 14. 1.4.2.1 Decimal to binary conversion: Let us convert the decimal number 8710 to binary, using the principle described above. It meant that the decimal number should be repeatedly divided by 2. 87 2 43 2 1 21 2 1 10 2 1 5 2 0 2 2 1 1 0 The coloured ciphers are the reminders of repeated division of the decimal number by 2. To obtain the binary number, we just have to take those reminders, beginning with the last one, as indicated by the arrow. Then we have: 8710 = 10101112 In short, the binary bits are assembled from the reminders of the successive division steps, beginning with the LSB (Least Significant Bit) and proceeding to the MSB (Most significant Bit). Exercise 1.5: Convert the following decimal numbers to binary A = 15310 C = 4610 B = 25510 D = 3810 1.4.2.2 Conversion of decimal numbers less than 1 to binary: For converting a decimal number less than 1 to binary, we use repeated multiplication by 2, taking the integer portion of the product in each step as the next digit of our converted number. Let us convert the decimal number 0.37510 to binary: 0.375x2 = 0.75 Integer portion of the product = 0 0.75x2 = 1.5 Integer portion of the product = 1 0.5x2 = 1 Integer portion of the product = 1 (we stop when the product is a pure integer) Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 14
  • 15. Each step gives us the next bit further away from the binary point, so the binary number is obtained taking the bits from up to down. 0.37510 = 0.0112 Remark 1.3: With integer division, worked from the LSB to the MSB (down to up), but with repeated multiplication, we worked from up to down. Exercise 1.6: Convert from decimal to binary: A = 0.812510 C = 0.87510 B = 0.62510 D = 0.4062510 Remark 1.4: To convert a decimal number greater than 1 with a less than 1 component, we should use both techniques, one at time. Let us convert the decimal number 23.12510 to binary. Step one: repeated division for the integer portion 2310. 23 2 11 2 1 5 2 1 2 2 1 1 0 Partial answer: 2310 = 101112 Step two: repeated multiplication for the less than 1 portion 0.12510. 0.125x2 = 0.25 Integer portion of the product = 0 0.25x2 = 0.5 Integer portion of the product = 0 0.5x2 = 1 Integer portion of the product = 1 Partial answer: 0.12510 = 0.0012 Complete answer: 101112 + 0.0012 = 10111.0012 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 15
  • 16. Exercise 1.7: Convert from decimal to binary A = 17.37510 C = 27.87510 B = 43.62510 D = 49.4062510 1.4.2.3 Decimal to octal conversion: Let us convert the number 12310 from decimal to octal numeration system. As explained before, we just have to divide the decimal number successively by 8. 123 8 15 8 3 1 7 12310 = 1738 The octal digits are determined by the reminders left over by each division step. These reminders are between 0 and 7. Exercise 1.7: Convert the following numbers from decimal to octal: A = 32310 C = 12810 B = 45210 D = 9910 1.4.2.4 Decimal to hexadecimal conversion: Let us convert the number 45616 from decimal to hexadecimal. This conversion is obtained by repeated division of the decimal number by 16. 456 16 28 16 8 1 12 (C16) 45616 = 1C816 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 16
  • 17. Exercise 1.8: Convert from decimal to hexadecimal: A = 452310 C = 99710 B = 86710 D = 123810 1.5 Codes: A code is a system of letters, numbers or symbols that represent information. We have seen in previous sections that every decimal number can be converted in binary; by so doing, we can say that we are achieving a pure binary codification. There are many codes used in computer science to facilitate the operation of certain digital circuits. Some of those codes are: BCD code, Gray code, and alphanumerical codes. 1.5.1 Binary coded decimal (BCB) code: The BCD code of a decimal number is obtained by replacing each digit of the number by its equivalent in four bits, within the interval 0000 to 1001. Because of the fact that the maximal digit of the decimal numeration system is 9, the allowable codes goes from 0 (0000) to 9 (1001). So, the BCD code does not use the codes 1010, 1011, 1100, 1101, and 1111. Let us convert the number A = 45610 to BCD. A= 4 5 6 Decimal 0100 0101 0110 BCD A = 010001010110BCD Example 1.10: Convert the following BCD number in decimal: X = 0110100000111001. Can the following series of bits be the BCD code of a decimal number? Y = 011111000001. X = 0110 1000 0011 1001 6 8 3 9 X = 683910 Y =0111 1100 0001 7 ? 1 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 17
  • 18. The second group of bit (1100) is not allowable in the BCD code, so the number Y cannot be the BCD code of a decimal number. Exercise 1.9: Determine the equivalent BCD code of the following decimal numbers: A = 153610 C = 5698910 B = 8975610 D = 23569810 Determine if possible the decimal numbers corresponding to the following BCD numbers: A = 100101110110 B = 110111100111 Remark 1.5: Difference between BCD code and binary number It is important to realise that the BCD code is not a numeration system as binary, octal or hexadecimal numerations systems. In fact, it is just a decimal system whose digits have been replaced by their binary equivalent in four bits. On the other hand it should be noticed that a BCD number is not a binary number. When we are to convert a decimal number to binary, the whole number is taken into consideration meanwhile to convert from decimal to BCD, each individual digit is replaced by its binary equivalent in four bits. For example, let us convert 1910 to binary and to BCD: 3510 = 1000112 3510 = 0011 0101 (BCD). It is obvious that the conversion from binary to BCD takes more bits than the conversion from decimal to binary. So the BCD code is not as efficient as the binary system. The advantage of the BCD code is just the fact that it is very easy to convert from decimal to BCD and vice versa. The BCD code is found in digital systems using 7 segments displays like digital voltmeters, digital watch… 1.5.2 Gray code: The Gray code is a non weighted code in which each coded representation differs from the previous representation only by one bit. It is not the case for binary system where many bits can change when we move from a number to the following Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 18
  • 19. number. For example, when we move from 0111 (710) to 1000 (810), all the four bits of the representation are changed. The Gray code is not suitable for arithmetical calculations (because it is not weighted); it is used in the determination of outputs equations of digital circuits (Karnaugh mapping) and in the design of Analog – Digital Converters. The following table gives us the equivalence between binary representation and Gray code. Decimal Binary Gray 0 0000 0000 1 0001 0001 2 0010 0011 3 0011 0010 4 0100 0110 5 0101 0111 6 0110 0101 7 0111 0100 8 1000 1100 9 1001 1101 10 1010 1111 11 1011 1110 12 1100 1010 13 1101 1011 14 1110 1001 15 1111 1000 Remark 1.6: How to generate a Gray sequence If you observe attentively the Gray sequence above, you will notice that: • For the first column of ciphers (coming from the right to the left), the first zero is followed by two ones, which are followed by two zeros, two ones, two zeros… • For the next column of ciphers you can notice that the two first zeros are followed by four ones, which are followed by four zeros, four ones… Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 19
  • 20. For the third column of ciphers, the four first zeros are followed by eight ones, which are followed by eight zeros, eight ones… This is the principle to be used in order to generate a Gray sequence. 1.5.3 Alphanumerical codes A computer would have been useless if it wasn’t able to treat non numerical information. In fact, a computer should be able to recognize codes corresponding to numbers, letters or some special characters. Such codes are called alphanumerical codes. Generally the keyboard of a computer should contain the following symbols: • The 26 letters of the alphabet (capital and small letters); • The 10 ciphers of the decimal numeration system, • Almost 25 special characters like +, /,>, <, @, %... There are almost 87 characters and to represent those characters, we need at least 7 bits because with 7 bit, we can have up to 27 = 128 different binary numbers. So, we use 87 of those binary numbers to codify the 87 characters. The most known alphanumerical code is called American Standard code for Information Interchange (ASCII). This code is used by almost all the computer constructors. The following table gives the ASCII code corresponding to some of the characters. Character ASCII code Octal Hexadecimal A 100 0001 101 41 B 100 0010 102 42 C 100 0011 103 43 D 100 0100 104 44 E 100 0101 105 45 F 100 0110 106 46 G 100 0111 107 47 H 100 1000 110 48 I 100 1001 J 100 1010 K 100 1011 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 20
  • 21. L 100 1100 M 100 1101 N 100 1110 O 100 1111 P 101 0000 Q 101 0001 R 101 0010 S 101 0011 T 101 0100 U 101 0101 V 101 0110 W 101 0111 X 101 1000 Y 101 1001 Z 101 1010 0 011 0000 1 011 0001 2 011 0010 3 011 0011 4 011 0100 5 011 0101 6 011 0110 7 011 0111 8 011 1000 9 011 1001 Blank 010 0000 . 010 1110 ( 010 1000 + 010 1011 $ 010 0100 * 010 1010 ) 010 1001 - 010 1101 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 21
  • 22. / 010 1111 , 010 1100 = 011 1101 Exercise 1.10: • Give the octal and hexadecimal equivalent for all the ASCII codes given above. • The following instruction coded in ASCII is composed on the keyboard of a computer. Give its signification: 101 0011, 101 0100, 100 1111, 101 0000. Answer: Using the table above we find that the instruction is STOP. 1.6 Conclusion This chapter has permitted us to study and to master (I hope so) the most common numeration systems and codes. We have also studied methods of conversion from each numeration system to another. In the next chapter, we will study the behaviour of logic gates, which can be considered as elementary ‘bricks’ used in the construction of any digital circuit. REVIEW QUESTIONS 1. Give the difference between analogue and digital representations. 2. Convert from binary to decimal: A = 110112 D = 10010.0112 B = 10111012 E = 101001111112 C = 10111112 F = 1110111.00012 3. Convert from binary to octal: A = 111011.011012 D = 111011111012 B = 101101112 E = 10011101.1102 C = 11011110.01012 F = 100111101011112 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 22
  • 23. 4. Convert from binary to hexadecimal. A = 1111010.11102 C = 111010111.112 B = 101111101111012 D = 10110110.1111012 5 Convert from octal to binary: A = 1238 C = 3578 B = 6538 D = 5478 6 Convert from hexadecimal to binary. X = F47B16 Z = 8CE016 Y = 5FD316 P = FFFC16 7 Convert from octal to decimal : A = 1258 C = 5638 B = 2568 D = 4538 8. Convert from hexadecimal to decimal: X = F47B16 Z = 8CE016 Y = 5FD.316 P = FFF.C16 9. Convert from decimal to binary: A = 2310 C = 5310 B = 25.37510 D = 101.2510 10. Convert from decimal to octal: A = 42310 C = 43810 B = 126410 D = 342310 11. Convert from decimal to hexadecimal: A = 126210 C = 256310 B = 356210 D = 56423610 12. Convert from octal to hexadecimal: A = 123.628 B = 432.58 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 23
  • 24. 13 Determine the highest decimal number that can be represented using 8bits, 16 bits. 14 In most of the computers, the addresses of memory locations are expressed in hexadecimal. Those addresses are sequential numbers that identify each memory location. a) A computer can store data of 8 bits (1byte) in each of his memory location. If the addresses of the memory locations run from 000016 to FFFF16, then give the number of memory locations of that computer. Deduce the capacity of its memory. b) Another computer has 4096 memory locations. Give the interval of their addresses starting from 000016. 15 Determine the number of bits to be used to represent the decimal numbers from 00010 to 99910: a) using pure binary code b) using BCD code. 16 Express in ASCII the following instruction: “X = 25/Y” 17 Convert from BCD to binary: A = 01110100 (BCD). References: 1. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition, Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985. 2. Lessons In Electric Circuits Volume IV – Digital, Tony R. Kuphaldt, Fourth Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 24
  • 25. Courses In Electrical Engineering Volume II DIGITAL ELECTRONICS CHAPTER TWO : LOGIC GATES By J-P. NGOUNE DIPET I (Electrotechnics), DIPET II (Electrotechnics) DEA (Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 25
  • 26. Chapter Two LOGIC GATES 2.0 Specific objectives: At the end of this chapter, the student will be able to: - Understand the functioning of the logic gates; - Draw the truth table of simple logic circuits; - Know logic voltage levels for TTL and CMOS technologies; - Design a simple logic circuit using logic gates. 2.1 Introduction: Logic gates are “elementary bricks” used in the construction of digital circuits. While the binary numeration system studied in the precedent chapter was an interesting mathematical abstraction, we have not yet seen its practical application to electronics. This chapter is devoted to practically apply the concept of binary digits to circuits. A logic gate is a special type of circuit designed to accept (inputs) and generate (outputs) voltages signals corresponding to binary digits (1 and 0). 2.2 Digital signals and gates: Let us consider the following circuit: Vcc 1 LED S R 0 Figure 2.1: Logic circuit. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 26
  • 27. When the switch is connected to the ground (0V), the light emitting diode (LED) does not shine. If we were using this circuit to represent binary digits, we would say that the input signal is a binary “0” and that the output is a binary “0” or that the output is at the low logic level. Moving the switch to the other position (Vcc), we apply a binary “1” to the input and receive a binary “1” at the output. The output is also said to be at the high logic level. The gate shown by this simple circuit is a “buffer” or “yes” gate, because the logic state of its input is identical to that of its output. Many types of gates are used in digital electronics: single input gates like the buffer and the NOT gates; multiple inputs gates like AND, NAND, OR, NOR, and XOR gates. The aim of this chapter is to study the functioning of each of those logic gates and also how they can be combined to design a simple logic function. 2.3 The NOT gate: The NOT gate or Inverter is a logic gate which functions in such a way that the logic state of the output is exactly the opposite of that of the input. Remark 2.1: The truth table A truth table is a standard way of representing the Inputs/outputs relationships of a digital circuit, listing all the possible input logic level combinations with their respective output logic levels. • The NOT gate truth table: Input Output 0 1 1 0 • Symbol Input Output Remark 2.2: the buffer gate If we were to connect two inverter gates together so that the output of one fed into the input of another, the two inversion functions would “cancel” each other out so that there would be no inversion from input to final output. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 27
  • 28. 1 0 0 Figure 2.2: Principle of the buffer gate A buffer is a special logic gate manufactured to perform the same function as two inverters connected together. Buffer gates serve to amplify signals, taking a weak signal source that is not capable of providing much current, and boosting the current capacity of the signal so as to be able to drive a load. • Symbol of a buffer gate: Input Output • Truth table of the buffer gate: Input Output 0 0 1 1 2.4 Multiple input gates: With a single input gate such as the inverter or buffer, there can only be two possible input states: either 1 or 0. With multiple input gates, many possibilities are available for input states. The number of possible input states is equal to two to the power of the number of inputs. So, if a gate has n inputs, therefore there are 2n possible input combinations. 2.4.1 The AND gate: The output of the AND gate is high if and only if all inputs are high. If any input is low, the output is guaranteed to be in a low state as well. • Truth table: Let us draw the truth table of a two inputs AND gate. A B A.B 0 0 0 0 1 0 1 0 0 1 1 1 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 28
  • 29. As you can notice on the truth table above, the output is high only when all the two inputs are high. • Symbol A Output B Exercise 2.1: Draw the truth table of a three inputs AND gate. Exercise 2.2: Complete the chronogram of the output Q of a two inputs AND gate. A B t t Q t The following solution can be given for the exercise 2.2 above: A 1 0 B t 1 0 t Q 1 0 t 2.4.2 The NAND gate: The word NAND is a verbal contraction of the words NOT and AND. Essentially, a NAND gate behaves the same as an AND gate with a not gate connected to the output terminal. • Symbol A Output B Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 29
  • 30. Truth table: Let us draw the truth table of a two inputs NAND gate. A B A.B 0 0 1 0 1 1 1 0 1 1 1 0 As with AND gates, NAND gates can be made with more than two inputs. Exercise 2.3: Complete the chronogram of the output Q of a two inputs NAND gate. A B t t Q t 2.4.3 The OR gate: The output of the OR gate is high if any of the inputs is high. The output of an OR gate goes low if and only if all inputs are low. • Truth table: A B A+B 0 0 0 0 1 1 1 0 1 1 1 1 • Symbol: A Output B Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 30
  • 31. Exercise 2.4: Draw the truth table of a three inputs OR gate. Exercise 2.5: Complete the chronogram of the output Q of a two inputs OR gate. A B t t Q t Exercise 2.6: Let us consider the following digital circuit: A B C X E a. Give the expression of the output X. b. Draw the truth table of the digital circuit. Exercise 2.7: Draw the truth table of the digital circuit described by the following equation: X = AB + ABC + AC Exercise 2.8: Let us consider the following digital circuit: A B C D X E a. Give the expression of the output X. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 31
  • 32. b. Draw the truth table of the circuit. c. Answer the two previous questions considering the following digital circuit: A B X C 2.4.4 The NOR gate: The NOR gate is an OR gate with its output inverted. • Truth table: A B A+ B 0 0 1 0 1 0 1 0 0 1 1 0 • Symbol: A Output B The NOR gate can also be manufactured with more than two inputs. Exercise 2.9: Let us consider the following digital circuit: A B C D X E a. Give the expression of the output X. b. Draw the truth table of the circuit. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 32
  • 33. Remark 2.3: The negative AND gate, the negative OR gate. Let us consider the following digital circuit: A X B a. Draw the truth table of this circuit. b. Show that this circuit is equivalent to a NOR gate. The expression of the output X can be written as follow: X = A.B . Therefore, the truth table of the circuit can be easily deduced: A B X 0 0 1 0 1 0 1 0 0 1 1 0 We can notice that the truth table of this circuit is identical to that of a NOR gate. The gate described in this exercise is called the negative AND gate and its symbol is given as follow: A Output B Let us consider the following gate circuit: A X B a. Draw the truth table of the circuit. b. Show that the circuit is equivalent to a NAND gate. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 33
  • 34. The expression of the output X can be written as follow: X = A. + B . Therefore, the truth table of the circuit can be easily deduced: A B X 0 0 1 0 1 1 1 0 1 1 1 0 We can notice that the truth table of this circuit is identical to that of a NAND gate. The circuit described in this exercise is called the negative OR gate. Its symbol is given as follow: 1 A 3 2 Output B Remark 2.4: The previous remark leads us to two important theorems of the Boolean algebra (the Boolean algebra will be studied in detail in the next chapter). Those theorems are called De Morgan’s theorems: A + B = A..B A.B = A + B Where A and B are two Boolean variables (A Boolean variable is that which can only take values 0 and 1). 2.4.5 The exclusive-OR gate: The exclusive-OR gate outputs a high level only if the inputs are at different logic levels, either 0 and 1 or 1 and 0. Conversely, its output is low if the inputs are at the same logic levels. The exclusive-OR gate is sometimes called XOR gate. • Truth table: A B A⊕ B 0 0 0 0 1 1 1 0 1 1 1 0 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 34
  • 35. Symbol: A Output B Exercise 2.10: Let us consider following gate circuit: A Y B a. Determine the expression of the output. b. Deduce the truth table. c. Conclude. Remark 2.5: From the exercise above the following property can be deduced: A.B + A.B = A ⊕ B 2.4.6 The exclusive-NOR gate: The exclusive-NOR gate is equivalent to an exclusive OR gate with an inverted output. The truth table is exactly opposite as for the exclusive-OR gate. The exclusive-NOR gate also known as the XNOR gate. • Truth table: A B A⊕ B 0 0 1 0 1 0 1 0 0 1 1 1 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 35
  • 36. Symbol: 1 A 3 2 Output B Exercise 2.11: Let us consider the following gate circuit: A X B a. Determine the expression of the output. b. Deduce the truth table. c. Conclude. Remark 2.6: From the previous exercise, the following property can be deduced: A..B + A.B = A ⊕ B The exclusive-OR and exclusive-NOR gates are very useful for circuits where two or more binary numbers are to be compared bit-for-bit, and also for error detection (parity check). 2.5 Gate universality: NAND and NOR gates posses a special property: they are universal. That is, given enough gates, either type of gate is able to mimic the operation of any other gate type. This ability for a single gate type to be able to mimic any other gate type is enjoyed only by the NAND and the NOR gate. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 36
  • 37. 2.5.1 Constructing the NOT function: Vcc Input Output Output Input Input Input Output Output 2.5.2 Constructing the buffer function: Vcc Vcc Output Input Input Output 2.5.3 Constructing the AND function: A Output B A Output B 2.5.4 Constructing the NAND function: A Output B Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 37
  • 38. 2.5.5 constructing the OR function: Vcc A Vcc Output B A B Output 2.5.6 Constructing the NOR function: Vcc Vcc A Output Vcc B 2.6 Voltages for logic states: Logic gate circuits are designed to input and output only two types of signals; ‘high’ (1) and ‘low’ (0), as represented by a variable voltage: Full power supply voltage for a high state and zero voltage for a low state. However, in reality, logic state voltage levels rarely attain these perfect limits. TTL gates (Transistor Transistor Logic) operate on a nominal power supply voltage of 5 volts+/- 0.25 volts. Acceptable input signal voltages range from 0 volt to 0.8 volt for low logic state, and 2 volts to 5 volts for high logic state. Acceptable output signal voltages range from 0 volt to 0.5 volt for low logic state and 2.7 volts to 5 volts for high logic state. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 38
  • 39. High High High level noise margin Low Low level noise margin low Figure 2.3: Voltage levels for TTL gates The noise margin of a gate is the difference between the tolerable output and input ranges. For CMOS gates (Complementary Metal Oxide Semiconductor) operating at a power supply of 5 volts, the acceptable input signal voltages range from 0 volt to 1.5 volts for low logic state, and 3.5 volts to 5 volts for a high logic state. Acceptable output signal voltages range from 0 volt to 0.05 volt for a low logic state and 4.95 volts to 5 volts for a high logic state. Exercise 2.12: Calculate the high level noise margin and the low level noise margin for CMOS circuits operating at a power supply of 5 volts. Compare that noise margin with that of a TTL circuit. Remark 2.7: Unlike TTL, which is restricted to a power supply voltage of 5 V, CMOS may be powered by voltages as high as 15 volts or 18 volts. 2.7 DIP gate packaging: Digital logic gates are manufactured as integrated circuits: all the constituent transistors and resistor built on a single piece of semiconductor material. The technicians and engineers find logic gates enclosed in DIP (Dual Inline Package) housing. Part numbers given to these DIP packages specify what type of gates are enclosed, and how many. These part numbers are industry standards. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 39
  • 40. A ‘74LS02’ manufactured by Motorola will be identical in function to a ‘74LS02’ manufactured by Fairchild or by other manufacturers. Letter codes added to the part number are unique to the manufacturer and are not industry standard codes. For instance, a ‘SN74LS02’ is a quad-2 inputs TTL NOR gate manufactured by Motorola while a ‘DM74LS02’ is the exact same circuit manufactured by Fairchild. Logic circuit part numbers beginning with ‘74’ are commercial-grad TTL. If the part number begins with the number ‘54’, the chip is a military grad unit having a greater operating temperature range, and typically more robust in regard to allowable power supply and signal voltage levels. The letters ‘LS’ immediately following the 74 or 54 prefix indicate low power shottky circuitry. Figure 2.4: Examples of TTL DIP circuit packages: Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 40
  • 41. Figure 2.5: Examples of CMOS DIP circuit package 2.8 Conclusion: In this chapter, we have studied the functioning of logic gates which are basic tools used in the design of any logic circuit. An introduction has also been made concerning the input and output voltage levels for TTL and CMOS circuits. The aim of the next chapter is the study of the Boolean algebra. It is a set of mathematical properties and identities governing the functioning of logic circuits. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 41
  • 42. REVIEW QUESTIONS 1. Consider the following gate circuit: A X B C D a. Give the expression of the output X. b. Draw the truth table of the circuit. 2. Draw the gate circuits corresponding to the following expressions: X = A.B(C + D) Y =  A + B + C D E  + BC D     ( ) Z = A + B + PQ ⊕ C D 3. For each of the following circuits, give the expression of the output and draw the truth table. A B X C A B Y C Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 42
  • 43. A B C Z D References: 3. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition, Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985. 4. Lessons In Electric Circuits Volume IV – Digital, Tony R. Kuphaldt, Fourth Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 43
  • 44. Courses In Electrical Engineering Volume II DIGITAL ELECTRONICS CHAPTER THREE : BOOLEAN ALGEBRA By J-P. NGOUNE DIPET I (Electrotechnics), DIPET II (Electrotechnics) DEA (Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 44
  • 45. Chapter Three BOOLEAN ALGEBRA 3.0 Specific objectives: At the end of this chapter, the student will be able to: - Master the rules of Boolean arithmetic; - Master Boolean algebraic identities and properties; - Convert truth tables of logic circuits into Boolean expressions. 3.1 Introduction: The Boolean algebra was created by the English mathematician George Boole (1815-1864). The Boolean algebra codifies rules of relationship between mathematical quantities to one of two possible values: true or false, 1 or 0. So, all arithmetic operations performed with Boolean quantities have but one of two possible outcomes: either 1 or 0. There are three basic Boolean arithmetic operations: • Boolean addition which is equivalent to the OR logic function, as well as parallel switch contacts; • Boolean multiplication, which is equivalent to the AND function as well as series switch contacts; • Boolean complementation which is equivalent to the NOT logic function. 3.2 Boolean arithmetic: This section presents the basic relationship concerning the three basic Boolean arithmetic operations. 3.2.1 Boolean addition: As we have already said, Boolean addition is equivalent to the OR logic function. Therefore, we have the following relationships: 0+0=0 0+1=1 1+0=1 1+1=1 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 45
  • 46. 0+0=0 0 0 0 0 0 0 0+1=1 1 0 U1 0 1 1 1 1+0=1 1 1 U2 1 1 0 0 1+1=1 1 1 U3 1 1 1 1 Remark 3.1: There is a difference between Boolean addition and binary addition; for binary addition we have the following relationships. 0+0=0 0+1=1 1+0=1 1 + 1 = 10 (1 + 1 = 0 + report of 1). 3.2.2 Boolean multiplication: The Boolean multiplication is equivalent to the AND logic function: 0x0=0 0x1=0 1x0=0 1x1=1 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 46
  • 47. 0x0=0 0 0 0 0 0 0 0x1=0 0 1 0 0 1 0 1 1x0=0 0 1 1 0 0 0 1x1=1 1 1 1 1 1 1 3.2.3 Boolean complementation: The Boolean complementation is equivalent to the NOT logic function. /0 = 1 0 1 /1 = 0 1 0 3.3 Boolean algebraic identities: An identity is a statement that is true for all possible values of its variables. There are two groups of Boolean algebraic identities: additive identities and multiplicative identities. 3.3.1 Additive identities If A is a Boolean variable, then the following statements are always true. A+0=A A+1=1 A+A=A A + /A = 1 A A+0=A A A A 0 0 A A+1=1 1 A 1 1 1 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 47
  • 48. A A+A=A A A A A A A A + /A = 1 1 A 1 /A /A 3.3.2 Multiplicative identities: A being a Boolean variable, the following statements are always true. 0xA=0 1xA=A AxA=A A x/A = 0 0xA=0 0 A 0 0 0 A 1xA=0 1 A A 1 A A AxA=A A A A A A A A x /A = 0 A /A 0 A 0 /A Remark 3.2: Double complementation Complementing a variable twice results in the original Boolean value. /A A //A = A Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 48
  • 49. 3.4 Boolean algebraic properties: Let us consider three Boolean variables A, B and C. The following properties are true. • Commutative property: - Addition: A+B=B+A - Multiplication: AxB=BxA • Associative property: - Addition: A + (B + C) = (A + B) + C - Multiplication: A(B.C) = (A.B)C • Distributive property: A(B + C) = A.B + A.C 3.5 Boolean rules for simplification: There are several rules for Boolean algebra intended to be used in reducing complex Boolean expressions to their simplest forms. The simplification of the Boolean expressions of logic circuits brings many advantages: - Higher operating speed (less delay time from input signal transition to output signal transition). - Less power consumption (few IC used). - Less cost. - Greater reliability. 3.5.1 Rule n° A + AB = A 1: A + AB = A (1 + B) = A (1) =A 3.5.2 Rule n° A + AB = A + B 2: A + AB = A + AB + AB (Apply the previous rule to expand A term to A + AB) ( ) = A + B A + A (Factorising B) Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 49
  • 50. = A + B(1) (Applying identity A + A = 1 ) = A+ B 3.5.3 Rule n° 3: ( A + B )( A + C ) = A + BC ( A + B )( A + C ) = A. A + A.C + A.B + B.C (Distributing terms) = A + AC + AB + BC (Applying identity AA = A) = A + AB + BC (Applying A + AC = A) = A + BC (Applying A + AB = A) 3.6 Circuit simplification example: Let us consider the following logic circuit. A B Q C 1. Write the Boolean expression of the output Q: Q = AB + BC (B + C ) ) 2. Reduce this expression to its simplest form using the rules of Boolean algebra. Q = AB + BCB + BCC = AB + BC + BC (Using the identity A.A =A) = AB + BC (Identity A.A = A) Q = B( A + C ) 3. Generate the schematic diagram of the simplest expression B Q A C Remark 3.3 To convert Boolean expression to a gate circuit, you should evaluate the expression using standard order of operation: - Multiplication before addition, - Operation within parenthesis before anything else. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 50
  • 51. Exercise 3.1: Simplify the following expressions using Boolean algebra and generate the schematic diagrams of the simplest expressions. X = A.B.C + A.BC + ABC + AB.C + A.B.C ( )( ) Y = B+C B+C + A+ B+C Z = (C + D ) + AC D + AB.C + A..BCD + A.C.D 3.7 The exclusive-OR function A A⊕ B B A ⊕ B = A.B + A.B 3.8 DeMorgan’s theorem AB = A + B A + B = A..B DeMorgan’s theorem may be thought in terms of breaking a long bar symbol. When a long bar is broken, the operation directly imply the changes from addition to multiplication or vice versa, and the broken bar pieces remains over the individual variables. Remark 3.4: When multiple layers of bar exists in an expression, you may only break one bar at a time. Example 3.1: Let us simplify the following expressions: A + BC = A.BC (The superior bar broken) = A.BC A + B + C = A.B.C = A.BC Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 51
  • 52. 3.9 Converting truth table into Boolean expression: We can convert truth table into Boolean expression using one of the following methods: - Sum of products (SOP) - Product of sums (POS) 3.9.1 Sum of products: Boolean expressions may be generated from truth table quite easily using the following steps: - Determine which rows of the table have an output of 1; - Write one product for each raw; - Sum all the product terms. This creates a Boolean expression representing the truth table as a whole. Example 3.2: Let’s consider a logic circuit having the following truth table: A B C Q 0 0 0 0 Row 1 0 0 1 0 Row 2 0 1 0 0 Row 3 0 1 1 1 Row 4 1 0 0 0 Row 5 1 0 1 1 Row 6 1 1 0 1 Row 7 1 1 1 1 Row 8 The rows 4, 6, 7 and 8 have an output of 1, each raw gives us a product. By summing those products, we obtain the following Boolean expression which is that of the output Q. Q = ABC + A BC + ABC + ABC Exercise 3.2: Simplify the expression of the output Q treated in the example above using Boolean algebra and generate the schematic diagram of the simplest expression. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 52
  • 53. 3.9.2 Product of sums: Boolean expression may be also generated from truth table quite easily by determining which rows of the table have an output of 0, writing one sum term for each row and finally multiplying all the terms. Example 3.3: Let us consider a logic circuit having the following truth table. A B C Q 0 0 0 0 Row 1 0 0 1 1 Row 2 0 1 0 1 Row 3 0 1 1 1 Row 4 1 0 0 1 Row 5 1 0 1 1 Row 6 1 1 0 1 Row 7 1 1 1 0 Row 8 The rows 1 and 8 have an output of 0; each row gives us a sum. The product of those sums gives us a Boolean expression which is that of the output of the logic circuit. In fact, we have: Q = A.B.C + ABC Q=Q ( ) = A..B..C + ABC = (A..B..C ). A.B.C =  A + B + C (A + B + C )     = ( A + B + C )(A + B + C ) Q = ( A + B + C ).( A + B + C ) In reality for each row having an output of 0, we should notice that we have but the inverted output product ( Q ). By inverting that output ( Q ), we obtain a sum using DeMorgan’s theorem. Finally, the product of all those sums gives us the output of the logic circuit. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 53
  • 54. Remark: Generally, the sum of products is more used than the product of sums to convert a truth table into Boolean expression. However, when a few number of rows have an output of 0, it is preferable to use the POS than to use the SOP. Exercise 3.3: Generate the logic diagram of the circuit treated the example 3.3. Exercise 3.4: Assuming that A ⊕ B = A.B + A.B , proof that A ⊕ B = A.B + A..B 3.10 Conclusion: This chapter has permitted us to study the identities and the properties of the Boolean algebra. Those are tools used for the simplification of the Boolean expressions. However, this simplification is sometime very difficult to carry out, especially for logic circuit having complex Boolean expression. To solve this problem, another method of simplification has been proposed: that is Karnaugh mapping. It is the topic of the next chapter. REVIEW QUESTIONS 1. Simplify the following expressions using Boolean algebra: X = ABCD + A..B.C.D + A.B.C D + A.B.C.D + A.BCD + ABC.D + ABC D + ABC D + ABCD Y = ABC + ABC + ABC + ABC 2. Simplify the following circuit using the Boolean algebra. A B C X Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 54
  • 55. 3. Conceive de logic circuit corresponding to the following truth table. A B C X 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 4. Logic gates can be realised using diodes and resistors. Consider the following circuits: Vcc Va Va S S Vb Vb a. Analyse the functioning of each circuit by filling the following truth table. Va Vb Vs 0 0 0 1 1 0 1 1 b. Deduce the logic gate described by those circuits Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 55
  • 56. 5. Logic gates can also be realised using resistor and transistor: That is resistor transistor logic (RTL). Consider the following circuits: Vcc Vcc Vout Va Va Vout Vb Vb Vcc Vout Vin Study the functioning of each of those circuits and determine the logic gate described by each of them. 6. Logic gates can also be realised using diodes and transistors. Vcc Va Vout Vb Study the functioning of the circuit and deduce the logic gate that it describes. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 56
  • 57. 7. A3A2A1A0 is a binary number having four bits. A3 is the MSB and A0 is the LSB. Conceive a logic circuit that produces an output of 1 when the binary number is superior to 0010 and inferior to 1000. 8. A logic circuit has 4 inputs A, B, C and D, and one output X. The output X is high only if C and D are low while A or B or both (A and B) are high. Conceive the logic circuit so described. NB: The conception of a logic circuit requires the following steps: - Truth table; - Determination of the simplified expression of the output; - Logic diagram of the circuit using logic gates. References: 5. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition, Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985. 6. Lessons In Electric Circuits Volume IV – Digital, Tony R. Kuphaldt, Fourth Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 57
  • 58. Courses In Electrical Engineering Volume II DIGITAL ELECTRONICS CHAPTER FOUR: KARNAUGH MAPPING By J-P. NGOUNE DIPET I (Electrotechnics), DIPET II (Electrotechnics) DEA (Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 58
  • 59. Chapter Four KARNAUGH MAPPING 4.0 Specific objectives: At the end of this chapter, the student will be able to simplify Boolean expressions using Karnaugh mapping. 4.1 Introduction: Karnaugh map, like Boolean algebra is a simplification tool applicable to digital logic. Maurice Karnaugh, a telecommunication engineer developed the k-map at Bell labs in 1953 while designing digital logic based telephone switching circuits. K-map reduces logic functions more quickly and easily compared to Boolean algebra. By reduce we mean simplify, reducing the number of gates and inputs. K-map works well for up to six input variables (in this course we will study up to 4 input variables). For more than six variables, simplification should be done by CAD (Computer Automated Design). 4.2 Karnaugh maps, truth tables and Boolean expression: Karnaugh map is filled using Gray code. As we have already seen in the first chapter, Gray code is a numeration code which is such that, in a given Gray sequence, each number differs from the next or the previous number only with one bit. In order to know how to generate a Gray sequence of number, please go back to the first chapter which treated the matter of numeration systems and codes. 4.2.1 Transferring the content of a truth table into a k-map: Let us consider the following truth table: A B X 0 0 0 0 1 1 1 0 0 1 1 1 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 59
  • 60. The content of the truth table can be transferred to the truth table as follow: X B 0 1 A Top 0 0 1 1 0 1 Side The logic states of the output are written in the table according to the combination of the input variable A and B. Each location of the table corresponds to one logic state of the output. So we have four locations here because we have four output combinations according to our truth table. The logic states of the inputs A and B are filled using Gray code. To determine the simplified Boolean expression of the output, we should follow the following steps: • Look for adjacent cells; that is above or to the side of a cell. Diagonal cells are not adjacent. • Circle the two adjacent ones. • Find the variables top and/or side which are the same for the group. It is the variable B in our case. It means that, as we can notice, for the group of ones, the variables B remains unchanged and equal to 1. Write this as the Boolean result. • Ignore variables which are not the same for the cell group. In our case, A varies. It is both 1 and 0. So A should be ignored; it cannot be written as Boolean result. • Ignore any variable not associated with cells containing ones. • Then the Boolean expression of the output is: X = B Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 60
  • 61. Exercise 4.1: Consider the following logic diagram: A B X a. Establish the truth table of the circuit. b. Give the Boolean expression of the output using SOP (Sum of products) method. c. Give the simplified Boolean expression of the output using K-map. Exercise 4.2: For each of the following truth table, write the Boolean expression of the output using k-maps. A B X A B X 0 0 1 0 0 0 0 1 1 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 A B X A B X 0 0 1 0 0 1 0 1 0 0 1 1 1 0 1 1 0 0 1 1 1 1 1 1 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 61
  • 62. Remark 4.1: How to determine the Boolean expression of a gate circuit. • Write the Boolean expression of the output using SOP method; • Transfer the product terms to the k-map; • Form groups of adjacent cells; • Deduce simplified Boolean expression of the output. • Draw the simplified logic circuit. Example 4.1: Let us determine the simplified Boolean expression of the following circuit using k- map. A B X • Using the SOP method the Boolean expression of the output can be written as follow: X = A B + AB • The expression can then be transfer in a k-map: X B 0 1 A 0 0 1 1 1 0 • It is not possible to form groups of adjacent ones. The two ones of the k-map are isolated. • No simplification is therefore possible. The Boolean expression should be left as it is. X = AB + AB = A ⊕ B Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 62
  • 63. This is not a simplified expression. This ‘simplification’ is just intended to make a schematic diagram look nicer. In fact exclusive-or function is a combination of other functions. 4.2.2 Logic simplification with Karnaugh map: Boolean simplification that we have done above could be achieved with Boolean algebra quickly. Real world logic simplification problems call for larger k- maps so that we may do serious work. We will now develop tools that we need for more complex application in combinatory logic. 4.2.2.1 General method These are the steps which should be followed for the simplification of a Boolean expression using Karnaugh mapping. • Draw the k-map filling the ones and the zeros in the corresponding cells; • Observe with attention the k-map and detect the ones which are isolated: those are the ones that are not adjacent to another one. Circle them. • Find the ones which are adjacent only to one another one. Circle them to form groups of two ones. • Find groups one eight ones which are adjacent and circle them, even if among them there are ones belonging already to a group of two ones. • Find groups of four adjacent ones and circle them. Among the four ones there should be at least one one which has not yet been grouped. • Then deduce the simplified Boolean expression. The following sizes of k-map will be used X CD AB 00 01 11 10 X 00 BC A 00 01 11 10 01 0 11 1 10 K-map for 3 Boolean input variables K-map for four Boolean input variables Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 63
  • 64. As we have already said, the input logic states are filled using Gray code, so for instance, if we have two variables A and B, the Gray sequence will be: 00,01,11,10 (a binary sequence would have been 00,01,10,11!). 4.2.2.2 K-map for three input Boolean variables: Let us consider the following three variables Boolean expression. X = A.B.C + A.B.C This expression can be transferred in a k-map as follow: X BC A 00 01 11 10 0 1 1 0 0 1 0 0 0 0 The simplified Boolean expression of the output can therefore be determined. X = A.B Exercise4.3: Simplify the following Boolean expressions using k-maps: X = A.B.C + A.B.C + A.BC + A.B.C Y = A.B.C + A.BC + ABC + ABC Z = A.B.C + A.B.C + ABC + A.BC + ABC + ABC Example 4.2: Let us simplify the following Boolean expression using k-map. X = A.B.C + A.B.C + A.BC + A.B.C + A.B.C + ABC The first step consists of filling the k-map. X BC A 00 01 11 10 0 1 1 1 1 1 1 0 0 1 After grouping the ones, we can now deduce the simplified expression of the output: X = A+C Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 64
  • 65. 4.2.2.3 K-map for four input Boolean variables: Let us consider the following Boolean expression: X = A.BCD + A.BCD + ABCD + ABCD + ABC.D + ABC D + ABC D This expression can be transferred in the k-map as follows: X CD AB 00 01 11 10 00 0 0 1 0 01 0 0 1 0 11 1 1 1 1 10 0 0 1 0 The simplified Boolean expression of the output can therefore be deduced: X = AB + CD Example 4.3: Consider the k-map bellow and give the simplified Boolean expression the output X: X CD AB 00 01 11 10 00 1 1 1 1 01 1 0 0 1 11 1 0 0 1 10 1 1 1 1 The simplified Boolean expression of the output is therefore determined: X = B+D Exercise 4.4: Simplify the following Boolean expression using k-map: X = A.B.C.D + A..B.C.D + AB.C.D + A.B.C.D Y = A.B.C.D + A.B.C.D + A.B.CD + A.B.C.D + A.B..C.D + A.B.C.D + AB.CD + A.B.C.D Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 65
  • 66. Remark 4.2: Condition of indifference Some logic circuits are conceived in such a way that for certain combination of input variables, the output is neither high nor low. In fact, those input combinations should never occur. In the k-maps, the cells representing those combinations are filled with a X. Let us consider for instance the following truth table: X BC 00 01 11 10 A We deduce that 0 0 0 1 X X=B 1 0 X 1 1 4.3 Conclusion: This chapter has permitted us to study Karnaugh mapping which is used for an easier simplification of Boolean expression. It is one of the most important tools that should be deeply understood in order to succeed in the study of combinatory logic circuit. The next chapter will be focused on the study of digital arithmetic. That is, on how digital systems perform arithmetical operations such as addition, subtraction, multiplication and division. REVIEW QUESTIONS 1. Simplify the following Boolean expressions using k-maps: X = A.B.C + A.BC + ABC + AB.C + A.B.C ( )( ) Y = B+C B+C + A+ B+C Z = (C + D ) + AC D + AB.C + A..BCD + A.C.D S = ABCD + A..B.C.D + A.B.C D + A.B.C.D + A.BCD + ABC.D + ABC D + ABC D + ABCD T = ABC + ABC + ABC + ABC Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 66
  • 67. 2. For each of the following k-maps, determine the Boolean expression of the output X. X X CD CD AB 00 01 11 10 AB 00 01 11 10 00 1 1 0 1 00 1 1 1 1 01 0 1 1 0 01 1 1 0 1 11 0 1 1 0 11 1 1 0 1 10 0 0 0 1 10 1 1 0 1 X X CD CD AB 00 01 11 10 AB 00 01 11 10 00 0 0 1 0 00 1 1 1 1 01 0 0 0 0 01 0 1 1 0 11 1 1 1 1 11 0 0 0 0 10 0 1 1 0 10 1 0 0 1 X X BC BC 00 01 11 10 00 01 11 10 A A 0 0 1 1 0 0 0 0 1 0 1 0 1 1 0 1 0 1 1 1 X X BC BC 00 01 11 10 00 01 11 10 A A 0 1 1 1 1 0 1 0 1 0 1 1 0 0 1 1 0 1 0 1 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 67
  • 68. References: 7. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition, Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985. 8. Lessons In Electric Circuits Volume IV – Digital, Tony R. Kuphaldt, Fourth Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits. 9. Cours de systèmes logiques, Notes de cours, Première année du génie électrique, ENSET de Douala, J.C Tsokezo, 2004-2005. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 68
  • 69. Courses In Electrical Engineering Volume II DIGITAL ELECTRONICS CHAPTER FIVE: DIGITAL ARITHMETIC By J-P. NGOUNE DIPET I (Electrotechnics), DIPET II (Electrotechnics) DEA (Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon. Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 69
  • 70. Chapter Five DIGITAL ARITHMETIC 5.0 Specific objectives: At the end of this chapter, the student will be able to perform arithmetical operations such as addition, subtraction, and multiplication using binary numbers 5.1 Introduction: Many arithmetical operations are carried out in digital systems like computers and calculators. The most common of these operations are addition, subtraction and multiplication. The aim of this chapter is to understand the principle used by digital systems to perform those operations. 5.2 Binary addition: The addition of two binary numbers is similar to that of two decimal numbers. Let us consider the following case: 354 +663 10 1 7 This operation is performed using the following steps: • We begin by adding the two less significant digits of the two decimal numbers: 3 + 4 =7. There is no carry out. • Then we proceed by adding the two digits situated directly at the left: 5 + 6 = 11. We write 1 and the carry out is 1. • We add the two next digits: 3 + 6 = 9; the carry out is added: 9 + 1 = 10. So the result of the addition is 1017. For binary number, the principle is the same. However, only four cases can be met while adding binary numbers: 0+0=0 1+0=1 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 70
  • 71. 1 + 1 = 0 + a carry out of 1 1 + 1 + 1 = 1 + a carry out of 1. Example 5.1: Let us add the following binary numbers: A = 1001 (910), B = 1111 (1510). 1001 +1111 11000 • We begin by adding the two LSB (Least Significant Bit): 1 + 1 = 0 + carry out of 1. • Then we add that carry to the two bits situated directly at the left: 0 + 1 + 1(Carry) = 0 + carry out of 1. • The same operation is performed for the next rank. • Then for the most significant bits, we have: 1 +1 + 1(Carry from the previous rank) = 11. • Finally, the result of the operation gives us 11000 (2410). Exercise 5.1: For each of the following cases, add the binary numbers A and B. a) A = 11101; B = 1001. b) A = 101111; B = 11111. c) A = 11101; B = 11111. 5.3 Signed numbers: In order to differentiate positive numbers to negative numbers, a specific bit can be added in front of the binary number. That bit is called bit of sign. The bit of sign is 0 for positive numbers and 1 for negative numbers. Example 5.2: +9 = 01001 -24 = 111000 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 71
  • 72. For negative binary numbers, there are two other types of notation: • The one’s complement notation; • The two’s complement notation. 5.3.1 The one’s complement notation: The one’s complement notation of a binary number is simply obtained by complementing each bit of the number. Let us write for example the one’s complement of the following binary number: 10010110 10010110 Exact notation 01101001 One’s complement notation Remark 5.1: For negative binary numbers, we should not forget the bit of sign: 11101 Exact notation 10010 One’s complement notation. Notice that the bit of sign is not complemented. Exercise 5.2: Give the one’s complement of the following binary numbers. a) 101101; b) 1101101 (signed number); c) 011101011 (signed number). 5.3.2 The two’s complement notation The two’s complement notation of a binary number is obtained by adding 1 to the one’s complement notation of that number. 110110 Exact notation 001001 One’s complement notation + 1 001010 Two’s complement notation For signed number, remember that the bit of sign remain unchanged. Exercise 5.3: Give the two’s complement of the following binary numbers. b) 101101; b) 1101101 (signed number); c) 011101011 (signed number). Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 72
  • 73. We can recapitulate all what we have studied concerning one’s and two’s complementation in the following table: Decimal Exact notation One’s complement Two’s complement +24 011000 011000 011000 -24 111000 100111 101000 Notice that for positive numbers, exact notation does not differ from one’s complement and two’s complement notation. 5.3.3 Conversion from one’s complement and two’s complement notation to exact notation: To convert from the one’s complement notation to the exact notation, each bit of the one’s complement notation should just be complemented back. 111000 Exact notation. 100111 One’s complement notation. 111000 Exact notation. Notice that the bit of sign does not change. To convert from two’s complement notation to the exact notation, the two’s complemented number should just be two’s complemented back. 1001 Exact notation 0110 + 1 0111 Two’s complement notation 1000 + 1 1001 Exact notation 5.4 Addition of two signed numbers: Depending on the sign of the two numbers to be added, many cases can be studied. Case 1: Two positive numbers: Let us add +4 to +9. +9 = 01001 +4 = 00100 Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 73