CHAPTER 1: Introduction to Digital Systems, Number Systems and Codes
1.1 Analog and Digital Representation
- Analog Systems: Process information that varies continuously over time (e.g., time, pressure, sound). They use Base 10 (decimal) and are represented by 10 different levels (0-9).
- Digital Systems: Process digital signals using circuits that take either 0 or 1 (binary system). They process discrete sets of values in separate steps.
- Advantages of Digital: Easier to design/store, maintains accuracy/precision, programmable without altering hardware, less affected by noise, easily fabricated on IC chips, and more reliable for data processing/transmission.
- Disadvantages of Digital: Takes time to convert/process, has electrical limitations (cannot handle high voltage/current), vulnerable to rounding errors, and often requires Analog-to-Digital or Digital-to-Analog Converters (ADC/DAC).
1.2 Binary Digits, Logic Levels, & Digital Waveforms
- Binary System: A two-state system (HIGH and LOW). A single binary digit is called a bit.
- Positive Logic: HIGH = 1 (higher voltage), LOW = 0 (lower voltage).
- Negative Logic: HIGH = 0 (higher voltage), LOW = 1 (lower voltage).
- Logic Levels: Specific voltage ranges represent states. Practically, Bit 1 is 2V to 5V, Bit 0 is 0V to 0.8V. The 0.8V to 2V range is undefined to prevent overlap.
- Digital Waveforms: Series of pulses transitioning between HIGH and LOW states.
- Frequency (f): Rate of repetition per second, measured in Hertz (Hz). f = 1/T
- Period (T): Time from one pulse edge to the corresponding edge of the next. T = 1/f
- Duty Cycle: Ratio of the pulse width (t_w) to the period (T). Duty\ Cycle = (t_w / T) \times 100\%
1.3 Types of Logic Families
Logic circuits are the building blocks of digital systems, composed of diodes, transistors, and resistors.
- Bipolar Logic Families: Use bipolar devices (diodes/transistors).
- Saturated: Transistors driven into saturation (e.g., TTL, RTL, DTL, HTL). TTL (Transistor-Transistor Logic) is the standard, longest-used family.
- Unsaturated: Not driven into saturation (e.g., Schottky TTL, ECL). ECL is suited for high-speed operations.
- Unipolar Logic Families: Use Unipolar devices like MOSFETs. They offer high speed and low power consumption. Types include PMOS, NMOS, and CMOS (Complementary MOS—dominant today for low power / VLSI circuits).
1.4 Decimal Number and Binary Number
- Decimal (Base 10): Uses 10 digits (0-9). Positional weights are powers of 10.
- Binary (Base 2): Uses 2 digits (0 and 1). Positional weights are powers of 2.
1.5 Conversions (Binary <-> Decimal)
- Binary to Decimal: Multiply each bit by its positional weight (e.g., 2^3, 2^2, 2^1) and sum the results.
- Decimal to Binary:
- Sum-of-weights method: Determine the set of binary weights whose sum equals the decimal value.
- Repeated Division-by-2 method (Whole Numbers): Divide by 2 repeatedly and record the remainder. First remainder is the LSB (Least Significant Bit), last is the MSB (Most Significant Bit).
- Repeated Multiplication-by-2 (Fractions): Multiply the fractional part by 2. Record the carry (0 or 1). Stop when the fractional part reaches zero.
1.6 Hexadecimal and Octal Number Systems
- Hexadecimal (Base 16): Uses 16 symbols (0-9 and A-F). Groups bits into sets of four.
- Conversions: Divide/multiply by 16 for decimal conversion. Group binary strings into 4s starting from the LSB to convert from binary to hex.
- Octal (Base 8): Uses 8 symbols (0-7). Groups bits into sets of three.
1.7 Signed Numbers
Signed numbers indicate both magnitude and whether a number is positive (sign bit = 0) or negative (sign bit = 1). The sign bit is the leftmost bit.
- Sign-Magnitude: Left bit is the sign, remaining bits are the magnitude.
- 1's Complement: Positive numbers are the same as sign-magnitude. To get a negative number, invert all bits of the positive counterpart.
- Arithmetic: Requires an "end-around carry" (adding the overflow carry back to the LSB). Contains a positive and negative zero.
- 2's Complement (Most Common): To get the 2's complement, invert all bits (1's complement) and add 1 to the LSB.
- Arithmetic: Uses modulus arithmetic. You add the 2's complement of the subtrahend to the minuend. Any final carry out of the MSB is ignored.
- Overflow: Occurs when the number of bits in the sum exceeds the available bits, resulting in an incorrect sign bit.
1.8 Gray Code
- An unweighted code, also known as a minimum change code.
- Rule: Only one bit changes when going from one sequential step to the next.
- Great for reducing errors in electro-mechanical switches/sensors, but cannot be used for arithmetic.
- Binary to Gray: MSB is the same. Add adjacent pairs of binary bits (XOR) to get the next Gray bit (discarding carries).
- Gray to Binary: MSB is the same. Add each newly generated binary bit to the adjacent Gray bit to get the next binary bit.
1.9 Binary Coded Decimal (BCD) & Excess-3 Code
- BCD: Represents each individual decimal digit as a 4-bit binary group (0000 to 1001).
- Codes 1010 through 1111 are invalid.
- Addition: If a sum exceeds 9 (or generates a carry), you must correct it by adding 6 (
0110) to that digit group.
- Excess-3 Code: Another BCD variant. To encode, add 3 to the decimal digit, then convert it to 4-bit binary.
1.10 ASCII Code
(Note: Labelled 1.20 in the document)
- American Standard Code for Information Interchange.
- A 7-bit binary code used to represent 128 alphanumeric characters and control symbols.
- Used universally for transferring alphanumeric data between computers and I/O devices (like keyboards, printers, and monitors).
- Example: 'A' = 1000001_2 (41_{16}), 'a' = 1100001_2 (61_{16}).