Introduction to Digital System

By Notes Vandar

1.1 Introduction to Analog and digital system

Analog Systems:

  • Definition: Analog systems process signals that vary continuously. These signals can represent a range of values, such as voltage or current.
  • Examples: Examples include audio signals, radio waves, and temperature readings from a thermometer.
  • Characteristics:
    • Continuous signal representation
    • Can provide infinite resolution, but may suffer from noise and distortion
    • Components include resistors, capacitors, and operational amplifiers.
  • Applications: Used in traditional broadcasting, audio equipment, and measurement devices.

Digital Systems:

  • Definition: Digital systems process signals that have discrete values. These systems represent information in binary form (0s and 1s).
  • Examples: Examples include computers, digital cameras, and smartphones.
  • Characteristics:
    • Discrete signal representation, leading to finite resolution
    • More robust against noise and distortion
    • Components include microprocessors, memory units, and digital signal processors (DSPs).

Applications: Used in computing, telecommunications, and digital media.

Key Differences:

  1. Signal Representation: Analog systems use continuous signals, while digital systems use discrete binary values.
  2. Noise Resistance: Digital systems are generally more resistant to noise, making them suitable for long-distance communication.
  3. Processing and Storage: Digital systems can easily store and process large amounts of data, whereas analog systems often require more complex circuitry for processing.

1.2 Features of Digital Systems

  • Discrete Signal Representation:
    • Digital systems represent information using binary digits (bits), typically in the form of 0s and 1s. This discrete representation allows for precise and clear signal processing.
  • Noise Immunity:
    • Digital signals are less susceptible to noise and interference compared to analog signals. This makes digital systems more reliable, especially in long-distance communication.
  • Data Storage and Retrieval:
    • Digital systems can store vast amounts of data in a compact form. Data can be easily retrieved, modified, and duplicated without loss of quality.
  • Flexibility and Scalability:
    • Digital systems can be easily programmed and reconfigured. They can adapt to different tasks and applications, making them highly versatile.
  • Integration and Miniaturization:
    • Advances in technology have led to the integration of multiple digital functions into single chips (e.g., microcontrollers, FPGAs), enabling compact designs and reducing system complexity.
  • High Precision and Accuracy:
    • Digital systems can achieve high levels of precision and accuracy in processing and measurement, as they can handle a greater number of discrete values.
  • Easy Transmission:
    • Digital signals can be easily transmitted over various mediums (e.g., fiber optics, wireless) without significant degradation, allowing for efficient long-distance communication.
  • Error Detection and Correction:
    • Digital systems can implement sophisticated error detection and correction algorithms, enhancing data integrity during transmission and storage.
  • Modularity:
    • Digital systems can be designed in a modular fashion, allowing for easy upgrades and maintenance by replacing or adding components without affecting the entire system.
  • Interactivity:
    • Digital systems support interactive interfaces, enabling users to engage with applications through graphical user interfaces (GUIs), touchscreens, and other input devices.

1.3. Number Systems- Decimal, Binary, Octal, Hexadecimal and their inter conversions

1. Decimal Number System (Base 10):

  • Digits Used: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • Characteristics: It is the standard system for denoting integer and non-integer numbers. Each digit’s place value is a power of 10.

Conversion to Binary:

  1. Divide the decimal number by 2.
  2. Record the remainder.
  3. Repeat with the quotient until the quotient is 0.
  4. Read the remainders in reverse order.

Example: Decimal 13

  • 13 ÷ 2 = 6, remainder 1
  • 6 ÷ 2 = 3, remainder 0
  • 3 ÷ 2 = 1, remainder 1
  • 1 ÷ 2 = 0, remainder 1
  • Binary: 1101

2. Binary Number System (Base 2):

  • Digits Used: 0, 1
  • Characteristics: It is used in digital systems. Each digit’s place value is a power of 2.

Conversion to Decimal:

  1. Multiply each binary digit by its corresponding power of 2.
  2. Sum the results.

Example: Binary 1101

  • 1×23+1×22+0×21+1×20=8+4+0+1=131 \times 2^3 + 1 \times 2^2 + 0 \times 2^1 + 1 \times 2^0 = 8 + 4 + 0 + 1 = 13

Conversion to Octal:

  • Group binary digits in sets of three (from right to left).
  • Convert each group to its octal equivalent.

Example: Binary 110101 (group as 110|101)

  • 1102=6110_2 = 6 and 1012=5101_2 = 5 → Octal: 65

Conversion to Hexadecimal:

  • Group binary digits in sets of four (from right to left).
  • Convert each group to its hexadecimal equivalent.

Example: Binary 110101 (group as 1101|0100)

  • 11012=D1101_2 = D and 01002=40100_2 = 4 → Hexadecimal: D4

