Example: air traffic controller

Introduction to Digital Electronics - Agner

1 Introduction to Digital Electronics by Agner Fog, 2019-10-30. Contents 1. Number systems .. 3 Decimal, binary, and hexadecimal numbers .. 3 Conversion from another number system to decimal .. 4 Conversion from decimal to another number system .. 5 Addition of binary numbers .. 6 Signed binary numbers .. 7 Binary coded decimal numbers .. 9 Exercises .. 10 2. Boolean algebra .. 12 Laws and rules .. 13 Truth tables .. 14 Reducing a Boolean expression .. 15 Exercises .. 16 3. Digital circuits .. 18 How Boolean gates are made .. 18 Gate symbols .. 21 Exercises .. 23 4. Commonly used Boolean circuits.

A digital system typically has a fixed number of bits to represent a binary number. For example, if we have four bits, we can have the numbers from 0 to 15: binary decimal 0000 0 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 10 …

Tags:

  Digital, To digital

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Introduction to Digital Electronics - Agner

1 1 Introduction to Digital Electronics by Agner Fog, 2019-10-30. Contents 1. Number systems .. 3 Decimal, binary, and hexadecimal numbers .. 3 Conversion from another number system to decimal .. 4 Conversion from decimal to another number system .. 5 Addition of binary numbers .. 6 Signed binary numbers .. 7 Binary coded decimal numbers .. 9 Exercises .. 10 2. Boolean algebra .. 12 Laws and rules .. 13 Truth tables .. 14 Reducing a Boolean expression .. 15 Exercises .. 16 3. Digital circuits .. 18 How Boolean gates are made .. 18 Gate symbols .. 21 Exercises .. 23 4. Commonly used Boolean circuits.

2 25 Decoders .. 25 Encoders .. 26 Seven segment decoders .. 27 Multiplexers .. 28 Adders .. 29 Subtracting binary numbers .. 30 Exercises .. 32 5. Flip-Flops .. 34 Basic feed back circuit .. 34 SR flip-flop .. 34 SR flip-flop with enable .. 35 2 D latch .. 36 Edge-triggered D flip-flop .. 36 Edge-triggered D Flip-Flop with set and reset .. 38 Toggle flip-flop .. 39 Ripple counter .. 40 Exercises .. 41 6. State machines .. 45 Synchronous design .. 52 Exercises .. 55 7. Interfacing Digital circuits .. 57 Pushbuttons .. 57 Button with debouncing .. 58 Automatic power-on reset.

3 61 LED output .. 62 Relay output .. 63 Optocouplers .. 64 Digital -to-analog converters .. 65 Analog-to- Digital converters .. 66 Exercises .. 69 8. Microprocessors and microcontrollers .. 70 Input ports and output ports .. 71 Interrupt .. 73 9. Appendix A: List of Digital integrated circuits .. 75 3 1. Number systems Decimal, binary, and hexadecimal numbers We all know the decimal number system. For example, 2019 means 2*1000 + 0*100 + 1*10 + 9*1. The numbers 2, 0, 1, 9 are called the digits of the number 2019. If we want to describe this mathematically, we will call the rightmost digit d0, the next digit d1, etc.

4 If there are n digits: d0, d1, d2, .. dn-1, then the value v can be calculated by the formula v= 10 1 =0 In the example of 2019, we have d0 = 9, d1 = 1, d2 = 0, d3 = 2, n = 4. This gives v = 2019. 10 is the base or radix of the number system. The reason why we are using ten as the radix is that this makes it easy to use our ten fingers for counting. The name decimal comes from Latin decem which means ten. The word digit means finger. If we use a number system with radix r then the above formula becomes v= 1 =0 For example, if the radix r is sixteen then 2019 does not mean two thousand and nineteen.

