Binary Arithmetic เลขคณิตฐานสอง

Add, subtract, multiply, and divide using only 0 and 1 บวก ลบ คูณ และหาร โดยใช้แค่ 0 และ 1

A processor does its arithmetic on binary values. The column method is exactly the one you use in denary (base 10) — work one column at a time from the right, and carry or borrow when a column overflows — but only the digits 0 and 1 are allowed. This lesson works through addition, subtraction, multiplication, and division one step at a time, then checks each answer in denary.

โปรเซสเซอร์คำนวณด้วยค่าฐานสอง วิธีคิดทีละหลักเหมือนกับที่เราใช้ในฐานสิบ (base 10) ทุกประการ — คิดทีละหลักจากขวาไปซ้าย และ “ทด” หรือ “ยืม” เมื่อหลักนั้นเกิน — ต่างกันแค่ใช้ได้เพียงหลัก 0 และ 1 บทนี้จะทำ การบวก การลบ การคูณ และ การหาร ทีละขั้น แล้วตรวจคำตอบด้วยเลขฐานสิบ

Every worked example below uses the same three denary values — 13, 11, 6, 5 — so you can compare the operations.

ตัวอย่างทุกข้อด้านล่างใช้ค่าฐานสิบชุดเดียวกัน — 13, 11, 6, 5 — เพื่อให้เทียบการดำเนินการต่าง ๆ ได้ง่าย

1. Binary addition 1. การบวกฐานสอง

There are only four single-bit sums. When the total reaches 2 it does not fit in one binary digit, so you write 0 and carry 1 to the next column on the left — the same idea as carrying in denary when a column reaches 10.

การบวกทีละบิตมีแค่ 4 กรณี เมื่อผลรวมถึง 2 จะใส่ในหลักเดียวไม่พอ จึงเขียน 0 แล้ว ทด 1 ไปหลักถัดไปทางซ้าย — แนวคิดเดียวกับการทดในฐานสิบ เมื่อหลักหนึ่งถึง 10

Column sum ผลบวกในหลัก Result ผลลัพธ์ Write / carry เขียน / ทด
0 + 00write 0เขียน 0
0 + 11write 1เขียน 1
1 + 110write 0, carry 1เขียน 0 ทด 1
1 + 1 + 111write 1, carry 1เขียน 1 ทด 1

Worked example: 1101 + 1011 (denary 13 + 11). Each column is one step, right to left; the top row is the carry into that column. ตัวอย่างที่ทำทีละขั้น: 1101 + 1011 (ฐานสิบ 13 + 11) แต่ละหลักคือหนึ่งขั้น จากขวาไปซ้าย แถวบนสุดคือค่าที่ทดเข้ามาในหลักนั้น

Place valueค่าประจำหลัก \(2^4\)\(2^3\)\(2^2\)\(2^1\)\(2^0\)
Carryตัวทด 1101–
First number (13)ตัวตั้ง (13)  1101
Second number (11)ตัวบวก (11)  1011
Sumผลบวก 11000
  • Column \(2^0\): 1 + 1 = 10 → write 0, carry 1.หลัก \(2^0\): 1 + 1 = 10 → เขียน 0 ทด 1
  • Column \(2^1\): 0 + 1 + 1 (carry) = 10 → write 0, carry 1.หลัก \(2^1\): 0 + 1 + 1 (ตัวทด) = 10 → เขียน 0 ทด 1
  • Column \(2^2\): 1 + 0 + 1 (carry) = 10 → write 0, carry 1.หลัก \(2^2\): 1 + 0 + 1 (ตัวทด) = 10 → เขียน 0 ทด 1
  • Column \(2^3\): 1 + 1 + 1 (carry) = 11 → write 1, carry 1.หลัก \(2^3\): 1 + 1 + 1 (ตัวทด) = 11 → เขียน 1 ทด 1
  • Column \(2^4\): the final carry 1 becomes the leftmost digit.หลัก \(2^4\): ตัวทดสุดท้าย 1 กลายเป็นหลักซ้ายสุด

Result: 1101 + 1011 = 11000. Check in denary: \(13 + 11 = 24\), and \(11000_2 = 16 + 8 = 24\). ✓ ผลลัพธ์: 1101 + 1011 = 11000 ตรวจด้วยฐานสิบ: \(13 + 11 = 24\) และ \(11000_2 = 16 + 8 = 24\) ✓