3. Octal Number System (Base 8):

  • Digits Used: 0, 1, 2, 3, 4, 5, 6, 7
  • Characteristics: Each digit’s place value is a power of 8.

Conversion to Decimal:

  1. Multiply each octal digit by its corresponding power of 8.
  2. Sum the results.

Example: Octal 75

  • 7×81+5×80=56+5=617 \times 8^1 + 5 \times 8^0 = 56 + 5 = 61

Conversion to Binary:

  • Convert each octal digit to its 3-digit binary equivalent.

Example: Octal 75

  • 7→1117 \rightarrow 111 and 5→1015 \rightarrow 101 → Binary: 111101

Conversion to Hexadecimal:

  • Convert to binary first, then to hexadecimal.

4. Hexadecimal Number System (Base 16):

  • Digits Used: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
  • Characteristics: Each digit’s place value is a power of 16.

Conversion to Decimal:

  1. Multiply each hexadecimal digit by its corresponding power of 16.
  2. Sum the results.

Example: Hexadecimal 2F

  • 2×161+F×160=32+15=472 \times 16^1 + F \times 16^0 = 32 + 15 = 47

Conversion to Binary:

  • Convert each hexadecimal digit to its 4-digit binary equivalent.

Example: Hexadecimal 2F

  • 2→00102 \rightarrow 0010 and F→1111F \rightarrow 1111 → Binary: 00101111

Interconversions Summary:

  • Decimal ↔ Binary: Use division/multiplication methods.
  • Binary ↔ Octal: Group binary digits (3s) for octal conversion.
  • Binary ↔ Hexadecimal: Group binary digits (4s) for hexadecimal conversion.
  • Octal ↔ Hexadecimal: Convert to binary first, then to the desired system.

1.4. Binary Arithmetic. complement system and subtraction using 1’s, 2’s, 9’s, and 10’s complement method

Binary Arithmetic

1. Binary Addition:

  • Similar to decimal addition, but carries occur when the sum exceeds 1.

Example:

 1011
+ 1101
——
11000
  • Carry occurs from the last column to the next.

2. Binary Subtraction:

  • Can be performed using the borrow method or using complements.

Complement System

1. Definition:

  • The complement of a number is found by subtracting each digit from the base minus one. For binary, the base is 2.

2. Types of Complements:

  • 1’s Complement: Invert all bits (0 becomes 1, and 1 becomes 0).
  • 2’s Complement: Add 1 to the 1’s complement.
  • 9’s Complement: Subtract each digit from 9 (for decimal).
  • 10’s Complement: Add 1 to the 9’s complement (for decimal).

Subtraction Using Complements

1. Subtraction using 1’s Complement:

  • To subtract BB from AA:
    1. Find the 1’s complement of BB.
    2. Add it to AA.
    3. If there’s a carry, add it back to the result.

Example: Subtract 101021010_2 (10) from 110021100_2 (12).

  1. 1’s complement of 10101010 is 01010101.
  2. Add:
     1100
    + 0101
    ——–
    1 0001 (discard the carry)
  3. Result is 00010001 (2).

2. Subtraction using 2’s Complement:

  • To subtract BB from AA:
    1. Find the 2’s complement of BB.
    2. Add it to AA.
    3. If the result is negative (indicated by a carry), discard the carry.

Example: Subtract 101021010_2 (10) from 110021100_2 (12).

  1. 2’s complement of 10101010 is 01100110 (1’s complement 01010101 + 1).
  2. Add:
     1100
    + 0110
    ——–
    1 0010 (discard the carry)
  3. Result is 00100010 (2).

3. Subtraction using 9’s Complement (Decimal):

  • To subtract BB from AA:
    1. Find the 9’s complement of BB.
    2. Add it to AA.
    3. If there’s a carry, discard it; otherwise, adjust by adding 1.

Example: Subtract 76 from 95.

  1. 9’s complement of 76 is 2323.
  2. Add:
     95
    + 23
    —–
    118
  3. Since there’s a carry (1), discard it → Result is 1818.

4. Subtraction using 10’s Complement (Decimal):

  • To subtract BB from AA:
    1. Find the 10’s complement of BB.
    2. Add it to AA.
    3. If there’s a carry, discard it; otherwise, adjust by adding 1.

Example: Subtract 76 from 95.

  1. 10’s complement of 76 is 2424 (9’s complement + 1).
  2. Add:
     95
    + 24
    —–
    119
  3. Since there’s a carry (1), discard it → Result is 1919.

 

1.5. Codes: BCD, XS-3, Gray code, hamming code, alphanumeric codes (ASCII, EBCDIC, UNICODE),

1. Binary-Coded Decimal (BCD)

  • Definition: BCD is a binary encoding of decimal numbers where each digit of a decimal number is represented by its binary equivalent.
  • Representation: Each decimal digit (0-9) is encoded using four bits.

