Digital Logic Fundamentals · Lecture 1
30 Practice Problems: Conversions & Arithmetic
30 مسألة تدريبية: التحويلات والحساب الثنائي
Interactive Solutions Binary Arithmetic Number Conversions Complements & Codes
ACADEZI
www.acadezi.com
Step-By-Step Guide · حل بالخطوات
Q1
What is the highest decimal number that can be represented by 8 binary digits?
أكبر رقم عشري يمكن تمثيله بـ n من الخانات الثنائية يُحسب بالمعادلة (2n - 1).
Formula: 2n - 1 Here, n = 8. Value = 28 - 1 Value = 256 - 1 = 255
Answer: 255
Q2
State the primary difference between Analog and Digital quantities.
الكميات التناظرية تتغير بشكل مستمر، بينما الكميات الرقمية تتغير في خطوات متقطعة.
Analog quantities vary over a continuous range of values. Digital quantities are represented by symbols (digits) and change in discrete steps.
Answer: Analog = Continuous, Digital = Discrete
Q3
Convert the binary number 10101102 to decimal.
نضرب كل بت في وزنه المطابق لقوى العدد 2 ثم نجمع:
Weights: 26 25 24 23 22 21 20 Binary: 1 0 1 0 1 1 0 Value = 26 + 24 + 22 + 21 = 64 + 16 + 4 + 2 = 86
Answer: 8610
Q4
Convert the fractional binary number 0.11012 to decimal.
بالنسبة للكسور، نستخدم الأسس السالبة للرقم 2:
Weights: 2-1 2-2 2-3 2-4 Binary: 0. 1 1 0 1 Value = 2-1 + 2-2 + 2-4 = 0.5 + 0.25 + 0.0625 = 0.8125
Answer: 0.812510
Q5
Convert the binary number 111000.012 to decimal.
نجمع قيم الجزء الصحيح والجزء الكسري كلٌ على حدة:
Integer part: 1110002 = 25 + 24 + 23 = 32 + 16 + 8 = 56 Fractional part: 0.012 = 2-2 = 0.25 Total = 56 + 0.25 = 56.25
Answer: 56.2510
Q6
Convert decimal 14510 into binary using repeated division by 2.
نقسم العدد تباعاً على 2 ونسجل الباقي، ثم نقرأ البواقي من الأسفل للأعلى.
145 / 2 = 72 Remainder: 1 (LSB) 72 / 2 = 36 Remainder: 0 36 / 2 = 18 Remainder: 0 18 / 2 = 9 Remainder: 0 9 / 2 = 4 Remainder: 1 4 / 2 = 2 Remainder: 0 2 / 2 = 1 Remainder: 0 1 / 2 = 0 Remainder: 1 (MSB)
Answer: 100100012
Q7
Convert decimal 0.62510 into binary.
نضرب الكسر العشري تباعاً في 2، ونسجل العدد الصحيح الناتج كبت للكسر الثنائي.
0.625 × 2 = 1.25 → Integer: 1 (MSB) 0.250 × 2 = 0.50 → Integer: 0 0.500 × 2 = 1.00 → Integer: 1 (LSB) Stop since fractional part is now 0.
Answer: 0.1012
Q8
Convert decimal 5710 into binary using the sum of weights method.
نبحث عن قوى العدد 2 التي مجموعها يعطي الرقم 57:
Powers of 2: 32, 16, 8, 4, 2, 1 57 = 32 + 25 25 = 16 + 9 9 = 8 + 1 So, 57 = 32 + 16 + 8 + 1 Binary: 25 (1), 24 (1), 23 (1), 22 (0), 21 (0), 20 (1)
Answer: 1110012
Q9
Convert the hexadecimal number 4A716 to decimal.
نضرب كل رقم في القوة المناسبة للأساس 16 (علماً بأن A = 10):
4A716 = (4 × 162) + (10 × 161) + (7 × 160) = (4 × 256) + (10 × 16) + (7 × 1) = 1024 + 160 + 7 = 1191
Answer: 119110
Q10
Convert the hexadecimal number F3C16 to binary.
نحول كل رقم سداسي عشري مباشرة إلى ما يعادله بـ 4 بتات في الثنائي:
F (15) → 1111 3 → 0011 C (12) → 1100 Combine them directly.
Answer: 1111001111002
Q11
Convert binary 11011010100112 to hexadecimal.
نقسم العدد إلى مجموعات من 4 بتات من اليمين، ونضيف أصفاراً في اليسار إن لزم:
Group by 4 bits from right to left: 0001 | 1011 | 0101 | 0011 1 | B | 5 | 3
Answer: 1B5316
Q12
Convert decimal 345010 into hexadecimal.
نقسم تباعاً على 16 ونسجل البواقي ونحول ما فوق 9 لأحرف.
3450 / 16 = 215 Remainder: 10 → A (LSD) 215 / 16 = 13 Remainder: 7 → 7 13 / 16 = 0 Remainder: 13 → D (MSD) Read from bottom to top.
Answer: D7A16
Q13
Convert octal 3458 into decimal.
نضرب كل رقم في القوة المطابقة للأساس 8:
3458 = (3 × 82) + (4 × 81) + (5 × 80) = (3 × 64) + (4 × 8) + (5 × 1) = 192 + 32 + 5 = 229
Answer: 22910
Q14
Convert octal 7028 into binary.
نحول كل رقم ثماني بشكل مستقل إلى 3 بتات ثنائية:
7 → 111 0 → 000 2 → 010 Combine them.
Answer: 1110000102
Q15
Convert binary 101110102 into octal.
نقسم العدد الثنائي إلى مجموعات من 3 بتات من اليمين، ونضيف أصفاراً في اليسار إن لزم:
Group by 3 bits: 010 | 111 | 010 2 | 7 | 2
Answer: 2728
Q16
Convert decimal 123410 into octal.
نقسم العدد العشري تباعاً على 8 ونسجل البواقي:
1234 / 8 = 154 Remainder: 2 (LSD) 154 / 8 = 19 Remainder: 2 19 / 8 = 2 Remainder: 3 2 / 8 = 0 Remainder: 2 (MSD) Read remainders bottom to top.
Answer: 23228
Q17
Convert decimal 49210 into BCD.
نحول كل رقم عشري بشكل مباشر ومستقل إلى 4 بتات:
4 → 0100 9 → 1001 2 → 0010 Combine them sequentially.
Answer: 0100 1001 0010BCD
Q18
Convert BCD 100001110011 into decimal.
نقسم سلسلة BCD إلى مجموعات من 4 بتات ونترجم كل مجموعة للرقم العشري المقابل:
Group by 4 bits: 1000 | 0111 | 0011 8 | 7 | 3
Answer: 87310
Q19
Convert binary 10112 to Gray code.
ننسخ البت الأول، ثم نقارن كل بت مع الذي يليه؛ إذا تشابها فالناتج 0، وإذا اختلفا فالناتج 1:
Binary: 1 0 1 1 | /| /| /| Gray: 1 (1^0=1) (0^1=1) (1^1=0) Result: 1 1 1 0
Answer: 1110Gray
Q20
Why is the Gray code used in digital systems?
لتقليل فرصة الخطأ، حيث يتغير بت واحد فقط بين أي رقمين متتاليين.
In Gray code, only ONE bit ever changes between two successive numbers in the sequence. This reduces the likelihood of a digital circuit misinterpreting a changing input compared to pure binary where multiple bits might change at once (like 011 to 100).
Answer: Reduces errors during state changes.
Q21
Perform binary addition: 10110 + 11011
نجمع الخانات الثنائية مع مراعاة الحمل (Carry) في كل عمود:
1 0 1 1 0 (22 in dec) + 1 1 0 1 1 (27 in dec) ----------- 1 1 0 0 0 1 (0+1=1, 1+1=0 c1, 1+0+c1=0 c1, 0+1+c1=0 c1, 1+1+c1=11)
Answer: 1100012
Q22
Perform fractional binary addition: 111.11 + 10.10
نقوم بمحاذاة العلامة العشرية ثم نجمع بشكل طبيعي مع الحمل (Carry):
1 1 1 . 1 1 (7.75) + 0 1 0 . 1 0 (2.50) ------------- 1 0 1 0 . 0 1 (10.25)
Answer: 1010.012
Q23
Perform binary subtraction: 10100 – 01101
نطرح الخانات مع مراعاة الاستلاف (Borrow) من الخانة المجاورة:
1 0 1 0 0 (20 in dec) - 0 1 1 0 1 (13 in dec) ----------- 0 0 1 1 1 (7 in dec)
Answer: 001112
Q24
Perform binary subtraction: 110010 – 10011
نطرح مع الاستلاف (Borrow) عند الحاجة:
1 1 0 0 1 0 (50 in dec) - 0 1 0 0 1 1 (19 in dec) ------------- 0 1 1 1 1 1 (31 in dec)
Answer: 0111112
Q25
Perform binary multiplication: 1011 x 110
نضرب كما في الضرب العشري المعتاد؛ إما أصفار أو ننزل الرقم نفسه مع الإزاحة:
1 0 1 1 (11 in dec) x 1 1 0 (6 in dec) --------- 0 0 0 0 (1011 × 0) 1 0 1 1 (1011 × 1) 1 0 1 1 (1011 × 1) ------------- 1 0 0 0 0 1 0 (66 in dec)
Answer: 10000102
Q26
Perform binary multiplication: 111 x 101
نضرب الأرقام ثنائياً، ونجمع النواتج الجزئية (Partial products):
1 1 1 (7 in dec) x 1 0 1 (5 in dec) ------- 1 1 1 (111 × 1) 0 0 0 (111 × 0) 1 1 1 (111 × 1) --------- 1 0 0 0 1 1 (35 in dec)
Answer: 1000112
Q27
Determine the 1’s complement of binary 10110100.
لإيجاد المكمل الأول، نقوم ببساطة بعكس كل بت (نغير 1 إلى 0 و 0 إلى 1):
Original Binary: 1 0 1 1 0 1 0 0 1's Complement: 0 1 0 0 1 0 1 1
Answer: 01001011
Q28
Determine the 2’s complement of binary 11011000.
لإيجاد المكمل الثاني، نوجد المكمل الأول أولاً ثم نجمع 1 على البت الأقل أهمية (LSB):
Original Binary: 1 1 0 1 1 0 0 0 1's Complement: 0 0 1 0 0 1 1 1 Add 1: + 1 --------------- 2's Complement: 0 0 1 0 1 0 0 0
Answer: 00101000
Q29
Determine the 2’s complement of binary 01100111.
نعكس البتات، ثم نجمع الرقم 1.
Original Binary: 0 1 1 0 0 1 1 1 1's Complement: 1 0 0 1 1 0 0 0 Add 1: + 1 --------------- 2's Complement: 1 0 0 1 1 0 0 1
Answer: 10011001
Q30
What is the advantage of using Complements in digital systems?
تُستخدم المكملات لتسهيل تمثيل الأرقام السالبة، وتسمح بإجراء عمليات الطرح باستخدام دوائر الجمع فقط.
Complements are used in digital systems to easily represent negative numbers and to perform subtraction operations using only Addition circuits (Adder logic gates).
Answer: Simplifies subtraction using addition logic.