5 Instead the value becomes 2019(base 16) = 9*160 + 1*161 + 0*162 + 2*163 = 8217(base 10). Binary numbers Computers do not have ten fingers so the decimal number system is not the most efficient system to use in computers. Instead, the binary system with radix 2 is used. For example, 1101(base 2) = 1*20 + 0*21 + 1*22 + 1*23 = 13(base 10). The rightmost digit is the least significant digit with the worth 20 = 1. We can call the least significant the 1's, the next digit from the right is the 2's. Next comes the 4's, the 8's, etc. The calculation is illustrated in this table: 8's 4's 2's 1's 1 1 0 1 1 * 8 = 8 1 * 4 = 4 0 * 2 = 0 1 * 1 = 1 8 + 4 + 0 + 1 = 13 Each digit in a binary number can have only two different values: 0 and 1.

6 These are conveniently represented in an electrical wire as two different voltages. The lower of the two voltages represents 0 and the higher voltage represents 1. For example, we may choose 0V and 5V for the numbers 0 and 1, respectively. A binary number with four digits, as in the example above, can be represented by four wires, where each wire has either 0V or 5V. 4 A binary digit is also called a bit. A bit can be 0 or 1. This is the smallest piece of information that you can store in any system. Hexadecimal numbers The hexadecimal number system has radix 16. The sixteen possible digits are written as this: Digit Value 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 A 10 B 11 C 12 D 13 E 14 F 15 For example 4AD1(base 16) = 1*160 + 13*161 + 10*162 + 4*163 = 19153(base 10).

7 The hexadecimal system is often used as a short way to represent binary numbers with many digits. Each hexadecimal digit corresponds to four binary digits, because 16 = 24. For example, the binary number 0100101011010001(base 2) is easily converted to the hexadecimal number 4AD1(base 16) by dividing the bits into groups of four: 0100 1010 1101 0001 4 A D 1 Conversion from another number system to decimal There are two convenient ways to convert from any other number system to decimal. The first method starts with the rightmost digit (least significant digit) and multiplies by powers of the radix.

8 We used this method above to convert the number 4AD1 from hexadecimal to decimal: 4AD1(base 16) = 1*160 + 13*161 + 10*162 + 4*163 = 19153(base 10). The second method starts with the leftmost digit (most significant digit). Multiply the leftmost digit by the radix. Add the next digit. Multiply the result by the radix. Add the next digit, and so on. Stop after adding the last digit. Do not multiply by the radix after adding the last digit. 5 If we apply this method to the same example, we get: 4AD1(base 16) = ((4 * 16 + 10) * 16 + 13) * 16 + 1 = 19153(base 10). The second method is convenient to use with a pocket calculator.

9 Conversion from decimal to another number system There are also two ways to convert from decimal to another number system. The first method gives the rightmost digit (least significant digit) first: Divide the number repeatedly by the radix and get the integer part of each result. Save the remainders from each division. The remainders represent the converted number with the least significant digit first. This method is illustrated with the same example as above: Convert 19153 from decimal to hexadecimal: Number Division Fraction Remainder 19153 19153 / 16 = 1197, remainder 1 1197 1 1197 1197 / 16 = 74, remainder 13 74 13 74 74 / 16 = 4, remainder 10 4 10 4 4 / 16 = 0, remainder 4 0 4 You get the result from the remainders in reverse order: 4 : 10 : 13 : 1 gives 4AD1(base 16).

10 The second method gives the leftmost digit (most significant digit) first: Find the highest power of the radix that is not bigger than the number you want to convert. Divide by the highest power of the radix first. The result of the first division is the most significant digit of the result. Divide the remainder by the next lower power of the radix, and so no. Our example gives these results: Convert 19153 from decimal to hexadecimal: Number Division Fraction Remainder 19153 19153 / 163 = 4, remainder 2769 4 2769 2769 2769 / 162 = 10, remainder 209 10 209 209 209 / 161 = 13, remainder 1 13 1 1 1 / 160 = 1, remainder 0 1 0 You get the result from the fractions: 4 : 10 : 13 : 1 gives 4AD1(base 16).


Related search queries