Unit1 - Subjective Questions
ECE213 • Practice Questions with Detailed Answers
Differentiate between Analog and Digital Systems. List the advantages of Digital Systems.
Difference between Analog and Digital Systems:
| Feature | Analog System | Digital System |
|---|---|---|
| Signal Type | Continuous time-varying signals. | Discrete signals (0s and 1s). |
| Accuracy | Lower accuracy due to noise susceptibility. | Higher accuracy and precision. |
| Storage | Difficult to store data. | Easy to store data (Memories). |
| Examples | Human voice, Thermometer. | Computers, Digital Watches. |
Advantages of Digital Systems:
- Reliability: They are more reliable than analog systems.
- Programmability: Operations can be changed easily by changing the program.
- Noise Immunity: Digital circuits are less affected by noise.
- Storage: Information storage is easy and compact.
Explain the concept of Positional Number Systems. How is the value of a number determined in such a system?
A Positional Number System is a system where the value of a digit depends not only on the digit itself but also on its position within the number.
It is characterized by a Radix (or base) .
Determination of Value:
A number with base having digits is evaluated as:
Example:
For a decimal number :
Perform the following Base Conversions:
- to Decimal
- to Octal
- to Binary
1. to Decimal:
2. to Octal:
- with remainder 5
- with remainder 6
- with remainder 3
Reading remainders bottom-up:
3. to Binary:
Convert each hex digit to 4-bit binary:
Result:
Explain Gray Code. Why is it called a 'Reflected Code' or 'Unit Distance Code'? Convert to Gray code.
Gray Code:
Gray code is a non-weighted binary code where two successive values differ by only one bit.
Why it is called Unit Distance Code:
Because the Hamming distance between any two consecutive code words is exactly one (only one bit changes).
Conversion to Gray:
Let Binary bits be and Gray bits be .
- MSB is same:
Result:
Describe Signed Number Representation in binary systems. Differentiate between Sign-Magnitude, 1's Complement, and 2's Complement forms using the number (assume 4-bit register).
Signed numbers allow computers to represent both positive and negative integers.
1. Sign-Magnitude Representation:
- The MSB is the sign bit (0 for +, 1 for -). The remaining bits are magnitude.
2. 1's Complement Representation:
- Negative numbers are obtained by inverting all bits of the positive number.
- Invert bits:
3. 2's Complement Representation:
- Obtained by adding 1 to the 1's complement.
- 1's Comp of 5 = $1010$
- Add 1:
Note: 2's complement is preferred in arithmetic circuits as it eliminates the double zero problem (+0 and -0).
Perform the subtraction using 2's Complement method.
Operation: , where and .
This is equivalent to .
Step 1: Find 2's Complement of B (1100)
- 1's complement of
- Add 1:
- 2's Comp of
Step 2: Add A to 2's Comp of B
Step 3: Analyze Result
- There is no carry generated out of the MSB.
- This indicates the result is negative and is in its 2's complement form.
Step 4: Get final magnitude
- Take 2's complement of the result .
- 1's comp = $0001$
- Add 1 = $0010$ (which is 2 in decimal).
- Since result was negative: Result = or .
What are Binary Coded Decimal (BCD) codes? Explain BCD Addition with an example of summing and .
BCD (Binary Coded Decimal):
It is a way to represent decimal digits (0-9) using 4-bit binary sequences. It uses the weights 8-4-2-1. Codes $1010$ through $1111$ are invalid in BCD.
BCD Addition Rules:
- Perform binary addition.
- If the sum of a 4-bit group is , it is valid.
- If the sum OR if a carry is generated from the group, add (decimal 6) to correct it.
Example:
Step 1: Binary Add
Step 2: Correction
Since (9), add $0110$:
Step 3: Format
Split into 4-bit groups:
Result =
Explain Hamming Code for error detection and correction. Generate the 7-bit Hamming code for the data bits using odd parity.
Hamming Code:
A linear error-correcting code that can detect up to two-bit errors or correct one-bit errors. It places parity bits at positions that are powers of 2 ($1, 2, 4, 8...$).
Generating Code for Data $1010$ (Odd Parity):
Data bits: .
Format (7 bits): .
Bits: .
Calculate Parity Bits (Odd Parity implies total 1s must be odd):
- checks positions 1, 3, 5, 7:
- Bits: . Existing 1s = 2 (Even). To make odd, .
- checks positions 2, 3, 6, 7:
- Bits: . Existing 1s = 1 (Odd). To keep odd, .
- checks positions 4, 5, 6, 7:
- Bits: . Existing 1s = 2 (Even). To make odd, .
Final Code:
Result: $1001101$
Compare Fixed Point and Floating Point number representations. Explain the standard IEEE 754 Floating point format.
Comparison:
- Fixed Point: The decimal point is fixed. Limited range of numbers. Higher precision for small integers. Hardware implementation is simpler.
- Floating Point: The decimal point can 'float'. Can represent extremely large or small numbers (large dynamic range). More complex hardware.
IEEE 754 Floating Point (Single Precision - 32 bit):
It consists of three fields:
- Sign (S) - 1 bit: 0 for positive, 1 for negative.
- Exponent (E) - 8 bits: Represents the scale using Excess-127 notation (Biased exponent).
- Mantissa/Significand (M) - 23 bits: Represents the fractional part of the number (normalized).
Value formula:
Perform the following Octal and Hexadecimal Arithmetic operations:
1. Octal Addition:
- . In Octal: Sum 2, Carry 1.
- . In Octal: Sum 1, Carry 1.
- . In Octal: Sum 1, Carry 1.
- Final Carry 1 comes down.
- Result:
2. Hexadecimal Subtraction:
- (10 - 11): Cannot do. Borrow from 3. $3$ becomes $2$. becomes .
- . Hex for 15 is F.
- .
- Result:
What is Parity? Distinguish between Even and Odd Parity with examples. What are the limitations of parity checking?
Parity:
A parity bit is an extra bit added to a binary code to ensure that the total number of 1-bits in the string is even or odd. It is used for error detection.
Types:
- Even Parity: The total number of 1s (including the parity bit) must be even.
- Data: $1011$ (three 1s). Parity bit added: $1$ $11011$ (four 1s).
- Odd Parity: The total number of 1s must be odd.
- Data: $1011$ (three 1s). Parity bit added: $0$ $01011$ (three 1s).
Limitations:
- It can only detect single-bit errors (or odd number of errors).
- If two bits flip (e.g., and ), the parity remains valid, and the error goes undetected.
- It cannot correct errors, only detect them.
Explain the concept of Complements in digital systems. Calculate the 9's and 10's complement of the decimal number $456$.
Complements:
Complements are used in digital computers to simplify the subtraction operation and for logical manipulation. For a base- system, there are two types:
- Radix-minus-one Complement ('s complement).
- Radix Complement ('s complement).
Calculation for Decimal (Base 10):
Number , Digits .
1. 9's Complement ('s):
- Formula:
- Calculated by subtracting each digit from 9.
- 9's Comp = 543
2. 10's Complement ($10$'s):
- Formula: 9's Complement + 1
- 10's Comp = 544
What is the Excess-3 Code? Why is it known as a Self-Complementing Code? Provide an example.
Excess-3 Code:
It is a non-weighted BCD code obtained by adding 3 to the corresponding 8421 BCD code of a decimal digit.
Self-Complementing Property:
A code is self-complementing if the 9's complement of a decimal number can be obtained just by swapping 0s and 1s (1's complement) of the binary code.
Example:
- Decimal $2$ in Excess-3:
- 9's Complement of 2 is $7$.
- Take 1's complement of Excess-3(2) :
- Is $1010$ the Excess-3 code for 7?
- . Yes.
- Therefore, Excess-3 is self-complementing.
Classify Binary Codes. Differentiate between Weighted and Non-Weighted codes with examples.
Classification of Binary Codes:
- Weighted Codes: (e.g., 8421 BCD, 2421)
- Non-Weighted Codes: (e.g., Excess-3, Gray Code)
- Alphanumeric Codes: (e.g., ASCII, EBCDIC)
- Error Detection/Correction Codes: (e.g., Parity, Hamming)
Weighted vs Non-Weighted:
| Weighted Codes | Non-Weighted Codes |
|---|---|
| Each bit position is assigned a specific weight. | Bit positions do not have fixed weights. |
| The decimal value is the sum of weights of non-zero bits. | Value cannot be calculated by summing weights. |
| Example: 8421 BCD. . | Example: Excess-3. $1000$ represents 5, not 8. |
Demonstrate Binary Multiplication of .
Perform multiplication similar to decimal numbers.
Verification:
- Result .
Matches.
Explain the general method for converting a number from Radix to Decimal and from Decimal to Radix .
1. Radix to Decimal:
Use the Positional Weight Expansion method.
Multiply each digit by its weight , where is the position index (0 for LSB integer, -1 for first fractional digit), and sum them up.
2. Decimal to Radix :
Split into Integer and Fractional parts.
-
Integer Part (Successive Division):
- Divide the decimal integer by .
- Record the remainder.
- Divide the quotient by .
- Repeat until quotient is 0.
- Read remainders from bottom to top.
-
Fractional Part (Successive Multiplication):
- Multiply the fraction by .
- Record the integer part of the result.
- Take the fractional part for the next step.
- Repeat until fraction is 0 or desired precision is reached.
- Read recorded integers from top to bottom.
What is an Alphanumeric Code? Briefly explain ASCII and EBCDIC codes.
Alphanumeric Codes:
Codes that represent numbers, alphabetic characters (A-Z), and special symbols ( etc.). Used for data communication and IO.
1. ASCII (American Standard Code for Information Interchange):
- Most widely used standard.
- Typically 7-bit code (128 characters).
- Includes control characters (NULL, ACK) and printable characters.
- Example: 'A' is $65$ ($1000001$).
2. EBCDIC (Extended Binary Coded Decimal Interchange Code):
- 8-bit code (256 characters).
- Developed by IBM for mainframes.
- Different ordering than ASCII (e.g., letters are not contiguous blocks).
Perform the subtraction using 16's complement for .
Operation: where , .
Step 1: Find 16's Complement of N (971)
- 15's Comp:
- 16's Comp:
Step 2: Add M to 16's Comp of N
- Calculation check: . . .
Step 3: Check Carry
- A carry of 1 is generated.
- This indicates the result is positive.
- Discard the carry.
Result:
Calculate the 1's complement and 2's complement of the following 8-bit binary numbers:
- $00110101$
- $11001000$
1. Number: $00110101$
- 1's Complement: Invert all bits $11001010$
- 2's Complement: Add 1 to 1's Comp
2. Number: $11001000$
- 1's Complement: Invert all bits $00110111$
- 2's Complement: Add 1 to 1's Comp
Explain the concept of Data Representation in digital systems. How does the choice of base (Radix) impact data storage and human readability?
Data Representation:
It refers to the methods used to represent information (numbers, text, images, audio) inside a computer using binary signals (0s and 1s).
Impact of Radix:
- Binary (Base 2):
- Storage: Matches the ON/OFF nature of transistors. Most efficient for hardware implementation.
- Readability: Very poor for humans (long strings: $1101010...$).
- Decimal (Base 10):
- Readability: Natural for humans.
- Storage: Inefficient for digital hardware (requires conversion or complex BCD circuits).
- Hexadecimal (Base 16) & Octal (Base 8):
- Compromise: They act as shorthand for binary. One Hex digit represents 4 binary bits.
- Usage: Used by programmers to view memory addresses and data codes concisely.