Back to 课程

Computer Science AS CIE

0% Complete
0/0 Steps
  1. data-representation as
    5 主题
  2. multimedia as
    3 主题
  3. compression as
    2 主题
  4. networks-and-the-internet as
    11 主题
  5. computers-and-components as
    5 主题
  6. logic-gates-and-logic-circuits as
    2 主题
  7. central-processing-unit-cpu-architecture as
    6 主题
  8. assembly-language- as
    4 主题
  9. bit-manipulation as
    1 主题
  10. operating-systems as
    3 主题
  11. language-translators as
    2 主题
  12. data-security as
    3 主题
  13. data-integrity as
    1 主题
  14. ethics-and-ownership as
    3 主题
  15. database-concepts as
    3 主题
  16. database-management-systems-dbms- as
    1 主题
  17. data-definition-language-ddl-and-data-manipulation-language-dml as
    1 主题
  18. computational-thinking-skills as
    1 主题
  19. algorithms as
    4 主题
  20. data-types-and-records as
    2 主题
  21. arrays as
    2 主题
  22. files as
    1 主题
  23. introduction-to-abstract-data-types-adt as
    1 主题
  24. programming-basics as
    1 主题
  25. constructs as
    2 主题
  26. structured-programming as
    1 主题
  27. program-development-life-cycle as
    1 主题
  28. program-design- as
    2 主题
  29. program-testing-and-maintenance as
    3 主题
课 Progress
0% Complete

Exam code:9618

Binary addition

What is binary addition?

  • Binary addition involves summing numbers in base-2, which uses only the digits 0 and 1

  • Like denary addition, start from the rightmost digit and move towards the left

  • Carrying over occurs when the sum of a column is greater than 1, passing the excess to the next left column

Example addition

binary-addition

Worked Example

Add the following two binary integers using binary addition. Show your working. [2]

1 0 0 1 1 0 1 0 + 0 0 1 0 1 1 1 1

Answer

carry

1

1

1

1

1

1

0

0

1

1

0

1

0

+

0

0

1

0

1

1

1

1

1

1

0

0

1

0

0

1

  • 1 mark for working [1 mark]

  • 1 mark for answer [1 mark]

Overflow

What is an overflow?

  • Overflow occurs when the sum of two binary numbers exceeds the given number of bits

  • In signed number representations, the leftmost bit often serves as the sign bit; overflow can flip this, incorrectly changing the sign of the result

  • Overflow generally leads to incorrect or unpredictable results as the extra bits are truncated or wrapped around

overflow

Binary subtraction

  • To carry out subtraction, the number being subtracted is converted into its negative equivalent using two’s complement

  • The two numbers are then added together

Example

  • 48 – 12

<td class=”

-128

64

32

16

8

4

2

1

0

0

1

1

0

0

0

0

= 48

0

0

0

0

1

1

0

0

= 12

find two’s complement of -12

0

0

0

0

1

1

0

0

= 12

invert

1

1

1

1

0

0

1

1

add 1

1

result

1

1

1

1

0

1

0

0

= -12

Add 48 and -12

-128

64

32

16

8

4

2

1

0

0

1

1

0

0

0

0

= 48

Responses

您的邮箱地址不会被公开。 必填项已用 * 标注