ICT2632
Assignment 2
2025
, ICT2632 Assignment 2 - Complete Solutions
QUESTION 1 [40 Marks]
1.1 Convert Binary 10111₂ to Decimal (5 marks)
Solution: 10111₂ = 1×2⁴ + 0×2³ + 1×2² + 1×2¹ + 1×2⁰ = 1×16 + 0×8 + 1×4 + 1×2 + 1×1
= 16 + 0 + 4 + 2 + 1 = 23₁₀
1.2 Convert decimal 255₁₀ to Hexadecimal (5 marks)
Solution: Using repeated division by 16:
255 ÷ 16 = 15 remainder 15 (F in hex) 15 ÷ 16 = 0 remainder 15 (F in hex)
Reading remainders from bottom to top: FF₁₆
Verification: F×16¹ + F×16⁰ = 15×16 + 15×1 = 240 + 15 = 255₁₀ ✓
1.3 Determine the 2's complement of 10001₂ (4 marks)
Solution: Step 1: Find 1's complement (invert all bits) 10001₂ → 01110₂
Step 2: Add 1 to the 1's complement 01110₂
• 1₂
01111₂
Therefore, 2's complement = 01111₂
1.4 Perform the following additions: (5 marks)
(a) 345₈ + 227₈
345₈
Assignment 2
2025
, ICT2632 Assignment 2 - Complete Solutions
QUESTION 1 [40 Marks]
1.1 Convert Binary 10111₂ to Decimal (5 marks)
Solution: 10111₂ = 1×2⁴ + 0×2³ + 1×2² + 1×2¹ + 1×2⁰ = 1×16 + 0×8 + 1×4 + 1×2 + 1×1
= 16 + 0 + 4 + 2 + 1 = 23₁₀
1.2 Convert decimal 255₁₀ to Hexadecimal (5 marks)
Solution: Using repeated division by 16:
255 ÷ 16 = 15 remainder 15 (F in hex) 15 ÷ 16 = 0 remainder 15 (F in hex)
Reading remainders from bottom to top: FF₁₆
Verification: F×16¹ + F×16⁰ = 15×16 + 15×1 = 240 + 15 = 255₁₀ ✓
1.3 Determine the 2's complement of 10001₂ (4 marks)
Solution: Step 1: Find 1's complement (invert all bits) 10001₂ → 01110₂
Step 2: Add 1 to the 1's complement 01110₂
• 1₂
01111₂
Therefore, 2's complement = 01111₂
1.4 Perform the following additions: (5 marks)
(a) 345₈ + 227₈
345₈