You are on page 1of 12

Arithmetic with Unsigned Integers

José Navarro-Figueroa
Arithmetic with Unsigned Integers
Goals
• For unsigned integers
– Perform arithmetic operations on the binary system
– Perform arithmetic operations on the hex system

José Navarro 2020


Recognizing What 10𝑁 means
10𝑁 = 𝑁10

102 = 210

1016 = 1610

107 = 710

José Navarro 2020


Arithmetic with Unsigned Integers
• Addition using any base is done in the same way as in decimal
• Add the values ​in the columns starting from the rightmost column and
then moving to the left
• If the result in a column requires only one digit, it is written below the
column. If the result requires more than one digit, the left digit (or
digits) is added to the left column.

José Navarro 2020


Arithmetic with Unsigned Integers
• Rules for binary addition
–0+0=0
–0+1=1+0=1
– 1 + 1 = 10
Example 1: Example 2:
10110B + 11011B 1111B + 1111B + 1111B

José Navarro 2020


Arithmetic with Unsigned Integers
Example

When we work with N bits, if a carry = 1 is generated that enters position N


(remember that the MSb is in position N-1) then the result in the N bits
it is incorrect because the most significant bit was left out.

José Navarro 2020


Arithmetic with Unsigned Integers
• Remember that on a system with base n, the representation of
n is 10.

Example 3: Example 4:
5637 + 4327 38 ABH + 4 F 76 H

José Navarro 2020


Addition for Binary System
Example

When we work with N bits, if a carry = 1 is generated that enters position N


(remember that the MSb is in position N-1) then the result in the N bits
it is incorrect because the most significant bit was left out.

José Navarro 2020


Subtraction in Binary
Examples

José Navarro 2020


Addition for Hex System
Examples

José Navarro 2020


Subtraction for Hex System
Examples

José Navarro 2020


José Navarro 2020

You might also like