2. Binary subtraction (borrow method) 2. การลบฐานสอง (วิธียืม)

Subtract column by column. Three cases are easy: 0 - 0 = 0, 1 - 0 = 1, 1 - 1 = 0. The fourth, 0 - 1, cannot be done directly — borrow 1 from the next column on the left. The borrowed 1 is worth 2 in this column, so the column becomes 10 - 1 = 1, and the left column loses 1. Same idea as borrowing in denary.

ลบทีละหลัก สามกรณีง่าย: 0 - 0 = 0, 1 - 0 = 1, 1 - 1 = 0 ส่วนกรณีที่สี่ 0 - 1 ทำตรง ๆ ไม่ได้ ต้อง ยืม 1 จากหลักถัดไปทางซ้าย ตัว 1 ที่ยืมมามีค่าเท่ากับ 2 ในหลักนี้ หลักนี้จึงกลายเป็น 10 - 1 = 1 และหลักซ้ายถูกหักออก 1 แนวคิดเดียวกับการยืมในฐานสิบ

Worked example: 1011 − 0101 (denary 11 − 5). The top row shows where a borrow happens. ตัวอย่างที่ทำทีละขั้น: 1011 − 0101 (ฐานสิบ 11 − 5) แถวบนสุดแสดงว่าหลักใดต้องยืม

Place valueค่าประจำหลัก \(2^3\)\(2^2\)\(2^1\)\(2^0\)
Borrowการยืม  −1  
First number (11)ตัวตั้ง (11) 1011
Second number (5)ตัวลบ (5) 0101
Differenceผลต่าง 0110
  • Column \(2^0\): 1 - 1 = 0.หลัก \(2^0\): 1 - 1 = 0
  • Column \(2^1\): 1 - 0 = 1.หลัก \(2^1\): 1 - 0 = 1
  • Column \(2^2\): 0 - 1 → borrow from \(2^3\). Column becomes 10 - 1 = 1.หลัก \(2^2\): 0 - 1 → ยืมจากหลัก \(2^3\) หลักนี้กลายเป็น 10 - 1 = 1
  • Column \(2^3\): the 1 was reduced to 0 by the borrow, so 0 - 0 = 0.หลัก \(2^3\): เลข 1 ถูกลดเป็น 0 เพราะการยืม จึงเป็น 0 - 0 = 0

Result: 1011 − 0101 = 0110. Check: \(11 - 5 = 6\), and \(0110_2 = 4 + 2 = 6\). ✓ ผลลัพธ์: 1011 − 0101 = 0110 ตรวจ: \(11 - 5 = 6\) และ \(0110_2 = 4 + 2 = 6\) ✓

Note: subtraction by adding the two's complement หมายเหตุ: การลบด้วยการบวกทูส์คอมพลีเมนต์

Processors usually do not build a separate “borrow” circuit. Instead they compute a − b as a + (−b), where −b is the two's complement of b (invert every bit, then add 1 — see the previous lesson). The single carry-out of the top column is discarded.

โปรเซสเซอร์มักไม่สร้างวงจร “ยืม” แยกต่างหาก แต่คำนวณ a − b เป็น a + (−b) โดย −b คือ ทูส์คอมพลีเมนต์ ของ b (กลับทุกบิตแล้วบวก 1 — ดูบทก่อนหน้า) ตัวทดออกจากหลักบนสุดจะถูกทิ้งไป

Same example in 4 bits: \(11 - 5\). ตัวอย่างเดิมในระบบ 4 บิต: \(11 - 5\)

Stepขั้น Bits (4-bit)บิต (4 บิต)
+5+50101
Invert every bitกลับทุกบิต1010
Add 1 → −5บวก 1 → −51011
11 + −5 = 1011 + 101111 + −5 = 1011 + 10111 0110
Drop the carry-out → keep 4 bitsทิ้งตัวทดออก → เก็บ 4 บิต0110 = 6

Same answer as the borrow method: 0110 = 6. ได้คำตอบเดียวกับวิธียืม: 0110 = 6

3. Binary multiplication (shift-and-add) 3. การคูณฐานสอง (shift-and-add)

Long multiplication is simple in binary because each digit of the multiplier is only 0 or 1:

