Binary addition and binary–decimal conversion

Học bằng cách chơi

Trả lời những câu hỏi này để kiếm năng lượng, rồi câu cá và khám phá. Không cần tài khoản.

Dành cho nhà giáo dục: slide bài học, ghi chú ôn tập, sơ đồ sẵn dùng cho Binary addition and binary–decimal conversion (KS3 Computing, Computer Systems) — dùng trong bài giảng của bạn, hoặc chạy chủ đề như một hoạt động lớp học tương tác để người học chơi như một trò chơi trực tiếp.

Ghi chú bài học

Binary Numbers

  • Binary is a base-2 numeral system using only two digits: 0 and 1.
  • Each binary digit is called a bit.
  • In binary, each position represents a power of 2, starting from 20 on the right.
  • Binary is used by computers because it is easy to implement with electronic circuits.

Computers use binary because a switch has two reliable states, easy to detect and hard to confuse.

Computers use binary because a switch has two reliable states, easy to detect and hard to confuse.

Converting Binary to Decimal

  • To convert binary to decimal, write the binary number with place values (powers of 2) above each bit.
  • Multiply each bit by its place value (0 or 1 times the power of 2).
  • Add all the products together to get the decimal value.
  • Example: 1011₂ = 1×8 + 0×4 + 1×2 + 1×1 = 11₁₀.

Converting Decimal to Binary

  • One method is division by 2: repeatedly divide the decimal number by 2, recording the remainder.
  • Read the remainders from bottom to top to get the binary equivalent.
  • Example: 13₁₀ → 13÷2=6 r1, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → 1101₂.
  • Another method is to subtract the largest power of 2 that fits, and mark that bit as 1.

Binary Addition

  • Binary addition follows rules similar to decimal, but with only 0 and 1.
  • Rules: 0+0=0, 0+1=1, 1+0=1, 1+1=0 with a carry of 1.
  • When adding multiple bits, include any carry from the previous column.
  • Example: 1011₂ + 1101₂ = 11000₂.

Carrying in Binary Addition

  • A carry occurs when the sum in a column is 2 or more.
  • In binary, 1+1=2, so write 0 and carry 1 to the next column.
  • If a carry is added to an existing 1, the sum becomes 2 again, so write 0 and carry 1 again.
  • Carries can propagate through multiple columns.

Overflow

  • Overflow happens when the result of binary addition is too large to fit in the fixed number of bits.
  • For example, adding two 4-bit numbers may produce a 5-bit result.
  • If only 4 bits are allowed, the extra bit is lost, causing an incorrect result.
  • Overflow can be detected when there is a carry out of the most significant bit.

Example: Binary Addition with Carries

  • Add 0111₂ (7) and 0101₂ (5) using 4 bits.
  • Column 1 (20): 1+1=0 carry 1.
  • Column 2 (21): 1+0+carry1 = 0 carry 1.
  • Column 3 (22): 1+1+carry1 = 1 carry 1.
  • Column 4 (23): 0+0+carry1 = 1, no carry out.
  • Result: 1100₂ (12). No overflow.

Example: Overflow in Binary Addition

  • Add 1001₂ (9) and 0111₂ (7) using 4 bits.
  • Column 1: 1+1=0 carry 1.
  • Column 2: 0+1+carry1 = 0 carry 1.
  • Column 3: 0+1+carry1 = 0 carry 1.
  • Column 4: 1+0+carry1 = 0 carry 1.
  • There is a carry out of the most significant bit, so overflow occurs; the 4-bit result 0000₂ is incorrect (should be 16).

Practical Applications

  • Binary addition is fundamental to computer arithmetic.
  • Overflow detection is important in programming and hardware design.
  • Understanding binary–decimal conversion helps in debugging and data representation.
  • These skills are essential for working with low-level computer systems.

In an 8-bit number each position is a power of two, from 128 down to 1.

Binary addition works column by column from the right, carrying whenever a column totals two or more.

Fixed-width storage has a maximum range; a result needing more bits than are available overflows.

Slide

Sign up free to view the lesson slides

Step through every slide for this topic — plus flashcards and revision notes — with a free account.

Câu hỏi luyện tập

Xem trước miễn phí — 8 trên 15 câu hỏi. Đăng ký để xem tất cả.
  1. 1.A binary digit is also known as a bit.

    Easy

    True or false?

  2. 2.What is the decimal value of the binary number 1010?

    Easy
    • A8
    • B10
    • C12
    • D14
  3. 3.Complete the sentence.

    Easy

    The base-2 numeral system uses only the digits ____ and ____.

  4. 4.Convert the decimal number 13 to binary. Enter your answer as a binary number (e.g. 101).

    Easy
  5. 5.What is the result of adding the binary numbers 0110 and 0011?

    Easy
    • A1001
    • B1010
    • C1100
    • D0111
  6. 6.What is the binary representation of the decimal number 25?

    Medium
  7. 7.What is the decimal value of the binary number 1111?

    Medium
    • A14
    • B15
    • C16
    • D17
  8. 8.When adding two 4-bit binary numbers, if the result requires 5 bits, an overflow has occurred.

    Medium

    True or false?

Unlock all 15 questions, flashcards & more

Tạo tài khoản miễn phí để xem mọi câu hỏi, slide, thẻ ghi nhớ và ghi chú ôn tập cho chủ đề này.

Đề thi cũ

Luyện đề thi cũ cho chủ đề này sắp ra mắt.
Sắp ra mắt