Example:

  • Decimal 25 in BCD: 0010 01010010 \, 0101

2. Excess-3 (XS-3)

  • Definition: XS-3 is a non-weighted code used to express decimal numbers. Each decimal digit is represented by its equivalent BCD code plus three.
  • Representation: Each decimal digit is encoded using four bits.

Example:

  • Decimal 2: 2+3=52 + 3 = 5 → BCD for 5 is 01010101
  • Decimal 25 in XS-3:
    • 2 → 01010101
    • 5 → 10001000
  • Therefore, 25 in XS-3: 0101 10000101 \, 1000

3. Gray Code

  • Definition: Gray code is a binary numeral system where two successive values differ in only one bit. It is used to prevent errors in digital systems.

Example:

  • Decimal 0 to 3 in Gray code:
    • 0 → 0000
    • 1 → 0101
    • 2 → 1111
    • 3 → 1010

4. Hamming Code

  • Definition: Hamming code is an error-correcting code that can detect and correct single-bit errors in transmitted data.
  • Mechanism: It adds redundant bits (parity bits) to data bits to create a codeword that allows for error detection and correction.

Example:

  • For a 4-bit data word, 3 parity bits can be added:
    • Data: d1,d2,d3,d4d_1, d_2, d_3, d_4
    • Parity bits are placed at positions that are powers of 2.

5. Alphanumeric Codes

1. ASCII (American Standard Code for Information Interchange)

  • Definition: A character encoding standard for electronic communication that represents text in computers and other devices.
  • Representation: Uses 7 bits to represent characters (128 possible characters).

Example:

  • Letter ‘A’ in ASCII: 0100000101000001

2. EBCDIC (Extended Binary Coded Decimal Interchange Code)

  • Definition: A character encoding system used mainly on IBM mainframe and midrange computer systems.
  • Representation: Uses 8 bits for each character, allowing for 256 possible characters.

Example:

  • Letter ‘A’ in EBCDIC: 1100000011000000

3. Unicode

  • Definition: A character encoding standard that aims to cover all characters and symbols from all writing systems in the world.
  • Representation: Uses variable lengths, with the most common encoding forms being UTF-8 (1 to 4 bytes) and UTF-16 (2 bytes).

Example:

  • Letter ‘A’ in Unicode (UTF-8): 0100000101000001

 

1.6. Error Detecting and Error Correcting Codes

Error Detecting Codes

Definition: Error detecting codes are techniques used to identify errors in transmitted data. These codes can detect whether data has been altered during transmission, but they do not provide the means to correct the errors.

Common Types:

  1. Parity Bits:
    • Even Parity: A single bit is added such that the total number of 1s in the data is even.
    • Odd Parity: A single bit is added such that the total number of 1s is odd.
    • Example:
      • Data: 1101001 (4 ones) → Even parity bit: 0 → Transmitted: 11010010
      • Data: 1101000 (3 ones) → Odd parity bit: 1 → Transmitted: 11010001
  2. Checksums:
    • A checksum is a value calculated from a data set (e.g., sum of bytes). The checksum is sent with the data, and the receiver recalculates it to check for errors.
    • Example: If the data is 10010010 and the sum is 1001, the checksum is 1001.
  3. Cyclic Redundancy Check (CRC):
    • A more robust error detection method that treats data as a polynomial and divides it by a fixed polynomial, appending the remainder as the CRC.
    • Example: CRC is widely used in network communications and storage devices.

Error Correcting Codes

Definition: Error correcting codes not only detect errors but also allow the receiver to correct them without needing retransmission.

Common Types:

  1. Hamming Code:
    • Uses redundancy bits placed at specific positions to detect and correct single-bit errors.
    • Parity bits are calculated based on specific combinations of data bits. If an error occurs, the position of the error can be identified and corrected.
    • Example: For a 4-bit data word, 3 parity bits are added.
  2. Reed-Solomon Code:
    • A block error-correcting code widely used in CDs, DVDs, QR codes, and data transmission.
    • It can correct multiple errors in blocks of data and is effective in correcting burst errors.
    • Example: Used in data storage and communication systems.
  3. Bose–Chaudhuri–Hocquenghem (BCH) Codes:
    • A class of cyclic error-correcting codes that can correct multiple random errors in data transmission.
    • Example: BCH codes are used in deep-space communication.
  4. Turbo Codes and Low-Density Parity-Check (LDPC) Codes:
    • Advanced error-correcting codes used in modern communication systems, providing near-capacity performance.
    • They are particularly effective in wireless communication and satellite transmissions.

 

 

Next Chapter
Important Questions
Comments
Discussion
0 Comments
  Loading . . .