การคูณแบบตั้งหารทำได้ง่ายในฐานสอง เพราะแต่ละหลักของตัวคูณเป็นได้แค่ 0 หรือ 1

  • Multiplier bit 0 → partial product is all zeros.บิตตัวคูณเป็น 0 → ผลคูณย่อยเป็นศูนย์ทั้งหมด
  • Multiplier bit 1 → partial product is a copy of the multiplicand.บิตตัวคูณเป็น 1 → ผลคูณย่อยคือ สำเนาของตัวตั้ง
  • Each partial product is shifted left by the position of its bit, then all are added.ผลคูณย่อยแต่ละตัวถูก เลื่อนซ้าย ตามตำแหน่งของบิตนั้น แล้วนำมาบวกกันทั้งหมด

Worked example: 110 × 101 (denary 6 × 5). ตัวอย่างที่ทำทีละขั้น: 110 × 101 (ฐานสิบ 6 × 5)

Stepขั้น \(2^4\)\(2^3\)\(2^2\)\(2^1\)\(2^0\)
Bit \(2^0\) of 101 is 1 → copy 110บิต \(2^0\) ของ 101 เป็น 1 → สำเนา 110   110
Bit \(2^1\) of 101 is 0 → zeros, shift 1บิต \(2^1\) ของ 101 เป็น 0 → ศูนย์ เลื่อน 1  000 
Bit \(2^2\) of 101 is 1 → copy 110, shift 2บิต \(2^2\) ของ 101 เป็น 1 → สำเนา 110 เลื่อน 2 110  
Add the partial productsบวกผลคูณย่อยทั้งหมด 11110

Result: 110 × 101 = 11110. Check: \(6 \times 5 = 30\), and \(11110_2 = 16 + 8 + 4 + 2 = 30\). ✓ ผลลัพธ์: 110 × 101 = 11110 ตรวจ: \(6 \times 5 = 30\) และ \(11110_2 = 16 + 8 + 4 + 2 = 30\) ✓

Shortcut: multiplying by \(2^k\) just appends \(k\) zeros (a left shift). For example 110 × 10 = 1100 (\(6 \times 2 = 12\)). ทางลัด: การคูณด้วย \(2^k\) คือการเติม 0 ต่อท้าย \(k\) ตัว (เลื่อนซ้าย) เช่น 110 × 10 = 1100 (\(6 \times 2 = 12\))

4. Binary division 4. การหารฐานสอง

There are two ways to divide, used for different jobs:

