Professional Documents
Culture Documents
DLD Assignment - Docx - 20240330 - 215548 - 0000
DLD Assignment - Docx - 20240330 - 215548 - 0000
Asad Raza
Roll No. : 63
BS Computer Science
* **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.
* **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:
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).
- 1 * 2^0 = 1
- 1 * 2^1 = 2
- 0 * 2^2 = 0
- 0 * 2^3 = 0
- 1 * 2^4 = 16
- 1 * 2^5 = 32
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
**3. 1000001.111**
* 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
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:
| 11 * 10 | 110 |
| 101 * 11 | 1111 |
O 110 , 11
O 1010 , 10
O 1111 , 101
Ans:
1111/101=11 (quotient),0(remainder)
Ans: In 1’s complement notation, there are two ways to represent zero:
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. 11001
1. 11001100
1. 11000111
O (17)8
O (26)8
O (145)8
O (456)8
**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:
**2. (26)8**
**3. (145)8**
**4. (456)8**
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)