Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Assignment:

Digital Logic Design

Asad Raza

Roll No. : 63

BS Computer Science

Submission date : 30/03/2024

Name two advantages of digital data as compared to analog data.

Ans: ## Digital Data Advantages

* **Storage and access:** Digital data can be stored very compactly and accessed much faster than physical media. This
allows for huge amounts of information to be readily available for searching, sorting, and analysis.

* **Manipulation and analysis:** Digital data can be easily copied, edited, and analyzed by computers. This allows for
powerful tools to be used to find patterns, trends, and insights that might not be obvious from looking at raw data.

Analog Data Advantages

* **Simplicity:** Analog data is often easier to understand and use without any specialized equipment. For example, it’s
simpler to adjust the volume on a knob than through a digital menu.

* **Direct representation:** Analog data can sometimes be a more direct representation of the real world. For instance,
an analog clock hand continuously reflects the passage of time, whereas a digital clock displays fixed digits that update at
intervals.

2. Define the sequence of bits (1s and 0s) represented by each of the following sequences of Levels:

O HIGH, HIGH, LOW, LOW, LOW, LOW, HIGH, HIGH

O HIGH, LOW, HIGH, LOW, HIGH, LOW, HIGH, LOW

Ans: - HIGH, HIGH, LOW, LOW, LOW, LOW, HIGH, HIGH = 11000011

HIGH, LOW, HIGH, LOW, HIGH, LOW = 101010 (binary sequence incomplete due to missing levels)
1. Convert each binary number to decimal:

O 110011.11

O 101010.01

O 1000001.111

Ans:

**1. 110011.11**
- Split the binary number into two parts: the integer part (110011) and the fractional part (.11).

* Multiply each digit by its corresponding power of 2:

- 1 * 2^0 = 1

- 1 * 2^1 = 2

- 0 * 2^2 = 0

- 0 * 2^3 = 0

- 1 * 2^4 = 16

- 1 * 2^5 = 32

* Add the products together: 1 + 2 + 0 + 0 + 16 + 32 = 51

2^-1 + 1 * 2^-2 = 0.5 + 0.25 = 0.75

51 + 0.75 = 51.75

**2. 101010.01**

* Convert the integer part (101010) to decimal: 1 * 2^0 + 0 * 2^1 + 1 * 2^2 + 0 * 2^3 + 1 * 2^4 + 0 * 2^5 = 1 + 0 + 4 + 0 + 16 + 0
= 21

* Convert the fractional part (.01) to decimal: 0 * 2^-1 + 1 * 2^-2 = 0 + 0.25 = 0.25

* Combine the parts: 21 + 0.25 = 42.25

**3. 1000001.111**

- Repeat the process:

* Integer part (1000001): 1 * 2^0 + 0 * 2^1 + 0 * 2^2 + 0 * 2^3 + 0 * 2^4 + 1 * 2^5 + 1 * 2^6 = 1 + 0 + 0 + 0 + 0 + 32 + 64 = 97

* Fractional part (.111): 1 * 2^-1 + 1 * 2^-2 + 1 * 2^-3 = 0.5 + 0.25 + 0.125 = 0.875

* Combine the parts: 97 + 0.875 = 65.875.

4. Use direct subtraction on the following binary numbers:

O 10 – 1

O 100 – 11

O 110 – 100

Ans:

1. 10 – 1= 01
2. 100 – 11= 11
3. 110 – 100 = 10
1. Perform the following binary multiplications:

O 11 * 10

O 101 * 11

O 111 * 110

Ans:

| Binary Numbers | Product (Binary) |

| 11 * 10 | 110 |

| 101 * 11 | 1111 |

| 111 * 110 | 101010 |

1. Divide the binary numbers as indicated:

O 110 , 11

O 1010 , 10

O 1111 , 101

Ans:

110/11 =10 ( quotient),0(remainder)

1010/10 =101 (quotient),0(remainder)

1111/101=11 (quotient),0(remainder)

1. What are two ways of representing zero in 1’s complement form?

Ans: In 1’s complement notation, there are two ways to represent zero:

1. **All 0s (e.g., 0000)**: This represents positive zero (+0).

1. **All 1s (e.g., 1111)**: This might seem counterintuitive, but in 1’s complement, it represents the negation of positive
zero, which is considered negative zero (-0). However, since both positive and negative zero have the same value
(zero), these two representations end up indicating the same thing.
1. Determine the 2’s complement of each binary number using either method:

O 101010

o 11001

O 11001100

O 11000111

Ans:

1. 101010 :

1’s complement = 010101

2’s complement = 010101 + 1 = (010110)

1. 11001

1’s complement = 00110

2’s complement = 00110 +1 = 00111

1. 11001100

1’s complement = 00110011

2’s complement = 00110011 +1 = 00110100

1. 11000111

1’s complement = 0011100

2’s complement = 0011100 + 1 = 0011101

1. Convert each octal number into binary:

O (17)8

O (26)8

O (145)8

O (456)8

Ans: Absolutely, let’s convert each octal number to binary:

**1. (17)8**

In octal, each digit represents a base-8 value. We can convert each octal digit to its corresponding 3-bit binary equivalent:

1 (octal) = 001 (binary)

7 (octal) = 111 (binary)


So, (17)8 in binary is **001111**.

**2. (26)8**

2 (octal) = 010 (binary)

6 (octal) = 110 (binary)

Therefore, (26)8 in binary is **010110**.

**3. (145)8**

1 (octal) = 001 (binary)

4 (octal) = 100 (binary)

5 (octal) = 101 (binary)

(145)8 in binary is **001100101**.

**4. (456)8**

4 (octal) = 100 (binary)

5 (octal) = 101 (binary)

6 (octal) = 110 (binary)

(456)8 in binary is **100101110**.

10. Convert each pair of decimal numbers to BCD, and add as indicated:

O 28 + 23

O 65 + 58

O 113 + 101

O 295 + 157
Ans :-28+23010100 + 001011100111 (in BCD)

-65+5801100101 + 0101100011011101 (in BCD)

-113+101 00010001 + 0000010100110110 (in BCD)

-295+157=00101001 + 0001010101011110 (in BCD

You might also like