DIGITAL ELECTRONICS (Chapter 1) Level 1 Remake
DIGITAL ELECTRONICS (Chapter 1) Level 1 Remake
DIGITAL ELECTRONICS (Chapter 1) Level 1 Remake
ELECTRONICS
BP:13719
WEB: www.iaicameroun.com
E-MAIL: [email protected]
DIGITAL
ELECTRONICS
Mr. MESSIO
Email: [email protected]
Chapter 1
1. NUMBERING SYSTEMS AND NON-NUMERICAL INFORMATION
1.1 Introduction
In this modern world of electronics, the term digital is mainly associated with a computer. Today,
digital circuits and systems have a wide range of applications in almost all areas of electronics. In
communications, the principles of digital electronics are found in satellites, telephone switching and
transmission networks, and navigation systems. In consumer electronics, digital circuits are found in
compact discs, VCRs and television. Similarly, digital systems are also used in process controls in
industrial applications and in the field of medical science.
In this chapter, we will begin the discussion with the introduction of digital and analog systems, and
then we will study different numbering systems used to represent data in digital systems.
There are two types of electronic circuits and systems; Analog and Digital. Analog systems are those
in which physical quantities are represented over a continuous range of values. They can take infinite
values within the specified range. For example, the amplitude of the output signal to the speaker in a
radio receiver can have any value between zero and its maximum limit.
On the other hand, numerical systems are those in which physical quantities are represented in
numerical form; that is, quantities can only take discrete values. Any quantity in the physical world,
such as temperature, pressure, or voltage, can be symbolized in a digital circuit by a group of logical
levels that, taken together, represent a binary number. Logical levels are usually specified as 0 or 1;
Sometimes it may be more convenient to use low/high, false/true or disabled/enabled or on/off.
Since all modern digital circuits use only two voltage levels, HIGH and LOW, they are therefore
easier to design. The exact numerical values of the voltages are not important because they have only
a logical meaning; only the range in which they are located is important. In analog systems, signals
have digital significance; their design is therefore more complex.
Storing digital information is easy because there are many types of high-capacity semiconductor and
magnetic memories that can store digital data for as long periods as needed.
Digital systems are much more accurate and accurate than analog systems, as digital systems can be
extended to handle more digits simply by adding more switching circuits. Analog systems are quite
complex and expensive for the same accuracy and precision.
Unwanted electrical signals are called noise. Since in analog systems the exact values of voltages are
important and in digital systems only the range of values is important, the effect of noise is more
critical in analog systems. In digital systems, noise is not critical until it is so great that we cannot
distinguish a HIGH from a LOW.
It is quite easy to design digital systems whose operation is controlled by a set of stored instructions
called a program. If we want to change the way the system works, we can do it easily by changing the
program. Analog systems can also be programmed, but the variety of operations available is limited.
The manufacture of digital integrated circuits is simpler and more economical than analog integrated
circuits. In addition, higher integration densities can be achieved in digital integrated circuits than in
analog integrated circuits, because digital design does not require high-value capacitors, resistors,
inductors, and transformers (which cannot be economically integrated) like analog design.
We have already discussed the benefits of digital systems, but there are some limitations of digital
systems. In the real world, most physical quantities are analog in nature. These quantities are used as
system input signals and monitored to control the system. In the digital system, these analog
quantities are used through the following steps:
1. Convert analog inputs to digital form by a converted ADC analog to digital.
2. Process digital information.
3. Convert digital outputs back to analog form by digital-to-analog converter, DAC.
Due to these conversions, the processing time increases and the system becomes more
complex. In most cases, these disadvantages are outweighed by many advantages of digital
techniques.
Everyone knows a numeral system known as the decimal number system. The "deci" means ten, so
that this system has 10 distinct digits or symbols: 0 1 2 3 4 5 6 7 8 9. Decimal numbers fall into the
category of positional numbering system, since the position of a digit indicates the meaning to be
attached to that number. For example, consider a number 7639. This number has 7 thousand, 6
cents, 3 tens and 9 units,
If a fractional decimal number is considered to be say 5367.42, then it can be written in positional form as:
Based on the decimal number system discussed above, other numbering systems can be defined very
easily. The general form of any numeral system may be given as:
N=an*(r)n ...+ a3*(r)3+ a2*(r)2+ a1*(r)1+ a0*(r)0+ a-1*(r)-1+ a-2*(r)-2+… a-m*(r)-m
Where r is called radix or base of the numbering system. The weighted coefficients an to a−m can be
any number between 0 and (r – 1). The coefficient a−m is called the least significant digit (LSD) and
a n is known as the most significant digit (MSD).
On the analogy of the system of decimal numbers, we can define another system of numbers whose
radix or base is two (r = 2) and its elements or digits will be 0 & 1 only. This system is known as the
binary number system because its radix is two (binary means 2). The digits 0 and 1 of this system
are called bits. This numbering system is widely used in digital electronics.
Table 1.1 illustrates the binary system count with their decimal equivalents
The decimal equivalent of a binary number (for example 10110) is 22, which can be verified as
follows by applying the same pattern discussed in the decimal number system.
(Demonstration)
????
The radix or base of the octal number system is 8 (octal means 8) and its digits will be from 0 to 7, i.e.
0, 1, 2, 3, 4, 5, 6, 7.
Table 1.2 illustrates the octal counting with their decimal equivalents
????
(107)8=????
(213)8=????
(751)8=????
(109)8=????
In the system of hexadecimal numbers, the radix or base is 16 and its digits will be 16 distinct
elements which are given as: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
Table 1.3 illustrates the counting in the system
of hexadecimal numbers with their decimal equivalents
It can be verified that the decimal equivalent of the hexadecimal number (17)16 is (23)10
??????????
(15)16=????
(FF)16=????
(2C0)16=????
It is necessary to know the techniques with which the conversion of the whole decimal number is
possible
Directly into a binary number. Consider an integer decimal number d that can be represented by:
If we divide d by a factor of 2 (radix of the binary number system), we get the quotient q as:
And the coefficient a0 becomes the rest. Thus, the least significant bit a0 is determined. Still dividing the
quotient q by 2, we obtain the second least significant bit a1. If this division procedure is continued until the
quotient becomes zero, all coefficients an to a0 will be obtained. In general, integer decimals can be
converted to their equivalent numbers in another number system by dividing the decimal number by
the radix of the required number system. The leftovers will give the required result.
Solution:
Example 1.6: Convert the following decimal numbers to hexadecimal. (i) 8537 (ii) 98765
Consider a fractional decimal number f represented in its equivalent binary form given by:
In order to find the coefficients a– 1, a – 2 .... a – n The fraction number f is multiplied by a factor of 2
(radix of the binary number) such as:
In this way, we obtain the coefficient a − 1 which is an integer 0 or 1. The fraction f1 of the product
is then multiplied by the factor 2 to have the coefficient a – 2. The multiplication procedure shall be
continued until the fractional part of the product becomes void. Sometimes the fractional part does
not become zero, in which case the multiplication process is stopped after obtaining the four five
coefficients or until recurrence occurs. i
Example 1.7: Convert the following decimal numbers to binaries. (i) 0.625 (ii) 0.6
In this example, the non-terminal binary fraction is obtained when 0.6 reproduces beyond this point.
So (0.6)10 = (0.1001(1001) ... ) 2
The eight symbols of the octal numbers 0, 1, 2, .... 7 can be represented as three-bit binary numbers
like 23 = 8. Thus, starting from the least significant bit of the binary number, the three successive bits
are arranged together as groups. These three-bit groups are replaced by their octal equivalents as
shown in Table 1.4.
Binary numbers are converted to octals by making the groups of three bits from right to left in the
integer part of the binary number and from left to right on the binary fractional part. If it is necessary
to make groups of three bits, one or two zeros can be added to the left of the most significant bit;
and/or to the right of the least significant bit of the fractional part of the binary number.
As is well known, the hexadecimal system has a base 16 (24 = 16), each hexadecimal digit can be
represented as a group of 4 bits as shown in Table 1.5. For the conversion of octal to binary and vice
versa, one can proceed in the same way as in the case of octal to binary and vice versa.
Table 1.6 shows the addition of two bits a and b, having the sum and the carryover to the next position.
There are four possible combinations
This table is known as the half-adder table, because it gives the simple addition of two bits a and b.
Table 1.7 known as the full adder table shows the addition of a maximum of three bits. These bits are
the transport bits, if any, from the previous addition step, and the augend and addend bits.
The subtractor half table is used for subtraction similar to that used for addition. It is clear from
Table 1.8 that when 1 is subtracted from 0, a 1 must be borrowed from the next adjacent upper
position.
A complete table – subtractor with minuend, subtrahend and borrowed bit from the previous step as
inputs and which gives the difference as well as the borrowing bit to be taken from the next step, is
presented in Table 1.9.
The positive figures have been discussed so far in the previous sections of this chapter. But most
numerical systems deal not only with positive numbers, but also with negative numbers. Certain means
are therefore necessary to represent the sign of binary numbers. In general, an extra bit is provided at
the far left of the number. This extra bit is known as the sign bit. The extra bit is isolated from the
magnitude of the binary number by a comma. The sign bit is 0 or 1. By convention, a bit 0 is used for
positive numbers and a bit 1 is used for negative numbers.
Although this method of representing signed numbers is simple, it is not normally used in the
numerical system because the realization of this method by digital circuit is very complex. The most
commonly used method to represent signed binary numbers is the complement of 2 method. Before
discussing binary arithmetic operations signed using the complement of 2 method, it is necessary to
show the complement of 1 and the representation of the complement of 2 of binary numbers.
The complement of 1 of a binary number is obtained by converting each bit 0 of the binary number
into a 1, and each bit 1 by a 0. The value of the complement of 1 represents the negative number of the
binary number. For example: The complement of 1 of the binary number 1011101 is obtained as:
The other method to obtain the complement of 2 of a binary number is to scan the number from right
to left and complete all the bits appearing after the first scan of a '1'.
For example, the complement of 2 of (42)10 = (101010)2 is 010110. Since the first '1' appears in the
second place from the right side, all the bits after popping up first '1' in the second place are completed.
This can be checked using the first method described above.
An N-bit machine can handle unsigned decimal numbers from 0 to 2N – 1. Thus, a 4-bit machine can
handle from 0 to 15 decimal (unsigned) numbers represented by binary numbers ranging from 0000 to
1111. However, for signed binary numbers, the 4-bit machine will have the range from – 8 to +7.
If the complement of 2 method is used to represent negative numbers as discussed above, subtraction of
signed numbers can easily only be done by the addition method. This will lead to a simplification of
hardware circuits.
Example 1.14: Represent the following decimal numbers as 8-bit signed numbers in the
complementary form of 2. (i) +25 (ii) – 68 (iii) –128
Solution:
(i) +25 = 000110012
For example, in (00001100)2, since the sign bit at the top is 0, it is a positive number. Similarly,
since the other 7 bits, which are the absolute value of the numerical value, are (0001100)2 = 23 +
22 = (12)10, the decimal number 12 (positive number) is represented. On the other hand, since in
(10001100)2 the sign bit at the top is 1, it is a negative number. The decimal number - 12 =
(negative number) is represented. However, since in this method of representation the numeric
value 0 can be represented in two ways, as 000000000 (positive zero) or as 10000000 (negative
zero), the operation becomes complicated and, for this reason, it is not widely used.
In signed numbers, the addition and subtraction of binary numbers are the same. Subtracting two
positive numbers means adding a negative number to the positive number. The negative number infect
is the complement of the positive number of 2. When adding two signed numbers, if there is an ending
around the port, it should be ignored. The result is interpreted using the convention discussed above,
i.e. if MSB of the result is 0, then the answer is positive and on the contrary if MSB is 1, then the
answer is negative (in the complementary form of 2). This can be illustrated by taking the following
examples:
Consider the addition of +15 and – 9. The numbers +15 and –9 are represented in 5-bit signed binary
form. These numbers cannot be represented as a 4-bit signed number because the 4-bit machine will
have the range of – 8 to +7.
There is an ending around porting that is ignored. The answer is therefore correct because 00110
represents + 6.
(ii) Adding a positive number with a larger negative number Consider adding +9
and –15.
There is no end around porting, so the answer is negative, which is verified by the ESM of the response.
The answer is correct because 11010 represents – 6.
The result 11000 is correct in unsigned binary numbers but incorrect in signed binary numbers
because 11000 is −8 in 5-bit signed binary numbers. The correct answer could be obtained if a 6-bit
signed binary system were considered.
After ignoring the end around port, the 01000 response is incorrect because the maximum limit
for 5bit signed binary numbers is –16 to +15. To get the correct answer, each number should
have been represented in 6-bit signed binary form as follows:
Now the answer is correct because after ignoring the end around port 101000 represents –24
in signed binary form.
The overflow would have occurred in the two examples above because an initially
insufficient number of bits were used to represent the signed binary numbers. When working
with the addition of the complement of 2, it is necessary to ensure that the positive and
negative number are expressed in the representation of the complement of 2 and that the sum
is also within the specified range, otherwise an erroneous result will occur. However, in
computers, a special circuit is provided to detect any overflow conditions and indicate the
erroneous result.
Example 1.15: Perform the following in an 8-bit system using the add-in method of 2.
(i) – 49– 26 (ii) 67 – 39 (iii) – 87 + 112 .
Solution:
Solution
For scientific and technical fields requiring this type of complicated calculation, the floating-point
format is used. Here, "complicated" means not only that the computational process itself is
complicated, but also that the extremely large or small size of the data is processed. When we
represent the number 1,500,000,000, instead of writing 8 zeros, we use the following exponent
representation: 15 x 108 .
In the floating-point format, it would be written as 0.15 x 1010, where 0.15 is called the mantissa, 10 is
the radix and the other 10 is the exponent.
The floating-point representation format varies depending on the computer. This is roughly classified in
the format used in mainframe computers and that defined by the IEEE (Institute of Electrical and
Electronics Engineering).
Superscript part: The exponent part has 7 bits, and the range of representable numeric values in the
binary system is (0000000)2 to (1111111)2, which in the decimal system is 0 to 127. However, a
numerical value 64 times larger than the actual exponent is represented. For this reason, the real
exponent is equivalent to 64 to +63. Then, including the sign bit, the range of numeric values that
can be represented with the exponent part is shown in Figure 1-1-18.
Mantiss part: When the decimal fraction 0.05 is converted to a binary fraction, it becomes a repeating
binary fraction. (0.0000110011001100110011001100...) 2 . Since the mantissa part has 24 bits, in this
case, the decimal fraction 0.05 will not be represented correctly. (The error that occurs in this case is
called a rounding error.) However, if we look at the bit pattern of the mantissa part, we can see that
the top 4 bits are 0, if we then extract these 4 bits and move the remaining bits to the left, 4 rounded
bits can be represented. Here, as a result of moving the mantissa part 4 bits to the left, the original
value of the mantissa part was increased by 24 = 16. In order to cancel this increase, it is necessary to
divide it into 16 (16-1). Since the radius is 16, the value of the exponent part can be set to -1. The
technique, used in this way, in order to reduce rounding error to its minimum as well as maximize
accuracy is called normalization.
The floating-point representation format according to an IEEE standard is shown in Figure 1-1-21
The differences from the general-purpose computer floating-point representation format are as
follows: - The exponent part has 8 bits, and a value resulting from the addition of 127 to the value of
the original exponent part is represented. This addition to the original value is called bias - The
mantissa part has 23 bits and a binary fraction equivalent to the mantissa -1 is recorded. In other
words, 1 is considered omitted. - The radius of the exponent part is 2. For example, let's represent 5
using the IEEE format. - Since it is positive, the mantissa sign will be 0. - If 5= (101)2 = (101)2 x 20
= (1.01)2 x 22, then the mantissa part will be (1.01)2(1)2 = (0.01)2 - If (101)2 is shifted 2 bits to the
right, it becomes (1.01)2, 2-2 times the previous value. In order to normalize it, 2 is added to the
exponent 0, which becomes 2. Consequently, since the exponent part is 2 + 127 = 129, the
representation will be (10000001)2.
When using a computer, in order to enter numbers and characters (alphabetic characters, symbols,
etc.), input devices such as keyboards are used. Inside the computer, in order to represent characters
using binary digits, a concept called code is used. Currently, different character codes are used
depending on the computer. Here, the codes widely used in the world and in Japan will be explained.
One of the components that make up multimedia is audio. The human voice is produced when
the airflow generated in the lungs changes, vibrates and resonates due to a large number of organs such
as the tongue, lips, teeth, jaw, nasal cavity and vocal cords. Since audio data has a complicated analog
waveform, audio analysis is performed using a digital formula and once converted to digital codes, it is
processed in the computer. Word processors that accept audio input and speaker recognition are
examples of its recent applications.
In order to support today's multimedia, not only audio data but also image data must be processed.
Inside the computer, image data is processed as a set of points. For this reason, recording the status of
each of the points that make up an image is the recording of the image data itself. The simplest
approach is to record two states, black and white, for each of the points that make up an image. In this
case, 1 bit is used to record the information of each point. Today, most image data is colored, so this
method does not solve all problems. Therefore, the representation method that combines the basic
colors in each point is used. Among computer monitors, there are a large number of systems that
combine the three primary colors (red, green and blue) in 256 levels respectively and represent about
16,000,000 colors. In this case, since 8 bits are needed for 1 color, in order to record