การหารมี 2 วิธี ใช้กับงานคนละแบบ:

  • Long division — works for any divisor. Gives a quotient and a remainder. This is what a general divide instruction (or // and % in code) does. การตั้งหาร — ใช้ได้กับตัวหารทุกค่า ได้ ผลหาร และ เศษ เป็นสิ่งที่คำสั่งหารทั่วไป (หรือ // และ % ในโค้ด) ทำ
  • Right shift — only for dividing by a power of two, \(2^k\). Drop the rightmost \(k\) bits; those dropped bits are the remainder. Very fast, so hardware and compilers use it whenever the divisor is \(2, 4, 8, \dots\) การเลื่อนขวา — ใช้ได้เฉพาะการหารด้วยเลขยกกำลังสอง \(2^k\) ตัดบิตขวาสุดออก \(k\) ตัว บิตที่ตัดออกคือเศษ ทำได้เร็วมาก ฮาร์ดแวร์และคอมไพเลอร์จึงใช้วิธีนี้เมื่อตัวหารเป็น \(2, 4, 8, \dots\)

4a. Long division — any divisor 4a. การตั้งหาร — ตัวหารใด ๆ

Same routine as denary long division, but every “does it fit?” check has only two answers. Bring bits of the dividend down one at a time into a running value; if the running value is ≥ the divisor, the next quotient bit is 1 and you subtract the divisor; otherwise the quotient bit is 0.

ขั้นตอนเหมือนการตั้งหารฐานสิบ แต่การถามว่า “หารลงตัวไหม” มีคำตอบแค่สองแบบ ดึงบิตของตัวตั้งลงมาทีละบิตเป็นค่าที่กำลังคิดอยู่ ถ้าค่านั้น ≥ ตัวหาร บิตผลหารถัดไปเป็น 1 แล้วลบตัวหารออก มิฉะนั้นบิตผลหารเป็น 0

Worked example: 11110 ÷ 101 (denary 30 ÷ 5). ตัวอย่างที่ทำทีละขั้น: 11110 ÷ 101 (ฐานสิบ 30 ÷ 5)

Bit brought downบิตที่ดึงลงมา Running valueค่าที่กำลังคิด ≥ 101 (5)?≥ 101 (5) ไหม? Quotient bitบิตผลหาร After subtractingหลังลบ
11 (1)noไม่01 (1)
111 (3)noไม่011 (3)
1111 (7)yesใช่1111 − 101 = 10 (2)
1101 (5)yesใช่1101 − 101 = 0 (0)
00 (0)noไม่00 (0)

Result: quotient 00110 = 110, remainder 0. Check: \(30 \div 5 = 6\), and \(110_2 = 6\). ✓ (This is the multiplication example run backwards.) ผลลัพธ์: ผลหาร 00110 = 110 เศษ 0 ตรวจ: \(30 \div 5 = 6\) และ \(110_2 = 6\) ✓ (เป็นตัวอย่างการคูณที่ทำย้อนกลับ)

Second example with a remainder: 1011 ÷ 10 (denary 11 ÷ 2). ตัวอย่างที่สองที่มีเศษ: 1011 ÷ 10 (ฐานสิบ 11 ÷ 2)

Bit brought downบิตที่ดึงลงมา Running valueค่าที่กำลังคิด ≥ 10 (2)?≥ 10 (2) ไหม? Quotient bitบิตผลหาร After subtractingหลังลบ
11 (1)noไม่01 (1)
010 (2)yesใช่110 − 10 = 0 (0)
11 (1)noไม่01 (1)
111 (3)yesใช่111 − 10 = 1 (1)

Result: quotient 0101 = 101, remainder 1. Check: \(11 \div 2 = 5\) remainder \(1\). ✓ ผลลัพธ์: ผลหาร 0101 = 101 เศษ 1 ตรวจ: \(11 \div 2 = 5\) เศษ \(1\) ✓

4b. Right shift — dividing by a power of two 4b. การเลื่อนขวา — หารด้วยเลขยกกำลังสอง

Dividing by \(2^k\) means throwing away the rightmost \(k\) bits. The bits you throw away are the remainder; what is left is the quotient. It is the mirror image of the multiplication shortcut (append zeros to multiply, drop digits to divide).

การหารด้วย \(2^k\) คือการตัดบิตขวาสุดทิ้ง \(k\) ตัว บิตที่ตัดทิ้งคือเศษ ส่วนที่เหลือคือผลหาร เป็นภาพสะท้อนของทางลัดการคูณ (เติมศูนย์เพื่อคูณ ตัดหลักออกเพื่อหาร)

Worked example: 1011 (denary 11) divided by 10 (\(2^1\)) and by 100 (\(2^2\)). ตัวอย่างที่ทำทีละขั้น: 1011 (ฐานสิบ 11) หารด้วย 10 (\(2^1\)) และด้วย 100 (\(2^2\))

Divide byหารด้วย Dropตัดออก Quotient (bits kept)ผลหาร (บิตที่เหลือ) Remainder (bits dropped)เศษ (บิตที่ตัดออก) Denary checkตรวจฐานสิบ
10 (\(2^1\)) last 1 bitบิตท้าย 1 ตัว 101 (5) 1 (1) \(11 = 5 \times 2 + 1\)
100 (\(2^2\)) last 2 bitsบิตท้าย 2 ตัว 10 (2) 11 (3) \(11 = 2 \times 4 + 3\)

The 10 row matches the long-division example above — same quotient 101 and remainder 1, but found by inspection instead of five steps. แถว 10 ตรงกับตัวอย่างการตั้งหารด้านบน — ผลหาร 101 และเศษ 1 เท่ากัน แต่ได้จากการดูเฉย ๆ แทนที่จะทำห้าขั้น

Check your work with Python ตรวจคำตอบด้วย Python

The by-hand methods above are the point of this lesson. These demos just confirm the same answers. bin(x) shows a value in binary with a 0b prefix, // is integer division (the quotient), and % is the remainder.

วิธีทำด้วยมือด้านบนคือหัวใจของบทนี้ ตัวอย่างด้านล่างไว้ยืนยันคำตอบเดียวกัน bin(x) แสดงค่าเป็นฐานสองโดยขึ้นต้นด้วย 0b, // คือการหารเอาผลหาร (จำนวนเต็ม) และ % คือเศษ

1 Addition: 1101 + 1011 1 การบวก: 1101 + 1011

Denary 13 + 11. The result 11000 is 0b11000, i.e. 24.

ฐานสิบ 13 + 11 ผลลัพธ์ 11000 คือ 0b11000 หรือ 24

[1]
[output]
0b11000
24

2 Subtraction: 1011 − 0101 2 การลบ: 1011 − 0101

Denary 11 − 5. The borrow-method result 0110 is 0b110, i.e. 6.

ฐานสิบ 11 − 5 ผลลัพธ์จากวิธียืม 0110 คือ 0b110 หรือ 6

[2]
[output]
0b110
6

3 Subtraction by adding the two's complement 3 การลบด้วยการบวกทูส์คอมพลีเมนต์

(2 ** 4) - 5 is the two's complement of 5 in 4 bits (1011). Add it to 11, then % (2 ** 4) keeps just 4 bits (drops the carry-out). The answer matches demo 2: 6.

(2 ** 4) - 5 คือทูส์คอมพลีเมนต์ของ 5 ในระบบ 4 บิต (1011) นำไปบวกกับ 11 แล้ว % (2 ** 4) เก็บไว้แค่ 4 บิต (ตัดตัวทดออกทิ้ง) คำตอบตรงกับตัวอย่างที่ 2: 6

[3]
[output]
0b1011
22
6

4 Multiplication: 110 × 101 4 การคูณ: 110 × 101

Denary 6 × 5. The shift-and-add result 11110 is 0b11110, i.e. 30. Multiplying by 10 (2) just shifts left: 1100 = 12.

ฐานสิบ 6 × 5 ผลลัพธ์จาก shift-and-add 11110 คือ 0b11110 หรือ 30 การคูณด้วย 10 (2) คือการเลื่อนซ้าย: 1100 = 12

[4]
[output]
0b11110
30
0b1100

5 Long division: quotient and remainder 5 การตั้งหาร: ผลหารและเศษ

30 // 5 is the quotient and 30 % 5 the remainder for 11110 ÷ 101. The second pair is 1011 ÷ 10 (11 ÷ 2), which has remainder 1.

30 // 5 คือผลหาร และ 30 % 5 คือเศษ ของ 11110 ÷ 101 คู่ที่สองคือ 1011 ÷ 10 (11 ÷ 2) ซึ่งมีเศษ 1

[5]
[output]
0b110
0
0b101
1

6 Division by a power of two = right shift 6 การหารด้วยเลขยกกำลังสอง = การเลื่อนขวา

n = 11 is 1011. Dividing by 2 drops the last bit (101, remainder 1); dividing by 4 drops the last two (10, remainder 11).

n = 11 คือ 1011 หารด้วย 2 คือตัดบิตท้ายออก 1 ตัว (101 เศษ 1) หารด้วย 4 คือตัดบิตท้ายออก 2 ตัว (10 เศษ 11)

[6]
[output]
0b1011
0b101
1
0b10
3

Note: Run uses a JavaScript simulator, not real Python. For real Python, try Google Colab. หมายเหตุ: ปุ่ม Run จำลองด้วย JavaScript ไม่ใช่ Python จริง หากต้องการ Python จริง ลองใช้ Google Colab

References References / แหล่งอ้างอิง

Sources used for binary arithmetic:

แหล่งที่ใช้ประกอบเนื้อหาเลขคณิตฐานสอง:

  1. Binary arithmetic — Wikipedia — Binary number (arithmetic) (addition, subtraction, multiplication, long division) (การบวก ลบ คูณ และการตั้งหาร)
  2. Division algorithm — Wikipedia — Division algorithm (quotient and remainder, shift-and-subtract) (ผลหารและเศษ วิธี shift-and-subtract)
  3. Arithmetic shift — Wikipedia — Arithmetic shift (multiply / divide by a power of two by shifting) (คูณ / หารด้วยเลขยกกำลังสองด้วยการเลื่อนบิต)
  4. Python bin — Built-in Functions — bin (used to inspect demo results) (ใช้ดูผลในตัวอย่าง Run)

End-of-lesson quizแบบฝึกหัดท้ายบท

ตอบแล้ว 0 / 10

ข้อ 1

1 / 10

Binary addition: what is 1 + 1?บวกฐานสอง: 1 + 1 ได้ผลลัพธ์เป็นเลขฐานสองใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (B) 1010

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 11
    Wrong: 1 + 1 is two, which must carry to the next column.ผิด: 1 + 1 มีค่าเป็นสอง ต้องทดไปหลักถัดไป
  • (B) 1010
    Correct! Write 0, carry 1 — that is two in denary.ถูกต้อง! เขียน 0 ทด 1 ค่าเท่ากับสองในฐานสิบ
  • (C) 100100
    Wrong: 100 is four, not two.ผิด: 100 มีค่าเท่ากับสี่ ไม่ใช่สอง
  • (D) 22
    Wrong: binary has no digit 2; it is written 10.ผิด: ฐานสองไม่มีหลัก 2 ต้องเขียนเป็น 10

ข้อ 2

2 / 10

Binary addition: what is 1 + 1 + 1?บวกฐานสอง: 1 + 1 + 1 ได้ผลลัพธ์เป็นเลขฐานสองใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (C) 1111

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 1010
    Wrong: 10 is two, but 1 + 1 + 1 is three.ผิด: 10 มีค่าเท่ากับสอง แต่ 1 + 1 + 1 เท่ากับสาม
  • (B) 110110
    Wrong: 110 is six.ผิด: 110 มีค่าเท่ากับหก
  • (C) 1111
    Correct! Three in denary is 11 — write 1, carry 1.ถูกต้อง! สามในฐานสิบคือ 11 เขียน 1 ทด 1
  • (D) 111111
    Wrong: 111 is seven.ผิด: 111 มีค่าเท่ากับเจ็ด

ข้อ 3

3 / 10

Binary addition: what is 101 + 11?บวกฐานสอง: 101 + 11 ได้เท่าใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (A) 10001000

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 10001000
    Correct! 5 + 3 = 8, and 1000 in binary is eight.ถูกต้อง! 5 + 3 = 8 และ 1000 ในฐานสองคือแปด
  • (B) 111111
    Wrong: 111 is seven, but 5 + 3 = 8.ผิด: 111 คือเจ็ด แต่ 5 + 3 = 8
  • (C) 10101010
    Wrong: 1010 is ten.ผิด: 1010 คือสิบ
  • (D) 110110
    Wrong: 110 is six.ผิด: 110 คือหก

ข้อ 4

4 / 10

Binary addition: what is 1101 + 1011?บวกฐานสอง: 1101 + 1011 ได้เท่าใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (D) 1100011000

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 1000010000
    Wrong: 10000 is sixteen, but 13 + 11 = 24.ผิด: 10000 คือสิบหก แต่ 13 + 11 = 24
  • (B) 1111011110
    Wrong: 11110 is thirty.ผิด: 11110 คือสามสิบ
  • (C) 1011010110
    Wrong: 10110 is twenty-two.ผิด: 10110 คือยี่สิบสอง
  • (D) 1100011000
    Correct! 13 + 11 = 24, and 11000 is 16 + 8 = 24.ถูกต้อง! 13 + 11 = 24 และ 11000 คือ 16 + 8 = 24

ข้อ 5

5 / 10

Binary subtraction (borrow method): a column needs 0 − 1. After borrowing 1 from the left, what digit goes in this column?ลบฐานสอง (วิธียืม): ในหลักหนึ่งต้องคำนวณ 0 − 1 หลังยืม 1 จากหลักซ้ายแล้ว เลขที่เขียนในหลักนี้คือ?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (B) 11

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 00
    Wrong: after the borrow this column is 10 − 1 = 1.ผิด: หลังยืมแล้วหลักนี้เป็น 10 − 1 = 1
  • (B) 11
    Correct! The borrow is worth two, so the column is 10 − 1 = 1.ถูกต้อง! ตัวที่ยืมมามีค่าสอง ในหลักนี้จึงเป็น 10 − 1 = 1
  • (C) 1010
    Wrong: a single column holds only 0 or 1.ผิด: หนึ่งหลักเขียนได้แค่ 0 หรือ 1
  • (D) 1111
    Wrong: 11 is three, not 10 − 1.ผิด: 11 คือสาม ไม่ใช่ผลของ 10 − 1

ข้อ 6

6 / 10

Binary subtraction: what is 1010 − 0011?ลบฐานสอง: 1010 − 0011 ได้เท่าใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (C) 01110111

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 10011001
    Wrong: 1001 is nine, but 10 − 3 = 7.ผิด: 1001 คือเก้า แต่ 10 − 3 = 7
  • (B) 01100110
    Wrong: 0110 is six.ผิด: 0110 คือหก
  • (C) 01110111
    Correct! 10 − 3 = 7, and 0111 is 4 + 2 + 1 = 7.ถูกต้อง! 10 − 3 = 7 และ 0111 คือ 4 + 2 + 1 = 7
  • (D) 11011101
    Wrong: 1101 is thirteen.ผิด: 1101 คือสิบสาม

ข้อ 7

7 / 10

Binary multiplication: what is 110 × 10?คูณฐานสอง: 110 × 10 ได้เท่าใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (A) 11001100

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 11001100
    Correct! Multiplying by 10 (two) shifts left one place: 6 × 2 = 12.ถูกต้อง! คูณด้วย 10 (สอง) คือเลื่อนซ้าย 1 หลัก: 6 × 2 = 12
  • (B) 10101010
    Wrong: 1010 is ten, but 6 × 2 = 12.ผิด: 1010 คือสิบ แต่ 6 × 2 = 12
  • (C) 110110
    Wrong: that is the original number, not multiplied.ผิด: นั่นคือตัวตั้งเดิม ยังไม่ได้คูณ
  • (D) 1010010100
    Wrong: 10100 is twenty.ผิด: 10100 คือยี่สิบ

ข้อ 8

8 / 10

Binary multiplication: what is 101 × 11?คูณฐานสอง: 101 × 11 ได้เท่าใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (D) 11111111

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 10001000
    Wrong: 1000 is eight, but 5 × 3 = 15.ผิด: 1000 คือแปด แต่ 5 × 3 = 15
  • (B) 1010110101
    Wrong: 10101 is twenty-one.ผิด: 10101 คือยี่สิบเอ็ด
  • (C) 10101010
    Wrong: 1010 is ten (that is only 101 shifted once).ผิด: 1010 คือสิบ (นี่คือ 101 เลื่อนซ้ายอย่างเดียว)
  • (D) 11111111
    Correct! 101 + 1010 = 1111, and 5 × 3 = 15.ถูกต้อง! 101 + 1010 = 1111 และ 5 × 3 = 15

ข้อ 9

9 / 10

Binary division: what is the quotient of 1100 ÷ 10 (it divides evenly)?หารฐานสอง: 1100 ÷ 10 ได้ผลหารเท่าใด (หารลงตัว)?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (B) 110110

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 1111
    Wrong: 11 is three, but 12 ÷ 2 = 6.ผิด: 11 คือสาม แต่ 12 ÷ 2 = 6
  • (B) 110110
    Correct! Dividing by 10 (two) drops the last bit: 1100 -> 110 = 6.ถูกต้อง! หารด้วย 10 (สอง) คือตัดบิตท้ายออก 1 ตัว: 1100 -> 110 = 6
  • (C) 10101010
    Wrong: 1010 is ten.ผิด: 1010 คือสิบ
  • (D) 10001000
    Wrong: 1000 is eight.ผิด: 1000 คือแปด

ข้อ 10

10 / 10

Binary long division: what are the quotient and remainder of 1011 ÷ 10?หารฐานสอง (ตั้งหาร): 1011 ÷ 10 ได้ผลหารและเศษเท่าใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (C) quotient 101, remainder 1ผลหาร 101 เศษ 1

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) quotient 110, remainder 0ผลหาร 110 เศษ 0
    Wrong: 110 is six, but 11 ÷ 2 = 5 remainder 1.ผิด: 110 คือหก แต่ 11 ÷ 2 = 5 เศษ 1
  • (B) quotient 100, remainder 1ผลหาร 100 เศษ 1
    Wrong: 100 is four; the quotient is 101 (five).ผิด: 100 คือสี่ ผลหารที่ถูกคือ 101 (ห้า)
  • (C) quotient 101, remainder 1ผลหาร 101 เศษ 1
    Correct! 11 = 5 × 2 + 1, so quotient 101, remainder 1.ถูกต้อง! 11 = 5 × 2 + 1 ผลหาร 101 เศษ 1
  • (D) quotient 101, remainder 0ผลหาร 101 เศษ 0
    Wrong: 1011 is odd, so dividing by 10 (two) leaves remainder 1.ผิด: 1011 เป็นเลขคี่ หารด้วย 10 (สอง) ต้องมีเศษ 1