The study of electronic circuits where the inputs and outputs are limited to two fixed or discrete values or logic levels is called digital electronics. Digital technol- ogy would take many volumes to do it justice, so in this text we can only scratch the surface. There is a place for both analog and digital circuits in instrumenta- tion. Sensors and instrumentation functions are analog in nature. However, the digital circuits have many advantages over analog circuits. Analog signals are easily converted to digital signals using commercially available analog-to-digital converters (ADC). In new designs, digital circuits will be used wherever possible.
Some of the advantages of digital circuits are ■ Lower power requirements
■ More cost effective
■ Can transmit signals over long distances without loss of accuracy and elimi- nation of noise
■ High-speed signal transmission ■ Memory capability for data storage
■ Controller and alpha numeric display compatible 4.3.1 Digital signals
Digital signals are either high or low logic levels. Most digital circuits use a 5-V supply. The logic low (binary 0) level is from 0 to 1V, the logic high (binary1) level is from 2 to 5V; 1 to 2 V is an undefined region, i.e., any voltage below 1 V is considered a 0 level and any voltage above 2 V is considered a 1 level. In cir- cuits where the supply voltage is other than 5 V, a 0 level is still considered as a 0 V level or the output drivers are sinking current, i.e., connecting the output terminal to ground, and a 1 level is close to the supply voltage or the output driv- ers are sourcing current, i.e., connecting the output terminal to the supply rail. 4.3.2 Binary numbers
We use the decimal system (base 10) for mathematical functions, whereas elec- tronics uses the binary system (base 2) to perform the same functions. The rules are the same when performing calculations using either of the two num- bering systems (to the base 10 or 2). Table 4.1 gives a comparison between counting in the decimal and binary systems. The least significant bit (LSB) or unit number is the right-hand bit. In the decimal system when the unit num- bers are used we go to the tens, that is, 9 goes to10, and when the tens are used we go to the hundreds, that is, 99 goes to 100 and so forth. The binary system is the same when the 0 and 1 are used in the LSB position, then we go to the next position and so on, that is, 1 goes to 10,11 goes to 100, and 111 goes to 1000, and
so forth. The only difference is that, to represent a number it requires more digits when using a binary system than in the decimal system.
Binary numbers can be easily converted to decimal numbers by using the power value of the binary number. Table 4.2 gives the power value of binary numbers versus their location from the LSB and their decimal equivalent.
Note that when counting locations, the count starts at 0 and not, as might be expected, at 1.
Each binary digit is called a bit, 4 bits are defined as a nibble, 8 bits form a byte, and 2 bytes or 16 bits are called a word. A word is often broken down into 4 nib- bles, where each nibble is represented by a decade number plus letters as shown in Table 4.3. Thus, a word can be represented by 4 decade numbers plus the first six letters of the alphabet. This system is known as the hexadecimal system.
Example 4.8 What is the decimal number equivalent of the binary number 101100101? The equivalent power values are given by
Binary number 1 0 1 1 0 0 1 0 1
Location 8 6 5 2 0
Power value 28 26 25 22 2°
Decimal number 256 + 64 + 32 + 4 + 1
Decimal Total = 357
TABLE 4.1 Decimal and Binary Equivalents
Decimal Binary Decimal Binary
0000 0000000 0021 0010101 0001 0000001 — — 0002 0000010 0031 0011111 0003 0000011 0032 0100000 0004 0000100 — — 0005 0000101 0063 0111111 — — 0064 1000000 0007 0000111 — — 0008 0001000 0099 1100011 0009 0001001 0100 1100100 0010 0001010 0101 1100101 0011 0001011 0999 1111100111 0015 0001111 1000 1111101000 0016 0010000 1001 1111101001 — — 1002 1111101010 0020 0010100 1024 10000000000
TABLE 4.2 Power Value of Binary Numbers
Location 8 7 6 5 4 3 2 1 0
Power value 28 27 26 25 24 23 22 21 20
Example 4.9 What is the hexadecimal equivalent of the binary word 1101001110110111? The binary word is broken down into groups of 4 bits (byte) starting from the LSB and going to the most significant bit (MSB).
MSB ...LSB
Word separated into bytes 1101 0011 1011 0111
Hexadecimal equivalent D 3 B 7
Decimal number equivalent 54,199
Binary circuits are synchronized by clock signals which are referenced to very accurate crystal oscillators (< ±0.001 percent), using counters and dividers. The clock signal can be used to generate very accurate delays and timing sig- nals, compared to RC-generated delays and timing which can have tolerances of > ±10 percent, so that delays and timing will be done almost entirely by dig- ital circuits in new equipment.
4.3.3 Logic circuits
The basic building blocks in digital circuits are called gates. These are buffer, inverter, AND, NAND, OR, NOR, XOR, and XNOR. These basic blocks are inter- connected to build functional blocks such as encoders, decoders, adders, coun- ters, registers, multiplexers, demultiplexers, memories, and the like. The functional blocks are then interconnected to make systems, i.e., calculators, computers, microprocessors, clocks, function generators, transmitters, receivers, digital instruments, ADC and digital-to-analog converters (DAC), telephone systems and the like, to name a few.
Figure 4.12ashows the circuit of a complementary MOS (CMOS) inverter. The circuit uses both N- and P-channel complementary devices (note device symbols). Figure 4.12bshows the equivalent gate symbol. When the input to the gate is low (0) the positive-channel MOS (PMOS) is “ON” and the negative MOS (NMOS) is “OFF” so that the output is held high (1), and when the input is high (1) the PMOS is “OFF” and the NMOS is “ON”, which will hold the output low (0), so that the input sign is inverted at the output. One of the MOS devices is always “OFF”, so that the circuit draws no current from the supply (except during switching) making CMOS circuits very power efficient.
TABLE 4.3 Numbering Equivalent in the Hexadecimal (H) System
Binary number Decade equivalent Binary number Decade equivalent
0000 0 1000 8 0001 1 1001 9 0010 2 1010 A 0011 3 1011 B 0100 4 1100 C 0101 5 1101 D 0110 6 1110 E 0111 7 1111 F
4.3.4 Analog-to-digital conversion
The amplitude of an analog signal can be represented by a digital number, for instance, an 8-bit word can represent numbers up to 255, so that it can repre- sent an analog voltage or current with an accuracy of 1 in 255 (assuming the con- version is accurate to 1 bit) or 0.4 percent accuracy. Similarly a 10 and 12-bit word can represent analog signals to accuracies of 0.1 and 0.025 percent, respectively.
Commercial integrated A/D converters are readily available for instrumen- tation applications. Several techniques are used for the conversion of analog signals–to digital signals. These are
Flash converterswhich are very fast and expensive with limited accuracy, that is, 6-bit output with a conversion time of 33 ns. The device can sample an analog voltage 30 million times per second.
Successive approximationis a high-speed, medium-cost technique with good accuracy, that is, the most expensive device can convert an analog voltage to 12 bits in 20 µs, and a less expensive device can convert an analog signal to 8 bits in 30 µs.
Resistor ladder networksare used in low-speed, medium-cost converters. They have a 12-bit conversion time of about 5 ms.
Dual slope convertersare low-cost, low-speed devices but have good accuracy and are very tolerant of high noise levels in the analog signal. A 12-bit con- version takes about 20 ms.
Analog signals are constantly changing, so that for a converter to make a measurement, a sample-and-hold technique is used to capture the voltage level at a specific instant in time. Such a circuit is shown in Fig. 4.13a, with the wave- forms shown in Fig. 4.13b. The N-channel field effect transistor (FET) in the sample-and-hold circuit has a low impedance when turned “ON” and a very high impedance when turned “OFF”. The voltage across capacitor Cfollows the input analog voltage when the FET is “ON” and holds the dc level of the analog volt- age when the FET is turned “OFF”. During the “OFF” period the ADC meas- ures the dc level of the analog voltage and converts it into a digital signal. As the Figure 4.12 Circuit components used to make (a) a MOS inverter and (b) an inverter symbol.
sampling frequency of the ADC is much higher than the frequency of the analog signal, the varying amplitude of the analog signal can be represented in a dig- ital format during each sample period and stored in memory. The analog signal can be regenerated from the digital signal using a DAC.
Figure 4.14ashows the block diagram of the ADC 0804, a commercial 8-bit ADC. The analog input is converted to a byte of digital information every few milliseconds.
An alternative to the ADC is the voltage-to-frequency converter. In this case the analog voltage is converted to a frequency. Commercial units such as the LM 331 shown in Fig. 4.14b are available for this conversion. These devices Figure 4.13 (a) Sample and hold circuit and (b) waveforms for the circuit.
have a linear relation between voltage and frequency. The operating charac- teristics of the devices are given in the manufacturers’ data sheets.